Skip to content

Commit

Permalink
Merge pull request #1 from hugtalbot/v22.06
Browse files Browse the repository at this point in the history
Updates for v22.06 release
  • Loading branch information
hugtalbot authored Apr 27, 2022
2 parents 7063102 + fe50ccd commit bd42c09
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 102 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.12)
project(SofaMJEDFEM VERSION 1.0 LANGUAGES CXX)
project(SofaMJEDFEM VERSION 21.12 LANGUAGES CXX)

find_package(SofaFramework REQUIRED)
find_package(SofaBaseTopology REQUIRED)
Expand Down
26 changes: 9 additions & 17 deletions src/SofaMJEDFEM/MJEDTetrahedralForceField.h
Original file line number Diff line number Diff line change
Expand Up @@ -230,27 +230,20 @@ protected :

void draw(const core::visual::VisualParams* vparams) override;


/** Method to initialize @sa TetrahedronRestInformation when a new Tetrahedron is created.
* Will be set as creation callback in the TetrahedronData @sa tetrahedronInfo
*/
void createTetrahedronRestInformation(Index, TetrahedronRestInformation& t,
const core::topology::BaseMeshTopology::Tetrahedron&,
const sofa::type::vector<Index>&,
const sofa::type::vector<double>&);

type::Mat<3,3,double> getPhi( int tetrahedronIndex);
type::Mat<3,3,double> getForce( int tetrahedronIndex);
TetrahedronData<sofa::type::vector<TetrahedronRestInformation> > tetrahedronInfo;
EdgeData<sofa::type::vector<EdgeInformation> > edgeInfo;

class TetrahedronHandler : public TopologyDataHandler<core::topology::BaseMeshTopology::Tetrahedron,sofa::type::vector<TetrahedronRestInformation> >
{
public:
typedef typename MJEDTetrahedralForceField<DataTypes>::TetrahedronRestInformation TetrahedronRestInformation;
TetrahedronHandler(MJEDTetrahedralForceField<DataTypes>* ff,TetrahedronData<sofa::type::vector<TetrahedronRestInformation> >* data )
:TopologyDataHandler<core::topology::BaseMeshTopology::Tetrahedron,sofa::type::vector<TetrahedronRestInformation> >(data)
,ff(ff)
{
}

void applyCreateFunction(unsigned int, TetrahedronRestInformation &t, const core::topology::BaseMeshTopology::Tetrahedron
&, const sofa::type::vector<unsigned int> &, const sofa::type::vector<double> &);

protected:
MJEDTetrahedralForceField<DataTypes>* ff;
};
protected:

/// the array that describes the complete material energy and its derivatives
Expand All @@ -261,7 +254,6 @@ protected :
void testDerivatives();// a test to check the accuracy of Addforce and AddDforce, it needs the calculus of the total strain energy
void saveMesh( const char *filename );

TetrahedronHandler* tetrahedronHandler;
VecCoord myposition;

};
Expand Down
Loading

0 comments on commit bd42c09

Please sign in to comment.