OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
plczdamageradius.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 
40 #include <Materials/structuralms.h>
41 
42 #include "xfem/propagationlaw.h"
43 #include "xfem/tipinfo.h"
45 #include "xfem/xfemmanager.h"
46 #include "classfactory.h"
47 #include "domain.h"
48 #include "mathfem.h"
49 #include "dynamicinputrecord.h"
50 #include "spatiallocalizer.h"
51 #include "connectivitytable.h"
52 
53 namespace oofem {
55 
56 IRResultType PLCZdamageRadius :: initializeFrom(InputRecord *ir)
58 {
59  IRResultType result;
60 
61  IR_GIVE_FIELD(ir, mIncrementRadius, _IFT_PLCZdamageRadius_IncRadius);
64 
65  return IRRT_OK;
66 }
67 
69 {
70  int number = 1;
71  input.setRecordKeywordField(this->giveInputRecordName(), number);
72 
76 
77 }
78 
80 {
81  if ( !iEnrFront.propagationIsAllowed() ) {
82  printf("EnrichmentFront.propagationIsAllowed is false \n");
83  return false;
84  }
85 
86  const TipInfo &iTipInfo = iEnrFront.giveTipInfo(); // includes the dofman numbers which represent the boundary of the EI.
87  //tipInfo.mTipDofManNumbers.printYourself();
88 
89  // No listbased tip (or EI) present, so nothing to propagate.
90  if ( iTipInfo.mTipDofManNumbers.giveSize() == 0 ) {
91  printf("No dofmans in tip; nothing to propagate. \n");
92  return false;
93  }
94 
95  // Find enriched elements (only implmented for delamination and shell7xfembase)
96 
97  IntArray propagationDF;
98  int EIindex(iEnrFront.mEIindex);
99  IntArray tipDFnumbers(iTipInfo.mTipDofManNumbers); tipDFnumbers.sort();
100  EnrichmentItem *ei = iDomain.giveXfemManager()->giveEnrichmentItem(EIindex);
101 
102  if ( Delamination* dei = dynamic_cast < Delamination* > ( ei ) ) {
103 
104  // Find elements to propagate from (remove any elements not in delamination cross sections)
105  IntArray EIelements, tempEIelements, CSelements;
106  iDomain.giveConnectivityTable()->giveNodeNeighbourList(tempEIelements,tipDFnumbers);
107  for (int CSnum : dei->giveDelamCrossSectionNum()) {
108  CrossSection *CS = iDomain.giveCrossSection(CSnum);
109  if (this->mPropCS.contains(CS->giveNumber()) || this->mPropCS.containsOnlyZeroes() ) {
110  CSelements.followedBy(iDomain.giveSet(CS->giveSetNumber())->giveElementList());
111  }
112  }
113  CSelements.sort();
114  tempEIelements.findCommonValuesSorted(CSelements,EIelements);
115 
116  for ( int iElt : EIelements ) {
117 
118  bool CZdamageThresholdMet = false;
119  double maxDamage(0.0);
120  double CZdamage(0.0);
121  Element *elt = iDomain.giveElement(iElt);
122 
123  if ( Shell7BaseXFEM *shellElt = dynamic_cast < Shell7BaseXFEM * > (elt) ) {
124 
125  int interfaceMatNumber(shellElt->giveLayeredCS()->giveInterfaceMaterialNum(dei->giveDelamInterfaceNum()));
126 
127  if (interfaceMatNumber) {
128 
129  StructuralInterfaceMaterial *intMat = dynamic_cast < StructuralInterfaceMaterial * > (shellElt->giveLayeredCS()->giveInterfaceMaterial(dei->giveDelamInterfaceNum()) );
130  if (intMat == 0) {
131  OOFEM_ERROR("NULL pointer to material, interface %i",dei->giveDelamInterfaceNum());
132  }
133 
134  for (GaussPoint *gp: *shellElt->czIntegrationRulesArray[ dei->giveDelamInterfaceNum() - 1 ]) {
135 
136  StructuralInterfaceMaterialStatus *intMatStatus = static_cast < StructuralInterfaceMaterialStatus * >( intMat->giveStatus(gp) );
137  if (intMatStatus == 0) {
138  OOFEM_ERROR("NULL pointer to material status");
139  }
140  CZdamage = intMatStatus->giveTempDamage();
141  if (CZdamage > maxDamage) {maxDamage = CZdamage;}
142  if (CZdamage >= this->mDamageThreshold) {
143  CZdamageThresholdMet = true;
144  break;
145  }
146  }
147  //printf(" Max damage in element %i: %f \n",shellElt->giveNumber(),maxDamage);
148  } else {
149  // No interface material. Treat interface as fully damaged.
150  CZdamageThresholdMet = true;
151  CZdamage = 1.1;
152  //printf(" interface %i has no material in element %i. Interface treated as fully damaged \n",dei->giveDelamInterfaceNum(),shellElt->giveNumber());
153  }
154 
155  if (CZdamageThresholdMet) {
156  for (int iDF : shellElt->giveDofManArray() ) {
157  //if ( tipDFnumbers.findSorted(iDF) ) {
158  propagationDF.insertSortedOnce(iDF);
159  //}
160  }
161 // if (CZdamage < 1.1) {
162 // printf(" Damage threshold (%f) met in element %i \n",CZdamage,shellElt->giveNumber());
163 // }
164  }
165 
166  } else {
167  OOFEM_ERROR("Propagation law CZ-damage not implemented for element type %s",elt->giveClassName() );
168  }
169  }
170 
171  } else {
172  OOFEM_ERROR("Propagation law CZ-damage not implemented for enrichment type %s",ei->giveClassName() );
173  }
174 
175 
176  // Localise nodes within certain radius from tip nodes
177  oTipProp.mPropagationDofManNumbers.clear();
178  SpatialLocalizer *localizer = iDomain.giveSpatialLocalizer();
179  //propagationDF.printYourself("propagationDofMans");
180 
181  for ( int i = 1 ; i <= propagationDF.giveSize() ; i++ ) {
182 
183  Node *iNode = iDomain.giveNode(propagationDF.at(i));
184  const FloatArray gCoords = iNode->giveNodeCoordinates();
185 
186  std :: list< int > nodeList;
187  localizer->giveAllNodesWithinBox(nodeList,gCoords,mIncrementRadius);
188  for ( int jNode : nodeList ) {
189  //printf("nodeList node %d \n",jNode);
191  }
192 
193  }
194  //oTipProp.mPropagationDofManNumbers.printYourself(" The following noded will be propagated to:");
195 
196  return true;
197 }
198 } // end namespace oofem
bool contains(int value) const
Definition: intarray.h:283
The base class for all spatial localizers.
void setField(int item, InputFieldType id)
Abstract class representing entity, which is included in the FE model using one (or more) global func...
virtual MaterialStatus * giveStatus(GaussPoint *gp) const
Returns material status of receiver in given integration point.
Definition: material.C:244
#define _IFT_PLCZdamageRadius_PropagationCS
Cross sections (must be part of csnum) viable for propagation.
Class and object Domain.
Definition: domain.h:115
int giveSetNumber() const
Definition: crosssection.h:129
TipInfo gathers useful information about a crack tip, like its position and tangent direction...
Definition: tipinfo.h:24
ConnectivityTable * giveConnectivityTable()
Returns receiver&#39;s associated connectivity table.
Definition: domain.C:1170
bool insertSortedOnce(int value, int allocChunk=0)
Inserts given value into a receiver, which is assumed to be sorted.
Definition: intarray.C:360
Delamination.
Definition: delamination.h:58
IntArray mPropagationDofManNumbers
Definition: tipinfo.h:46
Abstract base class for all finite elements.
Definition: element.h:145
Class implementing an array of integers.
Definition: intarray.h:61
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
XfemManager * giveXfemManager()
Definition: domain.C:375
virtual bool propagateInterface(Domain &iDomain, EnrichmentFront &iEnrFront, TipPropagation &oTipProp)
void sort()
Sorts array.
Definition: intarray.C:420
bool containsOnlyZeroes() const
Checks if receiver is all zero.
Definition: intarray.C:172
Base abstract class representing cross section in finite element mesh.
Definition: crosssection.h:107
CrossSection * giveCrossSection(int n)
Service for accessing particular domain cross section model.
Definition: domain.C:339
virtual void giveAllNodesWithinBox(nodeContainerType &nodeList, const FloatArray &coords, const double radius)=0
Returns container (list) of all domain nodes within given box.
Element * giveElement(int n)
Service for accessing particular domain fe element.
Definition: domain.C:160
#define OOFEM_ERROR(...)
Definition: error.h:61
void clear()
Clears the array (zero size).
Definition: intarray.h:177
virtual void giveInputRecord(DynamicInputRecord &input)
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
Set * giveSet(int n)
Service for accessing particular domain set.
Definition: domain.C:363
This class implements a structural interface material status information.
REGISTER_PropagationLaw(PLDoNothing)
virtual const char * giveClassName() const
Definition: element.h:1147
Class representing vector of real numbers.
Definition: floatarray.h:82
IRResultType
Type defining the return values of InputRecord reading operations.
Definition: irresulttype.h:47
void giveNodeNeighbourList(IntArray &answer, IntArray &nodeList)
Returns list of elements sharing given nodes.
const FloatArray & giveNodeCoordinates() const
As giveCoordinates, but non-virtual and therefore faster (because it can be inlined).
Definition: node.h:120
Propagation law that propagates the (delamination) crack in a radius distance from element nodes when...
Class representing the general Input Record.
Definition: inputrecord.h:101
void followedBy(const IntArray &b, int allocChunk=0)
Appends array b at the end of receiver.
Definition: intarray.C:145
Class representing the a dynamic Input Record.
virtual const char * giveInputRecordName() const
EnrichmentItem * giveEnrichmentItem(int n)
Definition: xfemmanager.h:184
#define _IFT_PLCZdamageRadius_IncRadius
Increment radius (from element nodes) per time step.
void setRecordKeywordField(std::string keyword, int number)
#define _IFT_PLCZdamageRadius_DamageThreshold
Damage threshold [0,1] for propagation.
const TipInfo & giveTipInfo() const
#define IR_GIVE_OPTIONAL_FIELD(__ir, __value, __id)
Macro facilitating the use of input record reading methods.
Definition: inputrecord.h:78
int giveSize() const
Definition: intarray.h:203
Abstract base class for all "structural" interface models.
virtual const char * giveClassName() const =0
Node * giveNode(int n)
Service for accessing particular domain node.
Definition: domain.h:371
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
int giveNumber() const
Definition: femcmpnn.h:107
int findCommonValuesSorted(const IntArray &iarray, IntArray &common, int allocChunk=0) const
Extracts common values in receiver and iarray.
Definition: intarray.C:383
Class representing integration point in finite element program.
Definition: gausspoint.h:93

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