OOFEM 3.0
Loading...
Searching...
No Matches
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 - 2025 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
46namespace oofem {
48
49Inclusion :: 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
58Inclusion :: ~Inclusion()
59{
60 if ( mpCrossSection != NULL ) {
61 mpCrossSection = NULL;
62 }
63}
64
65bool Inclusion :: isMaterialModified(GaussPoint &iGP, Element &iEl, CrossSection * &opCS) const
66{
67 // Check if the point is located inside the inclusion
68
70 FEInterpolation *interp = iEl.giveInterpolation();
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
86void Inclusion :: initializeFrom(InputRecord &ir)
87{
88 EnrichmentItem :: initializeFrom(ir);
89
90 int crossSectionIndex = 0;
91 IR_GIVE_FIELD(ir, crossSectionIndex, _IFT_Inclusion_CrossSection);
92 mpCrossSection = this->giveDomain()->giveCrossSection(crossSectionIndex);
93}
94} /* namespace oofem */
#define N(a, b)
#define REGISTER_EnrichmentItem(class)
virtual FEInterpolation * giveInterpolation() const
Definition element.h:648
const IntArray & giveDofManArray() const
Definition element.h:611
virtual void evalN(FloatArray &answer, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const =0
Domain * giveDomain() const
Definition femcmpnn.h:97
const FloatArray & giveNaturalCoordinates() const
Returns coordinate array of receiver.
Definition gausspoint.h:138
void interpLevelSet(double &oLevelSet, const FloatArray &iN, const IntArray &iNodeInd) const
Definition hybridei.C:70
CrossSection * mpCrossSection
Definition inclusion.h:53
#define _IFT_Inclusion_CrossSection
Definition inclusion.h:39
#define IR_GIVE_FIELD(__ir, __value, __id)
Definition inputrecord.h:67

This page is part of the OOFEM-3.0 documentation. Copyright Copyright (C) 1994-2025 Borek Patzak Bořek Patzák
Project e-mail: oofem@fsv.cvut.cz
Generated at for OOFEM by doxygen 1.15.0 written by Dimitri van Heesch, © 1997-2011