OOFEM 3.0
Loading...
Searching...
No Matches
xfemmanager.h
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#ifndef xfemmanager_h
36#define xfemmanager_h
37
38#include "oofemenv.h"
39#include "datareader.h"
40#include "inputrecord.h"
41#include "contextioresulttype.h"
42#include "contextmode.h"
43#include "enrichmentitem.h"
44#include "enumitem.h"
46
47#include <unordered_map>
48#include <list>
49#include <vector>
50#include <memory>
51
53
54#define _IFT_XfemManager_Name "xfemmanager"
55#define _IFT_XfemManager_numberOfEnrichmentItems "numberofenrichmentitems"
56#define _IFT_XfemManager_numberOfNucleationCriteria "numberofnucleationcriteria"
57#define _IFT_XfemManager_numberOfGpPerTri "numberofgppertri"
58
60#define _IFT_XfemManager_numberOfTriRefs "numberoftrirefs"
61
62#define _IFT_XfemManager_enrDofScaleFac "enrdofscalefac"
63
64#define _IFT_XfemManager_debugVTK "debugvtk"
65#define _IFT_XfemManager_VTKExport "vtkexport"
66#define _IFT_XfemManager_VTKExportFields "exportfields"
68
69//#define ENABLE_XFEM_CPP11
70
71namespace oofem {
72class Domain;
73class EnrichmentItem;
74class IntArray;
75class Element;
76class DataStream;
77class DynamicInputRecord;
78class NucleationCriterion;
79//class InternalStateValueType;
80
81//
82// The following types determine the state types associated with xfem
83//
84#define XFEMStateType_DEF \
85 ENUM_ITEM_WITH_VALUE(XFEMST_Undefined, 0) \
86 ENUM_ITEM_WITH_VALUE(XFEMST_Enrichment, 1) \
87 ENUM_ITEM_WITH_VALUE(XFEMST_LevelSetPhi, 2) \
88 ENUM_ITEM_WITH_VALUE(XFEMST_LevelSetGamma, 3) \
89 ENUM_ITEM_WITH_VALUE(XFEMST_NodeEnrMarker, 4) \
90 ENUM_ITEM_WITH_VALUE(XFEMST_NumIntersecPoints, 5)
91
95
96#undef ENUM_ITEM
97#undef ENUM_ITEM_WITH_VALUE
98#undef enumitem_h
99
100const char *__XFEMStateTypeToString(XFEMStateType _value);
101
110{
111protected:
113 std::shared_ptr<InputRecord> thisIr;
115 std :: vector< std :: unique_ptr< EnrichmentItem > >enrichmentItemList;
116
118
120
126
131
132 /* Scale factor for the enrichment dofs. Implies that the corresponding
133 dofs must be scaled with 1/factor in the input file
134 */
136
138
141
146 std :: vector< std :: vector< int > >mNodeEnrichmentItemIndices;
147 std :: unordered_map< int, std :: vector< int > >mElementEnrichmentItemIndices;
148
154
158 std::vector< std :: unique_ptr< NucleationCriterion > > mNucleationCriteria;
159
160 // IDs of all potential enriched dofs
162
163public:
164
168 IntArray vtkExportFields; // make private later
170
174 virtual ~XfemManager();
175 XfemManager(const XfemManager &) = delete;
176
178
179 int giveNumGpPerTri() const { return mNumGpPerTri; }
180 int giveNumTriRefs() const { return mNumTriRef;}
181 double giveEnrDofScaleFactor() const {return mEnrDofScaleFac;}
182
183 bool isElementEnriched(const Element *elem);
184
185 inline EnrichmentItem *giveEnrichmentItem(int n) { return enrichmentItemList [ n - 1 ].get(); }
186 int giveNumberOfEnrichmentItems() const { return ( int ) enrichmentItemList.size(); }
187
188 inline NucleationCriterion *giveNucleationCriterion(int n) { return mNucleationCriteria [ n - 1 ].get(); }
189 int giveNumberOfNucleationCriteria() const { return ( int ) mNucleationCriteria.size(); }
190
191 void createEnrichedDofs();
193 IntArray giveEnrichedDofIDs(const DofManager &iDMan) const;
194
196 virtual void initializeFrom(InputRecord &ir);
197 virtual void giveInputRecord(DynamicInputRecord &input);
198
199 virtual int instanciateYourself(DataReader &dr);
200 virtual const char *giveClassName() const { return "XfemManager"; }
201 virtual const char *giveInputRecordName() const { return _IFT_XfemManager_Name; }
202
203 virtual void postInitialize();
204
205 Domain *giveDomain() { return this->domain; }
206 void setDomain(Domain *ipDomain);
207
214 void saveContext(DataStream &stream, ContextMode mode);
221 void restoreContext(DataStream &stream, ContextMode mode);
222
223
227 virtual void updateYourself(TimeStep *tStep);
228
229 virtual void propagateFronts(bool &oAnyFronHasPropagated);
230 void initiateFronts(bool &oAnyFronHasPropagated, TimeStep *tStep);
231 bool hasPropagatingFronts();
232 bool hasInitiationCriteria();
233
235 void clearEnrichmentItems();
236
237 void appendEnrichmentItems(std :: vector< std :: unique_ptr< EnrichmentItem > > &iEIlist);
238
239 void nucleateEnrichmentItems(bool &oNewItemsWereNucleated);
240 bool hasNucleationCriteria();
241
242 bool giveVtkDebug() const { return mDebugVTK; }
243 void setVtkDebug(bool iDebug) { mDebugVTK = iDebug; }
244
245 void updateNodeEnrichmentItemMap();
246
247 const std :: vector< int > &giveNodeEnrichmentItemIndices(int iNodeIndex) const { return mNodeEnrichmentItemIndices [ iNodeIndex - 1 ]; }
248 void giveElementEnrichmentItemIndices(std :: vector< int > &oElemEnrInd, int iElementIndex) const;
249
250 const std :: vector< int > &giveMaterialModifyingEnrItemIndices() const { return mMaterialModifyingEnrItemIndices; }
251};
252} // end namespace oofem
253#endif // xfemmanager_h
bool giveVtkDebug() const
std ::vector< int > mMaterialModifyingEnrItemIndices
void setVtkDebug(bool iDebug)
int giveNumGpPerTri() const
std ::vector< std ::vector< int > > mNodeEnrichmentItemIndices
IntArray vtkExportFields
std ::vector< std ::unique_ptr< EnrichmentItem > > enrichmentItemList
Enrichment item list.
XfemManager & operator=(const XfemManager &)=delete
Domain * giveDomain()
XfemManager(Domain *domain)
Constructor.
const std ::vector< int > & giveMaterialModifyingEnrItemIndices() const
const std ::vector< int > & giveNodeEnrichmentItemIndices(int iNodeIndex) const
IntArray mXFEMPotentialDofIDs
std ::unordered_map< int, std ::vector< int > > mElementEnrichmentItemIndices
int giveNumberOfNucleationCriteria() const
int giveNumTriRefs() const
Number of Gauss points per sub-triangle in cut elements.
const IntArray & giveEnrichedDofIDs() const
InternalStateValueType giveXFEMStateValueType(XFEMStateType type)
Definition xfemmanager.C:88
EnrichmentItem * giveEnrichmentItem(int n)
std::shared_ptr< InputRecord > thisIr
std::vector< std ::unique_ptr< NucleationCriterion > > mNucleationCriteria
double giveEnrDofScaleFactor() const
NucleationCriterion * giveNucleationCriterion(int n)
XfemManager(const XfemManager &)=delete
virtual const char * giveInputRecordName() const
bool mDebugVTK
If extra debug vtk files should be written.
virtual const char * giveClassName() const
int giveNumberOfEnrichmentItems() const
long ContextMode
Definition contextmode.h:43
const char * __XFEMStateTypeToString(XFEMStateType _value)
Definition cltypes.C:350
XFEMStateType
Definition xfemmanager.h:92
@ XFEMStateType_DEF
Definition xfemmanager.h:93
InternalStateValueType
Determines the type of internal variable.
#define OOFEM_EXPORT
Definition oofemcfg.h:7
#define _IFT_XfemManager_Name
Definition xfemmanager.h:54

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