OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
enrichmentfront.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 #include "enrichmentfront.h"
36 #include "xfem/tipinfo.h"
37 #include "domain.h"
38 #include "xfem/xfemmanager.h"
39 #include "spatiallocalizer.h"
40 #include "element.h"
41 
42 namespace oofem {
43 void EnrichmentFront :: 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)
44 {
45  mTipInfo = iTipInfo;
46 
47  Domain &d = * ( ixFemMan.giveDomain() );
48 
50 
51  if ( el != NULL ) {
52  const IntArray &elNodes = el->giveDofManArray();
53 
54  for ( int i = 1; i <= elNodes.giveSize(); i++ ) {
55  if ( ioNodeEnrMarkerMap [ elNodes.at(i) ] == NodeEnr_START_TIP || ioNodeEnrMarkerMap [ elNodes.at(i) ] == NodeEnr_END_TIP ) {
56  ioNodeEnrMarkerMap [ elNodes.at(i) ] = NodeEnr_START_AND_END_TIP;
57  } else {
58  if ( mTipInfo.mTipIndex == 0 ) {
59  ioNodeEnrMarkerMap [ elNodes.at(i) ] = NodeEnr_START_TIP;
60  }
61 
62  if ( mTipInfo.mTipIndex == 1 ) {
63  ioNodeEnrMarkerMap [ elNodes.at(i) ] = NodeEnr_END_TIP;
64  }
65  }
66  }
67  }
68 }
69 
70 void EnrichmentFront :: computeCrackTangent(FloatArray &oTangent, FloatArray &oNormal, bool &oFlipTangent, const EfInput &iEfInput) const
71 {
72  oTangent = iEfInput.mLocalTangDir;
73 
74  if ( oTangent.dotProduct(mTipInfo.mTangDir) < 0.0 ) {
75  oTangent.times(-1.0);
76  oFlipTangent = true;
77  } else {
78  oFlipTangent = false;
79  }
80 
81  oNormal = {
82  -oTangent.at(2), oTangent.at(1)
83  };
84 }
85 } // end namespace oofem
Class and object Domain.
Definition: domain.h:115
TipInfo mTipInfo
reference to the associated enrichment item
int mTipIndex
Definition: tipinfo.h:34
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
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
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.
const IntArray & giveDofManArray() const
Definition: element.h:592
double dotProduct(const FloatArray &x) const
Computes the dot product (or inner product) of receiver and argument.
Definition: floatarray.C:463
SpatialLocalizer * giveSpatialLocalizer()
Returns receiver&#39;s associated spatial localizer.
Definition: domain.C:1184
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...
Class representing vector of real numbers.
Definition: floatarray.h:82
void computeCrackTangent(FloatArray &oTangent, FloatArray &oNormal, bool &oFlipTangent, const EfInput &iEfInput) const
This class manages the xfem part.
Definition: xfemmanager.h:109
void times(double s)
Multiplies receiver with scalar.
Definition: floatarray.C:818
FloatArray mTangDir
Definition: tipinfo.h:32
FloatArray mLocalTangDir
int giveSize() const
Definition: intarray.h:203
FloatArray mGlobalCoord
Definition: tipinfo.h:30
the oofem namespace is to define a context or scope in which all oofem names are defined.
Domain * giveDomain()
Definition: xfemmanager.h:202

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