OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
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 - 2013 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 
45 namespace oofem {
47 
49 
51 
52 void 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 
58 {
59  return 1;
60 }
61 
62 void EnrFrontIntersection :: evaluateEnrFuncAt(std :: vector< double > &oEnrFunc, const EfInput &iEfInput) const
63 {
64  FloatArray xTip = {
66  };
67 
68  FloatArray pos = {
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 = {
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 
96 void EnrFrontIntersection :: evaluateEnrFuncDerivAt(std :: vector< FloatArray > &oEnrFuncDeriv, const EfInput &iEfInput, const FloatArray &iGradLevelSet) const
97 {
98  FloatArray enrFuncDeriv = {
99  0.0, 0.0
100  };
101  oEnrFuncDeriv.push_back(enrFuncDeriv);
102 }
103 
104 void 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 
124 {
125  IRResultType result; // Required by IR_GIVE_FIELD macro
127 
128  return IRRT_OK;
129 }
130 
132 {
133  int number = 1;
134  input.setRecordKeywordField(this->giveInputRecordName(), number);
135 
137 }
138 } /* namespace oofem */
void setField(int item, InputFieldType id)
virtual void evaluateEnrFuncDerivAt(std::vector< FloatArray > &oEnrFuncDeriv, const EfInput &iEfInput, const FloatArray &iGradLevelSet) const
TipInfo mTipInfo
reference to the associated enrichment item
double & at(int i)
Coefficient access function.
Definition: floatarray.h:131
TipInfo gathers useful information about a crack tip, like its position and tangent direction...
Definition: tipinfo.h:24
virtual IRResultType initializeFrom(InputRecord *ir)
Base class for dof managers.
Definition: dofmanager.h:113
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)
Several enrichment fronts enrich all nodes in the tip element.
#define _IFT_EnrFrontIntersection_Tangent
virtual void evaluateEnrFuncAt(std::vector< double > &oEnrFunc, const EfInput &iEfInput) const
double dotProduct(const FloatArray &x) const
Computes the dot product (or inner product) of receiver and argument.
Definition: floatarray.C:463
FloatArray mPos
virtual void giveInputRecord(DynamicInputRecord &input)
Class representing vector of real numbers.
Definition: floatarray.h:82
This class manages the xfem part.
Definition: xfemmanager.h:109
IRResultType
Type defining the return values of InputRecord reading operations.
Definition: irresulttype.h:47
virtual void 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)
MarkNodesAsFront: Intput: -ioNodeEnrMarker: A vector with the same size as the number of nodes in the...
Class representing the general Input Record.
Definition: inputrecord.h:101
virtual const char * giveInputRecordName() const
virtual void evaluateEnrFuncJumps(std::vector< double > &oEnrFuncJumps, GaussPoint &iGP, int iNodeInd, bool iGPLivesOnCurrentCrack, const double &iNormalSignDist) const
FloatArray mNormalDir
Definition: tipinfo.h:33
Class representing the a dynamic Input Record.
void setRecordKeywordField(std::string keyword, int number)
REGISTER_EnrichmentFront(EnrFrontCohesiveBranchFuncOneEl)
void push_back(const double &iVal)
Add one element.
Definition: floatarray.h:118
FloatArray mGlobalCoord
Definition: tipinfo.h:30
the oofem namespace is to define a context or scope in which all oofem names are defined.
#define IR_GIVE_FIELD(__ir, __value, __id)
Macro facilitating the use of input record reading methods.
Definition: inputrecord.h:69
Class representing integration point in finite element program.
Definition: gausspoint.h:93
virtual int giveNumEnrichments(const DofManager &iDMan) const

This page is part of the OOFEM documentation. Copyright (c) 2011 Borek Patzak
Project e-mail: info@oofem.org
Generated at Tue Jan 2 2018 20:07:28 for OOFEM by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2011