OOFEM 3.0
Loading...
Searching...
No Matches
enrichmentfrontintersection.C
Go to the documentation of this file.
1/*
2 *
3 * ##### ##### ###### ###### ### ###
4 * ## ## ## ## ## ## ## ### ##
5 * ## ## ## ## #### #### ## # ##
6 * ## ## ## ## ## ## ## ##
7 * ## ## ## ## ## ## ## ##
8 * ##### ##### ## ###### ## ##
9 *
10 *
11 * OOFEM : Object Oriented Finite Element Code
12 *
13 * Copyright (C) 1993 - 2025 Borek Patzak
14 *
15 *
16 *
17 * Czech Technical University, Faculty of Civil Engineering,
18 * Department of Structural Mechanics, 166 29 Prague, Czech Republic
19 *
20 * This library is free software; you can redistribute it and/or
21 * modify it under the terms of the GNU Lesser General Public
22 * License as published by the Free Software Foundation; either
23 * version 2.1 of the License, or (at your option) any later version.
24 *
25 * This program is distributed in the hope that it will be useful,
26 * but WITHOUT ANY WARRANTY; without even the implied warranty of
27 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
28 * Lesser General Public License for more details.
29 *
30 * You should have received a copy of the GNU Lesser General Public
31 * License along with this library; if not, write to the Free Software
32 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
33 */
34
36#include "dynamicinputrecord.h"
37#include "classfactory.h"
38#include "xfem/xfemmanager.h"
39#include "domain.h"
40#include "connectivitytable.h"
41#include "spatiallocalizer.h"
42#include "element.h"
43#include "gausspoint.h"
44
45namespace oofem {
47
48EnrFrontIntersection :: EnrFrontIntersection() {}
49
50EnrFrontIntersection :: ~EnrFrontIntersection() {}
51
52void EnrFrontIntersection :: MarkNodesAsFront(std :: unordered_map< int, NodeEnrichmentType > &ioNodeEnrMarkerMap, XfemManager &ixFemMan, const std :: unordered_map< int, double > &iLevelSetNormalDirMap, const std :: unordered_map< int, double > &iLevelSetTangDirMap, const TipInfo &iTipInfo)
53{
54 MarkTipElementNodesAsFront(ioNodeEnrMarkerMap, ixFemMan, iLevelSetNormalDirMap, iLevelSetTangDirMap, iTipInfo);
55}
56
57int EnrFrontIntersection :: giveNumEnrichments(const DofManager &iDMan) const
58{
59 return 1;
60}
61
62void EnrFrontIntersection :: evaluateEnrFuncAt(std :: vector< double > &oEnrFunc, const EfInput &iEfInput) const
63{
64 FloatArray xTip = Vec2(
65 mTipInfo.mGlobalCoord.at(1), mTipInfo.mGlobalCoord.at(2)
66 );
67
68 FloatArray pos = Vec2(
69 iEfInput.mPos.at(1), iEfInput.mPos.at(2)
70 );
71
72 // Crack tip normal and use defined tangent
73 // Note that mTangent is not necessarily equal to mTipInfo.mTangDir!
74 const FloatArray &t = mTangent;
75 const FloatArray &n = mTipInfo.mNormalDir;
76
77 FloatArray tipToPos = Vec2(
78 iEfInput.mPos(0) - xTip(0), iEfInput.mPos(1) - xTip(1)
79 );
80
81 // Heaviside in normal direction
82 double Hn = 0.0;
83 if ( tipToPos.dotProduct(n) > 0.0 ) {
84 Hn = 1.0;
85 }
86
87 // Heaviside in tangential direction
88 double Ht = 0.0;
89 if ( tipToPos.dotProduct(t) < 0.0 ) {
90 Ht = 1.0;
91 }
92
93 oEnrFunc.push_back(Hn * Ht);
94}
95
96void EnrFrontIntersection :: evaluateEnrFuncDerivAt(std :: vector< FloatArray > &oEnrFuncDeriv, const EfInput &iEfInput, const FloatArray &iGradLevelSet) const
97{
98 FloatArray enrFuncDeriv = Vec2(
99 0.0, 0.0
100 );
101 oEnrFuncDeriv.push_back(enrFuncDeriv);
102}
103
104void EnrFrontIntersection :: evaluateEnrFuncJumps(std :: vector< double > &oEnrFuncJumps, GaussPoint &iGP, int iNodeInd, bool iGPLivesOnCurrentCrack, const double &iNormalSignDist) const
105{
106 std :: vector< double >jumps;
107
108 if ( iGPLivesOnCurrentCrack ) {
109 jumps.push_back(1.0);
110 } else {
111 // printf("iNormalSignDist: %e\n", iNormalSignDist );
112
113 if ( iNormalSignDist > 0.0 ) {
114 jumps.push_back(1.0);
115 } else {
116 jumps.push_back(0.0);
117 }
118 }
119
120 oEnrFuncJumps.insert( oEnrFuncJumps.end(), jumps.begin(), jumps.end() );
121}
122
123void EnrFrontIntersection :: initializeFrom(InputRecord &ir)
124{
126}
127
128void EnrFrontIntersection :: giveInputRecord(DynamicInputRecord &input)
129{
130 int number = 1;
131 input.setRecordKeywordField(this->giveInputRecordName(), number);
132
134}
135} /* namespace oofem */
#define REGISTER_EnrichmentFront(class)
void setRecordKeywordField(std ::string keyword, int number)
void setField(int item, InputFieldType id)
const char * giveInputRecordName() const override
void MarkTipElementNodesAsFront(std ::unordered_map< int, NodeEnrichmentType > &ioNodeEnrMarkerMap, XfemManager &ixFemMan, const std ::unordered_map< int, double > &iLevelSetNormalDirMap, const std ::unordered_map< int, double > &iLevelSetTangDirMap, const TipInfo &iTipInfo)
TipInfo mTipInfo
reference to the associated enrichment item
double & at(Index i)
Definition floatarray.h:202
double dotProduct(const FloatArray &x) const
Definition floatarray.C:524
#define _IFT_EnrFrontIntersection_Tangent
#define IR_GIVE_FIELD(__ir, __value, __id)
Definition inputrecord.h:67
static FloatArray Vec2(const double &a, const double &b)
Definition floatarray.h:606

This page is part of the OOFEM-3.0 documentation. Copyright Copyright (C) 1994-2025 Borek Patzak Bořek Patzák
Project e-mail: oofem@fsv.cvut.cz
Generated at for OOFEM by doxygen 1.15.0 written by Dimitri van Heesch, © 1997-2011