OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
inclusion.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 "xfem/inclusion.h"
36 
37 #include "xfemmanager.h"
38 #include "element.h"
39 #include "feinterpol.h"
40 #include "gausspoint.h"
41 
42 #include "classfactory.h"
43 
44 #include <string>
45 
46 namespace oofem {
48 
49 Inclusion :: Inclusion(int n, XfemManager *xm, Domain *aDomain) :
50  HybridEI(n, xm, aDomain),
51  mpCrossSection(NULL)
52 {
53  mpEnrichesDofsWithIdArray = {
54  D_u, D_v, D_w
55  };
56 }
57 
59 {
60  if ( mpCrossSection != NULL ) {
61  mpCrossSection = NULL;
62  }
63 }
64 
66 {
67  // Check if the point is located inside the inclusion
68 
69  FloatArray N;
70  FEInterpolation *interp = iEl.giveInterpolation();
71  interp->evalN( N, iGP.giveNaturalCoordinates(), FEIElementGeometryWrapper(& iEl) );
72 
73  const IntArray &elNodes = iEl.giveDofManArray();
74 
75  double levelSetGP = 0.0;
76  interpLevelSet(levelSetGP, N, elNodes);
77 
78  if ( levelSetGP < 0.0 ) {
79  opCS = mpCrossSection;
80  return true;
81  }
82 
83  return false;
84 }
85 
87 {
88  IRResultType result;
89 
90  int crossSectionIndex = 0;
91  IR_GIVE_FIELD(ir, crossSectionIndex, _IFT_Inclusion_CrossSection);
92  mpCrossSection = this->giveDomain()->giveCrossSection(crossSectionIndex);
93 
95 }
96 } /* namespace oofem */
virtual ~Inclusion()
Definition: inclusion.C:58
virtual void evalN(FloatArray &answer, const FloatArray &lcoords, const FEICellGeometry &cellgeo)=0
Evaluates the array of interpolation functions (shape functions) at given point.
Class and object Domain.
Definition: domain.h:115
EnrichmentItem describing an inclusion.
Definition: inclusion.h:50
EnrichmentItem with hybrid geometry description in the following sense: We have a BasicGeometry to de...
Definition: hybridei.h:54
Abstract base class for all finite elements.
Definition: element.h:145
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
#define _IFT_Inclusion_CrossSection
Definition: inclusion.h:39
Class implementing an array of integers.
Definition: intarray.h:61
virtual FEInterpolation * giveInterpolation() const
Definition: element.h:629
Base abstract class representing cross section in finite element mesh.
Definition: crosssection.h:107
Class representing a general abstraction for finite element interpolation class.
Definition: feinterpol.h:132
REGISTER_EnrichmentItem(HybridEI)
Definition: hybridei.C:46
CrossSection * giveCrossSection(int n)
Service for accessing particular domain cross section model.
Definition: domain.C:339
const IntArray & giveDofManArray() const
Definition: element.h:592
Wrapper around element definition to provide FEICellGeometry interface.
Definition: feinterpol.h:95
#define N(p, q)
Definition: mdm.C:367
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
Definition: inclusion.C:86
Class representing vector of real numbers.
Definition: floatarray.h:82
void interpLevelSet(double &oLevelSet, const FloatArray &iN, const IntArray &iNodeInd) const
Definition: hybridei.C:70
This class manages the xfem part.
Definition: xfemmanager.h:109
IRResultType
Type defining the return values of InputRecord reading operations.
Definition: irresulttype.h:47
Class representing the general Input Record.
Definition: inputrecord.h:101
virtual bool isMaterialModified(GaussPoint &iGP, Element &iEl, CrossSection *&opCS) const
Definition: inclusion.C:65
Domain * giveDomain() const
Definition: femcmpnn.h:100
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
CrossSection * mpCrossSection
Definition: inclusion.h:53
const FloatArray & giveNaturalCoordinates()
Returns coordinate array of receiver.
Definition: gausspoint.h:138

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