Skip to content

Commit

Permalink
Fixed some issues related to erosion in shells and contact.
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveMaas1978 committed Oct 10, 2024
1 parent b6b5e38 commit a4afa17
Show file tree
Hide file tree
Showing 8 changed files with 1,757 additions and 1,636 deletions.
400 changes: 218 additions & 182 deletions FEBioMech/FEContactPotential.cpp

Large diffs are not rendered by default.

212 changes: 114 additions & 98 deletions FEBioMech/FEElasticShellDomain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,15 +141,18 @@ void FEElasticShellDomain::PreSolveUpdate(const FETimeInfo& timeInfo)
for (size_t i=0; i<m_Elem.size(); ++i)
{
FEShellElement& el = m_Elem[i];
int n = el.GaussPoints();
for (int j=0; j<n; ++j)
{
FEMaterialPoint& mp = *el.GetMaterialPoint(j);
FEElasticMaterialPoint& pt = *mp.ExtractData<FEElasticMaterialPoint>();
pt.m_Wp = pt.m_Wt;

mp.Update(timeInfo);
}
if (el.isActive())
{
int n = el.GaussPoints();
for (int j = 0; j < n; ++j)
{
FEMaterialPoint& mp = *el.GetMaterialPoint(j);
FEElasticMaterialPoint& pt = *mp.ExtractData<FEElasticMaterialPoint>();
pt.m_Wp = pt.m_Wt;

mp.Update(timeInfo);
}
}
}
}

Expand All @@ -167,19 +170,21 @@ void FEElasticShellDomain::InternalForces(FEGlobalVector& R)

// get the element
FEShellElement& el = m_Elem[i];

// create the element force vector and initialize to zero
int ndof = 6*el.Nodes();
fe.assign(ndof, 0);

// calculate element's internal force
ElementInternalForce(el, fe);

// get the element's LM vector
UnpackLM(el, lm);

// assemble the residual
R.Assemble(el.m_node, lm, fe, true);
if (el.isActive())
{
// create the element force vector and initialize to zero
int ndof = 6 * el.Nodes();
fe.assign(ndof, 0);

// calculate element's internal force
ElementInternalForce(el, fe);

// get the element's LM vector
UnpackLM(el, lm);

// assemble the residual
R.Assemble(el.m_node, lm, fe, true);
}
}
}

Expand Down Expand Up @@ -253,19 +258,21 @@ void FEElasticShellDomain::BodyForce(FEGlobalVector& R, FEBodyForce& BF)

// get the element
FEShellElement& el = m_Elem[i];

// create the element force vector and initialize to zero
int ndof = 6*el.Nodes();
fe.assign(ndof, 0);

// apply body forces to shells
ElementBodyForce(BF, el, fe);

// get the element's LM vector
UnpackLM(el, lm);

// assemble the residual
R.Assemble(el.m_node, lm, fe, true);
if (el.isActive())
{
// create the element force vector and initialize to zero
int ndof = 6 * el.Nodes();
fe.assign(ndof, 0);

// apply body forces to shells
ElementBodyForce(BF, el, fe);

// get the element's LM vector
UnpackLM(el, lm);

// assemble the residual
R.Assemble(el.m_node, lm, fe, true);
}
}
}

Expand Down Expand Up @@ -327,19 +334,22 @@ void FEElasticShellDomain::InertialForces(FEGlobalVector& R, vector<double>& F)

// get the element
FEShellElement& el = m_Elem[i];

// get the element force vector and initialize it to zero
int ndof = 6*el.Nodes();
fe.assign(ndof, 0);

// calculate internal force vector
ElementInertialForce(el, fe);

// get the element's LM vector
UnpackLM(el, lm);

// assemble element 'fe'-vector into global R vector
R.Assemble(el.m_node, lm, fe, true);
if (el.isActive())
{

// get the element force vector and initialize it to zero
int ndof = 6 * el.Nodes();
fe.assign(ndof, 0);

// calculate internal force vector
ElementInertialForce(el, fe);

// get the element's LM vector
UnpackLM(el, lm);

// assemble element 'fe'-vector into global R vector
R.Assemble(el.m_node, lm, fe, true);
}
}
}

Expand Down Expand Up @@ -450,22 +460,24 @@ void FEElasticShellDomain::StiffnessMatrix(FELinearSystem& LS)
for (int iel=0; iel<NS; ++iel)
{
FEShellElement& el = m_Elem[iel];

// create the element's stiffness matrix
FEElementMatrix ke(el);
int ndof = 6*el.Nodes();
ke.resize(ndof, ndof);

// calculate the element stiffness matrix
ElementStiffness(iel, ke);

// get the element's LM vector
vector<int> lm;
UnpackLM(el, lm);
ke.SetIndices(lm);

// assemble element matrix in global stiffness matrix
LS.Assemble(ke);
if (el.isActive())
{
// create the element's stiffness matrix
FEElementMatrix ke(el);
int ndof = 6 * el.Nodes();
ke.resize(ndof, ndof);

// calculate the element stiffness matrix
ElementStiffness(iel, ke);

// get the element's LM vector
vector<int> lm;
UnpackLM(el, lm);
ke.SetIndices(lm);

// assemble element matrix in global stiffness matrix
LS.Assemble(ke);
}
}
}

Expand All @@ -478,23 +490,25 @@ void FEElasticShellDomain::MassMatrix(FELinearSystem& LS, double scale)
for (int iel=0; iel<NE; ++iel)
{
FEShellElement& el = m_Elem[iel];

// create the element's stiffness matrix
FEElementMatrix ke(el);
int ndof = 6*el.Nodes();
ke.resize(ndof, ndof);
ke.zero();

// calculate inertial stiffness
ElementMassMatrix(el, ke, scale);

// get the element's LM vector
vector<int> lm;
UnpackLM(el, lm);
ke.SetIndices(lm);

// assemble element matrix in global stiffness matrix
LS.Assemble(ke);
if (el.isActive())
{
// create the element's stiffness matrix
FEElementMatrix ke(el);
int ndof = 6 * el.Nodes();
ke.resize(ndof, ndof);
ke.zero();

// calculate inertial stiffness
ElementMassMatrix(el, ke, scale);

// get the element's LM vector
vector<int> lm;
UnpackLM(el, lm);
ke.SetIndices(lm);

// assemble element matrix in global stiffness matrix
LS.Assemble(ke);
}
}
}

Expand All @@ -507,23 +521,25 @@ void FEElasticShellDomain::BodyForceStiffness(FELinearSystem& LS, FEBodyForce& b
for (int iel=0; iel<NE; ++iel)
{
FEShellElement& el = m_Elem[iel];

// create the element's stiffness matrix
FEElementMatrix ke(el);
int ndof = 6*el.Nodes();
ke.resize(ndof, ndof);
ke.zero();

// calculate inertial stiffness
ElementBodyForceStiffness(bf, el, ke);

// get the element's LM vector
vector<int> lm;
UnpackLM(el, lm);
ke.SetIndices(lm);

// assemble element matrix in global stiffness matrix
LS.Assemble(ke);
if (el.isActive())
{
// create the element's stiffness matrix
FEElementMatrix ke(el);
int ndof = 6 * el.Nodes();
ke.resize(ndof, ndof);
ke.zero();

// calculate inertial stiffness
ElementBodyForceStiffness(bf, el, ke);

// get the element's LM vector
vector<int> lm;
UnpackLM(el, lm);
ke.SetIndices(lm);

// assemble element matrix in global stiffness matrix
LS.Assemble(ke);
}
}
}

Expand Down
Loading

0 comments on commit a4afa17

Please sign in to comment.