69 mpEnrichmentFunc(NULL),
70 mpEnrichmentFrontStart(NULL),
71 mpEnrichmentFrontEnd(NULL),
73 mpPropagationLaw(NULL),
75 mInheritBoundaryConditions(false),
76 mInheritOrderedBoundaryConditions(false),
79 mpEnrichesDofsWithIdArray(),
80 mLevelSetsNeedUpdate(true),
81 mLevelSetTol2(1.0e-12)
153 switch ( res->second ) {
205 int numEnrCand = enrichesDofsWithIdArray->
giveSize();
214 for (
int i = 1; i <= numEnrFunc; i++ ) {
215 for (
int j = 1; j <= numEnrCand; j++ ) {
222 oDofIdArray.
resize(count);
223 for (
int i = 1; i <= count; i++ ) {
234 int eiEnrSize = enrichesDofsWithIdArray->
giveSize();
237 for (
int i = 1; i <= eiEnrSize; i++ ) {
253 oLevelSet = res->second;
265 oLevelSet = res->second;
277 oNodeEnrMarker = double( res->second );
280 oNodeEnrMarker = 0.0;
298 for (
int i = 1; i <= nrDofMan; i++ ) {
307 for (
Dof *dof: *dMan ) {
311 bool foundBC =
false;
320 for (
auto &dofid: EnrDofIdArray ) {
321 if ( !dMan->hasDofID( (
DofIDItem ) ( dofid ) ) ) {
352 for (
int i = 1; i <= nrDofMan; i++ ) {
356 std :: vector< DofIDItem >dofsToRemove;
357 for (
Dof *dof: *dMan ) {
361 bool dofIsInIdArray =
false;
362 for (
int k = 1; k <= EnrDofIdArray.
giveSize(); k++ ) {
364 dofIsInIdArray =
true;
369 if ( !dofIsInIdArray ) {
370 dofsToRemove.push_back(dofID);
380 for (
size_t j = 0; j < dofsToRemove.size(); j++ ) {
381 dMan->removeDof(dofsToRemove [ j ]);
392 xi = ( iQ1 + iQ2 ) / ( iQ1 - iQ2 );
409 iPos.
at(1) - iOrigin.
at(1), iPos.
at(2) - iOrigin.
at(2)
412 const double tol = 1.0e-20;
421 const double pi =
M_PI;
434 const double tol_q = 1.0e-3;
437 if ( iFlipTangent ) {
443 phi_r = fabs(phi / oR);
450 if ( iEfInput.
mArcPos < tol_q || iEfInput.
mArcPos > ( 1.0 - tol_q ) ) {
456 oTheta = asin(q_dot_n);
459 oTheta = pi - asin( fabs(phi_r) );
461 oTheta = -pi + asin( fabs(phi_r) );
505 if ( tipEl != NULL ) {
513 double normalSignDist;
519 if ( fabs(normalSignDist) < tol && tangSignDist > tol ) {
void setPropagationLaw(PropagationLaw *ipPropagationLaw)
The base class for all spatial localizers.
virtual int giveDofPoolSize() const
bool isElementEnriched(const Element *element) const
int giveNumberOfDofs() const
void setEnrichmentFrontStart(EnrichmentFront *ipEnrichmentFrontStart, bool iDeleteOld=true)
#define _IFT_EnrichmentItem_front
bool evalNodeEnrMarkerInNode(double &oNodeEnrMarker, int iNodeInd) const
virtual void evalN(FloatArray &answer, const FloatArray &lcoords, const FEICellGeometry &cellgeo)=0
Evaluates the array of interpolation functions (shape functions) at given point.
std::unordered_map< int, NodeEnrichmentType > mNodeEnrMarkerMap
bool isDofManEnriched(const DofManager &iDMan) const
EnrichmentItem(int n, XfemManager *xm, Domain *aDomain)
Constructor / destructor.
virtual int giveMaxNumEnrichments() const =0
static double giveApproxZero()
virtual void computeEnrichedDofManDofIdArray(IntArray &oDofIdArray, DofManager &iDMan)
Compute Id's of enriched dofs for a given DofManager.
int giveGlobalNumber() const
int giveNumberOfDofManagers() const
Returns number of dof managers in domain.
#define _IFT_EnrichmentItem_inheritbc
double & at(int i)
Coefficient access function.
int max(int i, int j)
Returns bigger value form two given decimals.
TipInfo gathers useful information about a crack tip, like its position and tangent direction...
int giveEndOfDofIdPool() const
int mPropLawIndex
mPropLawIndex: nonzero if a propagation law is present, zero otherwise.
Updates the geometry of evolving XFEM interfaces.
virtual ~EnrichmentItem()
Abstract base class for all finite elements.
Base class for dof managers.
static const double mLevelSetRelTol
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
void findNonzeros(const IntArray &logical)
Finds all indices where the input array is nonzero.
Class implementing an array of integers.
int & at(int i)
Coefficient access function.
void setEnrichmentFrontEnd(EnrichmentFront *ipEnrichmentFrontEnd, bool iDeleteOld=true)
virtual int giveNumberOfDofManagers() const
virtual void createEnrichedDofs()
virtual FEInterpolation * giveInterpolation() const
bool containsOnlyZeroes() const
Checks if receiver is all zero.
Base abstract class representing cross section in finite element mesh.
bool mInheritOrderedBoundaryConditions
int giveNumDofManEnrichments(const DofManager &iDMan) const
int giveNumberOfEnrDofs() const
double distance(const FloatArray &x) const
Computes the distance between position represented by receiver and position given as parameter...
Class representing a general abstraction for finite element interpolation class.
std::unordered_map< int, double > mLevelSetTangDirMap
Class representing "master" degree of freedom.
const IntArray & giveDofManArray() const
double dotProduct(const FloatArray &x) const
Computes the dot product (or inner product) of receiver and argument.
bool mInheritBoundaryConditions
If newly created enriched dofs should inherit boundary conditions from the node they are introduced i...
void clear()
Clears the array (zero size).
DofIDItem
Type representing particular dof type.
Class EnrichmentFront: describes the edge or tip of an XFEM enrichment.
#define _IFT_EnrichmentItem_propagationlaw
SpatialLocalizer * giveSpatialLocalizer()
Returns receiver's associated spatial localizer.
virtual void givePotentialEIDofIdArray(IntArray &answer) const
bool evalLevelSetNormalInNode(double &oLevelSet, int iNodeInd, const FloatArray &iGlobalCoord) const
Wrapper around element definition to provide FEICellGeometry interface.
int giveStartOfDofIdPool() const
std::unordered_map< int, double > mLevelSetNormalDirMap
void resize(int n)
Checks size of receiver towards requested bounds.
virtual Element * giveElementContainingPoint(const FloatArray &coords, const IntArray *regionList=NULL)=0
Returns the element, containing given point and belonging to one of the region in region list...
const IntArray * giveEnrichesDofsWithIdArray() const
bool evalLevelSetTangInNode(double &oLevelSet, int iNodeInd, const FloatArray &iGlobalCoord) const
Class representing vector of real numbers.
bool hasDofID(DofIDItem id) const
Checks if receiver contains dof with given ID.
PropagationLaw * mpPropagationLaw
This class manages the xfem part.
IRResultType
Type defining the return values of InputRecord reading operations.
EnrichmentFront * mpEnrichmentFrontStart
EnrichmentFunction * mpEnrichmentFunc
virtual void evalLevelSetTangential(double &oLevelSet, const FloatArray &iGlobalCoord, const FloatArray &iN, const IntArray &iNodeInd) const =0
Evaluate the tangential direction level set in the point iGlobalCoord.
void followedBy(const IntArray &b, int allocChunk=0)
Appends array b at the end of receiver.
virtual bool hasPropagation() const =0
EnrichmentFront * mpEnrichmentFrontEnd
static void calcPolarCoord(double &oR, double &oTheta, const FloatArray &iOrigin, const FloatArray &iPos, const FloatArray &iN, const FloatArray &iT, const EfInput &iEfInput, bool iFlipTangent)
int mEnrFrontIndex
mEnrFrontIndex: nonzero if an enrichment front is present, zero otherwise.
void times(double s)
Multiplies receiver with scalar.
virtual bool computeLocalCoordinates(FloatArray &answer, const FloatArray &gcoords)
Computes the element local coordinates from given global coordinates.
bool tipIsTouchingEI(const TipInfo &iTipInfo)
Domain * giveDomain() const
static double calcXiZeroLevel(const double &iQ1, const double &iQ2)
virtual bool isMaterialModified(GaussPoint &iGP, Element &iEl, CrossSection *&opCS) const
#define _IFT_EnrichmentItem_inheritorderedbc
virtual bool hasPropagatingFronts() const
the oofem namespace is to define a context or scope in which all oofem names are defined.
DofManager * giveDofManager(int i) const
static const double mLevelSetTol
Abstract class Dof represents Degree Of Freedom in finite element mesh.
virtual void callGnuplotExportModule(GnuplotExportModule &iExpMod, TimeStep *tStep)
DofManager * giveDofManager(int n)
Service for accessing particular domain dof manager.
virtual void giveEIDofIdArray(IntArray &answer) const
(Under development) The Gnuplot export module enables OOFEM to export some data in a format that can ...
Class representing integration point in finite element program.
virtual void evalLevelSetNormal(double &oLevelSet, const FloatArray &iGlobalCoord, const FloatArray &iN, const IntArray &iNodeInd) const =0
Evaluate the normal direction level set in the point iGlobalCoord.
Class representing solution step.
The top abstract class of all classes constituting the finite element mesh.
int findFirstIndexOf(int value) const
Finds index of first occurrence of given value in array.
virtual int giveNumEnrichments(const DofManager &iDMan) const =0