Skip to content

Commit

Permalink
Added ability to plot nodal strains and shell nodal strains
Browse files Browse the repository at this point in the history
  • Loading branch information
gateshian committed Nov 5, 2024
1 parent 1d17166 commit 642a824
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 0 deletions.
2 changes: 2 additions & 0 deletions FEBioMech/FEBioMechModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -777,6 +777,8 @@ void FEBioMech::InitModule()
REGISTER_FECORE_CLASS(FEPlotSPRPrincStresses, "SPR principal stress");
REGISTER_FECORE_CLASS(FEPlotNodalStresses, "nodal stress");
REGISTER_FECORE_CLASS(FEPlotShellNodalStresses, "shell nodal stress");
REGISTER_FECORE_CLASS(FEPlotNodalStrains, "nodal strain");
REGISTER_FECORE_CLASS(FEPlotShellNodalStrains, "shell nodal strain");
REGISTER_FECORE_CLASS(FEPlotShellStrain, "shell strain");
REGISTER_FECORE_CLASS(FEPlotDeformationGradient, "deformation gradient");
REGISTER_FECORE_CLASS(FEPlotLagrangeStrain, "Lagrange strain");
Expand Down
27 changes: 27 additions & 0 deletions FEBioMech/FEBioMechPlot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -795,6 +795,19 @@ class FEStress
}
};

class FEStrain
{
public:
mat3ds operator()(const FEMaterialPoint& mp)
{
FEElement* el = mp.m_elem;
FEShellElementNew* se = dynamic_cast<FEShellElementNew*>(el);
const FEElasticMaterialPoint* pt = mp.ExtractData<FEElasticMaterialPoint>();
if (se) return se->m_E[mp.m_index];
else return (pt ? pt->Strain() : mat3ds(0));
}
};

//-----------------------------------------------------------------------------
//! Store the average stresses for each element.
bool FEPlotElementStress::Save(FEDomain& dom, FEDataStream& a)
Expand Down Expand Up @@ -892,6 +905,20 @@ bool FEPlotShellNodalStresses::Save(FEDomain& dom, FEDataStream& a)
return true;
}

//-----------------------------------------------------------------------------
bool FEPlotNodalStrains::Save(FEDomain& dom, FEDataStream& a)
{
writeNodalProjectedElementValues<mat3ds>(dom, a, FEStrain());
return true;
}

//-----------------------------------------------------------------------------
bool FEPlotShellNodalStrains::Save(FEDomain& dom, FEDataStream& a)
{
writeShellNodalProjectedElementValues<mat3ds>(dom, a, FEStrain());
return true;
}

//=============================================================================
FEPlotElementMixtureStress::FEPlotElementMixtureStress(FEModel* pfem) : FEPlotDomainData(pfem, PLT_MAT3FS, FMT_ITEM)
{
Expand Down
18 changes: 18 additions & 0 deletions FEBioMech/FEBioMechPlot.h
Original file line number Diff line number Diff line change
Expand Up @@ -937,6 +937,24 @@ class FEPlotShellNodalStresses : public FEPlotDomainData
bool Save(FEDomain& dom, FEDataStream& a);
};

//-----------------------------------------------------------------------------
//! Class that projects Lagrange strains from integration points to the nodes
class FEPlotNodalStrains : public FEPlotDomainData
{
public:
FEPlotNodalStrains(FEModel* pfem) : FEPlotDomainData(pfem, PLT_MAT3FS, FMT_MULT){ SetUnits(UNIT_NONE); }
bool Save(FEDomain& dom, FEDataStream& a);
};

//-----------------------------------------------------------------------------
//! Class that projects Lagrange strains from integration points to the shell nodes
class FEPlotShellNodalStrains : public FEPlotDomainData
{
public:
FEPlotShellNodalStrains(FEModel* pfem) : FEPlotDomainData(pfem, PLT_MAT3FS, FMT_MULT){ SetUnits(UNIT_NONE); }
bool Save(FEDomain& dom, FEDataStream& a);
};

//-----------------------------------------------------------------------------
//! Deformation gradient
class FEPlotDeformationGradient : public FEPlotDomainData
Expand Down

0 comments on commit 642a824

Please sign in to comment.