OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
propagationlaw.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 
35 
36 
37 #include "propagationlaw.h"
38 #include "tipinfo.h"
39 #include "classfactory.h"
40 #include "mathfem.h"
41 #include "dynamicinputrecord.h"
42 #include "spatiallocalizer.h"
43 #include "floatmatrix.h"
44 #include "gausspoint.h"
45 #include "enrichmentitem.h"
46 #include "feinterpol.h"
47 #include "xfemmanager.h"
48 
49 #include "XFEMDebugTools.h"
50 
51 namespace oofem {
55 
57 
59 
61 {
62  int number = 1;
63  input.setRecordKeywordField(this->giveInputRecordName(), number);
64 }
65 
67 {
68  IRResultType result;
69 
72 
73  // printf("In PLCrackPrescribedDir :: initializeFrom: mAngle: %e mIncrementLength: %e\n", mAngle, mIncrementLength);
74 
75  return IRRT_OK;
76 }
77 
79 {
80  int number = 1;
81  input.setRecordKeywordField(this->giveInputRecordName(), number);
82 
84  input.setField(mIncrementLength, _IFT_PLCrackPrescribedDir_IncLength);
85 }
86 
88 {
89  if ( !iEnrFront.propagationIsAllowed() ) {
90  return false;
91  }
92 
93  const TipInfo &tipInfo = iEnrFront.giveTipInfo();
94 
95  SpatialLocalizer *localizer = iDomain.giveSpatialLocalizer();
96  // It is meaningless to propagate a tip that is not inside any element
97  if ( tipInfo.mGlobalCoord.giveSize() == 0 ) {
98  return false;
99  }
100 
101  Element *el = localizer->giveElementContainingPoint(tipInfo.mGlobalCoord);
102  if ( el == NULL ) {
103  return false;
104  }
105 
106 
107  double angleRad = mAngle * M_PI / 180.0;
108  FloatArray dir = {
109  cos(angleRad), sin(angleRad)
110  };
111 
112  oTipProp.mTipIndex = tipInfo.mTipIndex;
113  oTipProp.mPropagationDir = dir;
114  oTipProp.mPropagationLength = mIncrementLength;
115 
116  return true;
117 }
118 
120 {
121  IRResultType result;
122 
124 
125  //printf("In PLnodeRadius :: initializeFrom: mRadius: %e \n", mRadius);
126 
127  return IRRT_OK;
128 }
129 
131 {
132  int number = 1;
133  input.setRecordKeywordField(this->giveInputRecordName(), number);
134 
135  input.setField(mRadius, _IFT_PLnodeRadius_Radius);
136 }
137 
139 {
140  if ( !iEnrFront.propagationIsAllowed() ) {
141  printf("EnrichmentFront.propagationIsAllowed is false \n");
142  return false;
143  }
144 
145  const TipInfo &tipInfo = iEnrFront.giveTipInfo(); // includes the dofman numbers which represent the boundary of the EI.
146  //tipInfo.mTipDofManNumbers.printYourself();
147 
148  // No listbased tip (or EI) present, so nothing to propagate.
149  if ( tipInfo.mTipDofManNumbers.giveSize() == 0 ) {
150  printf("No dofmans in tip; nothing to propagate. \n");
151  return false;
152  }
153 
154  // Localise nodes within certain radius from tip nodes
155  oTipProp.mPropagationDofManNumbers.clear();
156  SpatialLocalizer *localizer = iDomain.giveSpatialLocalizer();
157 
158  for ( int i = 1 ; i <= tipInfo.mTipDofManNumbers.giveSize() ; i++ ) {
159 
160  //DofManager *dofMan = iDomain.giveDofManager(tipInfo.mTipDofManNumbers.at(i));
161  //const FloatArray gCoords = dofMan->giveCoordinates();
162  Node *iNode = iDomain.giveNode(tipInfo.mTipDofManNumbers.at(i));
163  const FloatArray gCoords = iNode->giveNodeCoordinates();
164 
165  std :: list< int > nodeList;
166  localizer->giveAllNodesWithinBox(nodeList,gCoords,mRadius);
167  for ( int jNode : nodeList ) {
168  //printf("nodeList node %d \n",jNode);
170  }
171 
172  }
173  //oTipProp.mPropagationDofManNumbers.printYourself(" The following noded will be propagated to:");
174 
175  return true;
176 }
177 
178 } // end namespace oofem
The base class for all spatial localizers.
void setField(int item, InputFieldType id)
Class and object Domain.
Definition: domain.h:115
virtual IRResultType initializeFrom(InputRecord *ir)
FloatArray mPropagationDir
Definition: tipinfo.h:44
int mTipIndex
Definition: tipinfo.h:34
virtual const char * giveInputRecordName() const =0
TipInfo gathers useful information about a crack tip, like its position and tangent direction...
Definition: tipinfo.h:24
bool insertSortedOnce(int value, int allocChunk=0)
Inserts given value into a receiver, which is assumed to be sorted.
Definition: intarray.C:360
virtual bool propagateInterface(Domain &iDomain, EnrichmentFront &iEnrFront, TipPropagation &oTipProp)
IntArray mPropagationDofManNumbers
Definition: tipinfo.h:46
Updates the geometry of evolving XFEM interfaces.
Abstract base class for all finite elements.
Definition: element.h:145
virtual IRResultType initializeFrom(InputRecord *ir)
Dummy propagation law that does nothing.
int & at(int i)
Coefficient access function.
Definition: intarray.h:103
IntArray mTipDofManNumbers
Local number of which edge the crack enters the element (2d)
Definition: tipinfo.h:36
virtual void giveInputRecord(DynamicInputRecord &input)
virtual void giveAllNodesWithinBox(nodeContainerType &nodeList, const FloatArray &coords, const double radius)=0
Returns container (list) of all domain nodes within given box.
#define M_PI
Definition: mathfem.h:52
virtual void giveInputRecord(DynamicInputRecord &input)
void clear()
Clears the array (zero size).
Definition: intarray.h:177
Class EnrichmentFront: describes the edge or tip of an XFEM enrichment.
SpatialLocalizer * giveSpatialLocalizer()
Returns receiver&#39;s associated spatial localizer.
Definition: domain.C:1184
virtual bool propagationIsAllowed() const
Propagation law that propagates the crack in a predefined direction.
REGISTER_PropagationLaw(PLDoNothing)
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...
#define _IFT_PLnodeRadius_Radius
virtual bool propagateInterface(Domain &iDomain, EnrichmentFront &iEnrFront, TipPropagation &oTipProp)
#define _IFT_PLCrackPrescribedDir_IncLength
Class representing vector of real numbers.
Definition: floatarray.h:82
IRResultType
Type defining the return values of InputRecord reading operations.
Definition: irresulttype.h:47
const FloatArray & giveNodeCoordinates() const
As giveCoordinates, but non-virtual and therefore faster (because it can be inlined).
Definition: node.h:120
Class representing the general Input Record.
Definition: inputrecord.h:101
Class representing the a dynamic Input Record.
void setRecordKeywordField(std::string keyword, int number)
#define _IFT_PLCrackPrescribedDir_Dir
const TipInfo & giveTipInfo() const
double mPropagationLength
Definition: tipinfo.h:45
int giveSize() const
Definition: intarray.h:203
int giveSize() const
Returns the size of receiver.
Definition: floatarray.h:218
FloatArray mGlobalCoord
Definition: tipinfo.h:30
Node * giveNode(int n)
Service for accessing particular domain node.
Definition: domain.h:371
virtual void giveInputRecord(DynamicInputRecord &input)
the oofem namespace is to define a context or scope in which all oofem names are defined.
Class implementing node in finite element mesh.
Definition: node.h:87
#define IR_GIVE_FIELD(__ir, __value, __id)
Macro facilitating the use of input record reading methods.
Definition: inputrecord.h:69
Propagation law that propagates a delamination in a predefined radius from an element.

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:30 for OOFEM by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2011