64const double EnrichmentItem :: mLevelSetTol = 1.0e-12;
65const double EnrichmentItem :: mLevelSetRelTol = 1.0e-3;
80EnrichmentItem :: ~EnrichmentItem()
100EnrichmentItem :: giveDofPoolSize()
const
106EnrichmentItem :: giveNumberOfEnrDofs()
const
121bool EnrichmentItem :: isElementEnriched(
const Element *element)
const
132int EnrichmentItem :: giveNumDofManEnrichments(
const DofManager &iDMan)
const
138 switch ( res->second ) {
170bool EnrichmentItem :: hasPropagatingFronts()
const
190 int numEnrCand = enrichesDofsWithIdArray->
giveSize();
199 for (
int i = 1; i <= numEnrFunc; i++ ) {
200 for (
int j = 1; j <= numEnrCand; j++ ) {
207 oDofIdArray.
resize(count);
208 for (
int i = 1; i <= count; i++ ) {
214EnrichmentItem :: giveEIDofIdArray(
IntArray &answer)
const
219 int eiEnrSize = enrichesDofsWithIdArray->
giveSize();
222 for (
int i = 1; i <= eiEnrSize; i++ ) {
227void EnrichmentItem :: givePotentialEIDofIdArray(
IntArray &answer)
const {
234bool EnrichmentItem :: evalLevelSetNormalInNode(
double &oLevelSet,
int iNodeInd,
const FloatArray &iGlobalCoord)
const
238 oLevelSet = res->second;
246bool EnrichmentItem :: evalLevelSetTangInNode(
double &oLevelSet,
int iNodeInd,
const FloatArray &iGlobalCoord)
const
250 oLevelSet = res->second;
258bool EnrichmentItem :: evalNodeEnrMarkerInNode(
double &oNodeEnrMarker,
int iNodeInd)
const
262 oNodeEnrMarker = double( res->second );
265 oNodeEnrMarker = 0.0;
270void EnrichmentItem :: createEnrichedDofs()
274 int nrDofMan = this->
giveDomain()->giveNumberOfDofManagers();
283 for (
int i = 1; i <= nrDofMan; i++ ) {
292 for (
Dof *dof: *dMan ) {
296 bool foundBC =
false;
305 for (
auto &dofid: EnrDofIdArray ) {
306 if ( !dMan->hasDofID( (
DofIDItem ) ( dofid ) ) ) {
337 for (
int i = 1; i <= nrDofMan; i++ ) {
341 std :: vector< DofIDItem >dofsToRemove;
342 for (
auto &dof: *dMan ) {
346 bool dofIsInIdArray =
false;
347 for (
int k = 1; k <= EnrDofIdArray.
giveSize(); k++ ) {
349 dofIsInIdArray =
true;
354 if ( !dofIsInIdArray ) {
355 dofsToRemove.push_back(dofID);
359 if(
mEIDofIdArray.findFirstIndexOf(dofID) == 0 && dofIsInIdArray) {
365 for (
size_t j = 0; j < dofsToRemove.size(); j++ ) {
372double EnrichmentItem :: calcXiZeroLevel(
const double &iQ1,
const double &iQ2)
377 xi = ( iQ1 + iQ2 ) / ( iQ1 - iQ2 );
394 iPos.
at(1) - iOrigin.
at(1), iPos.
at(2) - iOrigin.
at(2)
397 const double tol = 1.0e-20;
406 const double pi =
M_PI;
419 const double tol_q = 1.0e-3;
422 if ( iFlipTangent ) {
428 phi_r = fabs(phi / oR);
431 if ( phi_r > 1.0 - XfemTolerances :: giveApproxZero() ) {
432 phi_r = 1.0 - XfemTolerances :: giveApproxZero();
435 if ( iEfInput.
mArcPos < tol_q || iEfInput.
mArcPos > ( 1.0 - tol_q ) ) {
437 if ( q_dot_n > 1.0 - XfemTolerances :: giveApproxZero() ) {
438 q_dot_n = 1.0 - XfemTolerances :: giveApproxZero();
441 oTheta = asin(q_dot_n);
444 oTheta = pi - asin( fabs(phi_r) );
446 oTheta = -pi + asin( fabs(phi_r) );
451void EnrichmentItem :: setPropagationLaw(std::unique_ptr<PropagationLaw> ipPropagationLaw)
462void EnrichmentItem :: setEnrichmentFrontStart(std::unique_ptr<EnrichmentFront> ipEnrichmentFrontStart,
bool iDeleteOld)
471void EnrichmentItem :: setEnrichmentFrontEnd(std::unique_ptr<EnrichmentFront> ipEnrichmentFrontEnd,
bool iDeleteOld)
480bool EnrichmentItem :: tipIsTouchingEI(
const TipInfo &iTipInfo)
494 double normalSignDist;
500 if ( fabs(normalSignDist) < tol && tangSignDist > tol ) {
int giveGlobalNumber() const
bool hasDofID(DofIDItem id) const
void removeDof(DofIDItem id)
virtual FEInterpolation * giveInterpolation() const
const IntArray & giveDofManArray() const
virtual int giveNumberOfDofManagers() const
DofManager * giveDofManager(int i) const
virtual bool computeLocalCoordinates(FloatArray &answer, const FloatArray &gcoords)
bool mLevelSetsNeedUpdate
static const double mLevelSetTol
int mEnrFrontIndex
mEnrFrontIndex: nonzero if an enrichment front is present, zero otherwise.
virtual void evalLevelSetNormal(double &oLevelSet, const FloatArray &iGlobalCoord, const FloatArray &iN, const IntArray &iNodeInd) const =0
std::unique_ptr< EnrichmentFront > mpEnrichmentFrontEnd
std ::unordered_map< int, NodeEnrichmentType > mNodeEnrMarkerMap
std::unique_ptr< EnrichmentFront > mpEnrichmentFrontStart
std::unique_ptr< EnrichmentFunction > mpEnrichmentFunc
int giveNumDofManEnrichments(const DofManager &iDMan) const
int mPropLawIndex
mPropLawIndex: nonzero if a propagation law is present, zero otherwise.
std::shared_ptr< InputRecord > thisIr
std ::unordered_map< int, double > mLevelSetTangDirMap
std ::unordered_map< int, double > mLevelSetNormalDirMap
int giveNumberOfEnrDofs() const
const IntArray * giveEnrichesDofsWithIdArray() const
int giveStartOfDofIdPool() const
IntArray mpEnrichesDofsWithIdArray
Geometry associated with EnrichmentItem.
std::unique_ptr< PropagationLaw > mpPropagationLaw
bool isDofManEnriched(const DofManager &iDMan) const
virtual void computeEnrichedDofManDofIdArray(IntArray &oDofIdArray, DofManager &iDMan)
bool mInheritBoundaryConditions
int giveEndOfDofIdPool() const
const double mLevelSetTol2
virtual void evalLevelSetTangential(double &oLevelSet, const FloatArray &iGlobalCoord, const FloatArray &iN, const IntArray &iNodeInd) const =0
bool mInheritOrderedBoundaryConditions
virtual void evalN(FloatArray &answer, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const =0
Domain * giveDomain() const
FEMComponent(int n, Domain *d)
double dotProduct(const FloatArray &x) const
void followedBy(const IntArray &b, int allocChunk=0)
bool containsOnlyZeroes() const
void findNonzeros(const IntArray &logical)
virtual Element * giveElementContainingPoint(const FloatArray &coords, const IntArray *regionList=nullptr)=0
#define _IFT_EnrichmentItem_inheritorderedbc
#define _IFT_EnrichmentItem_front
#define _IFT_EnrichmentItem_inheritbc
#define _IFT_EnrichmentItem_propagationlaw
static FloatArray Vec2(const double &a, const double &b)
@ NodeEnr_START_AND_END_TIP
FloatArrayF< N > max(const FloatArrayF< N > &a, const FloatArrayF< N > &b)
double distance(const FloatArray &x, const FloatArray &y)