Skip to content

Commit

Permalink
Implemented surface constraint member function to choose whether a no…
Browse files Browse the repository at this point in the history
…dal integration rule should be installed on the surface. The fixed normal displacement now sets a non-nodal integration rule.
  • Loading branch information
SteveMaas1978 committed Nov 27, 2024
1 parent cb2a0e6 commit c64a1bf
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions FEBioMech/FEFixedNormalDisplacement.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ class FEFixedNormalDisplacement : public FESurfaceConstraint

// allocate equations
int InitEquations(int neq) override;

// we don't use nodal integration for this constraint
bool UseNodalIntegration() { return false; };

protected:
void Update(const std::vector<double>& Ui, const std::vector<double>& ui) override;
Expand Down
2 changes: 1 addition & 1 deletion FEBioXML/FEBioConstraintsSection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ void FEBioConstraintsSection25::Parse(XMLTag &tag)
const char* szsurf = tag.AttributeValue("surface");
FEFacetSet* pface = mesh.FindFacetSet(szsurf);
if (pface == 0) throw XMLReader::InvalidAttributeValue(tag, "surface", szsurf);
if (GetBuilder()->BuildSurface(*psurf, *pface, true) == false) throw XMLReader::InvalidAttributeValue(tag, "surface", szsurf);
if (GetBuilder()->BuildSurface(*psurf, *pface, psc->UseNodalIntegration()) == false) throw XMLReader::InvalidAttributeValue(tag, "surface", szsurf);
}

// get the nodeset for other constraints
Expand Down
5 changes: 5 additions & 0 deletions FECore/FESurfaceConstraint.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,9 @@ class FECORE_API FESurfaceConstraint : public FENLConstraint

// return the surface
virtual FESurface* GetSurface() { return 0; }

// we need an integration rule for all surfaces.
// By default, this was always assumed to be a nodal integration rule
// but this is not always desired, so derived classes can override this
virtual bool UseNodalIntegration() { return true; };
};

0 comments on commit c64a1bf

Please sign in to comment.