Xfem
The Xfem Plugin
Loading...
Searching...
No Matches
xfemMechanicEmbeddedFracture.h
Go to the documentation of this file.
1/************************************************************************
2**
3** Copyright (C) 2017 by Geomechanic group - Tecgraf/Puc-Rio
4** All rights reserved.
5**
6** This file is part of the "GeMA" software. It's use should respect
7** the terms in the license agreement that can be found together
8** with this source code.
9** It is provided AS IS, with NO WARRANTY OF ANY KIND,
10** INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR
11** A PARTICULAR PURPOSE.
12**
13************************************************************************/
14
23#ifndef _GEMA_XFEM_MECHANIC_EMBEDDEDFRACTURE_H_
24#define _GEMA_XFEM_MECHANIC_EMBEDDEDFRACTURE_H_
25
26#include <gmpFemPhysicsCoupled.h>
27#include <gmpMechanicalPhysics.h>
28#include <gmpMechanicPoint.h>
29#include <gmDiscontinuitySet.h>
30#include <gmDiscontinuity.h>
33
34#include "xfemMesh.h"
35
36class GmpMechanicalPhysics;
37class GmGaussAccessor;
38
42template <class T, class F> class embeddedPhysicsWrapper : public T
43{
44public:
45 embeddedPhysicsWrapper(const char* physicsType, const char* objType, GmSimulationData* simulation, QString id, const GmLogCategory& logger)
46 : T(objType, simulation, id, "",
47 dynamic_cast<F*>(simulation->loader()->objectFactory(physicsType))->matFactory(simulation),
48 logger) {}
49
50protected:
54 virtual GmGaussAccessor* createGaussAttributeAccessor(GmElementMesh* mesh, QString id, int snum, bool locked,
55 Unit desiredUnit, const GmLogCategory& logger) const
56 {
57 XfemMesh* xmesh = dynamic_cast<XfemMesh*>(mesh);
58 assert(xmesh);
59 return xmesh->enrichedGaussAttributeAccessor(id, snum, locked, desiredUnit, logger);
60 }
61};
62
65class XfemMechanicEmbeddedFracture : public GmpFemPhysicsCoupled
66{
67public:
68 // constructor
69 XfemMechanicEmbeddedFracture(const char* pluginType, GmSimulationData* simulation, QString id, QString description,
70 const GmpFemPhysicsCommonMaterialFactory* matFactory, const GmLogCategory& logger);
71 // destructor
73
74 // Comments on the base class
75 virtual const char* pluginName() const { return "Xfem"; }
76
77 virtual const char* pluginType() const { return _pluginType; }
78
79 // set physic map
80 virtual const QVariantMap* physicsMetaDataMap();
81
82 // Comments on the base class
83
84 virtual bool dofByElement(bool* fixed, bool* addOnly, bool* trackChanges) const;
85
86 virtual const GmElementDof* dofMapping(const GmElement* e) const;
87
88 virtual bool fixedNodalDofsBc(QVector<int>& nodes, QVector<int>&dof, QVector<double>& values, bool* constantValues) const;
89
90 virtual bool fixedNodalForcesBc(QVector<int>& nodes, QVector<int>&dof, QVector<double>& values) const;
91
92 virtual FemResultType fillElementDataForBc(const GmElement* e, const GmBoundaryCondition* bc, int bcIndex, int bcListIndex,
93 int border, GmpFemMatrixSet& elemMatrices, GmpFemVectorSet& elemVectors);
94
95 virtual FemResultType fillElementData(const GmElement* e, GmpFemMatrixSet& elemMatrices, GmpFemVectorSet& elemVectors);
96
97 virtual FemResultType fillEnrichedElementData(const GmElement* e, GmpFemMatrixSet& elemMatrices, GmpFemVectorSet& elemVectors);
98
99 virtual FemResultType fillEnrichedElementSubData(const GmElement* e, GmVector& ue, GmVector& we, int nRegDofs, int nEnrDof, GmMatrix& Kuu, GmMatrix& Kuw, GmMatrix& Kww, GmVector& fiu, GmVector& fiw);
100
101 virtual FemResultType solveDiscontinuityEquilibriumEq(const GmElement* e, GmVector& ue, GmVector& we, int nRegDofs, int nEnrDof, GmMatrix& Kuu, GmMatrix& Kuw, GmMatrix& Kww, GmVector& fiu, GmVector& fiw);
102
103protected:
104
107 {
110
111 // ------ NO ADDING BELOW THIS LINE
113 };
114
117 {
121
122 // ------ NO ADDING BELOW THIS LINE
124 };
125
126
129 {
131
132
133 // ------ NO ADDING BELOW THIS LINE
135 };
136
139 {
143
144 // ------ NO ADDING BELOW THIS LINE
146 };
147
148 // See comments on the base class
149 virtual bool loadPrivateData(LuaTable& table);
150
151 virtual bool beforeElementStiffnessLoop(const GmpFemMatrixSet& elemMatrices, const GmpFemVectorSet& elemVectors);
152 virtual bool checkAndLoadPrivateData(LuaTable& table);
153 virtual void fillElementDisplacementJumps(const GmElement* e, GmVector& we);
154 virtual void oldElementDisplacementJumps(const GmElement* e, GmVector& we);
155 virtual void fillDiscontinuitySetElementData(const GmElement* e, GmVector& we, GmMatrix& Kd, GmVector& fid);
156 virtual void assembleElementData(bool needsK, bool needsFi, GmMatrix& elemK, GmMatrix& Kuu, GmMatrix& Kuw, GmMatrix& Kww, GmVector& elemFi, GmVector& fiu, GmVector& fiw);
157 virtual void get2DDiscontinuityRotationMatrix(const GmCompact2DSegmentCellIntersection* discontinuitySeg, GmMatrix& R);
158 virtual void displacementJumpShapeFunction(GmVector& N, GmMatrix& Nd);
159 virtual void discontinuityCohesiveLaw(double ks, double kn, GmVector& w, GmVector& td, GmMatrix& Td);
160 virtual void addTranslationDeformationMode(GmMatrix& Mu);
161 virtual void addRelativeRotationDeformationMode(GmMatrix& Mu, GmVector& X, GmVector& Xr, GmVector& n, GmVector& m);
162 virtual void transformSpaceDisplacementJumpMappingMatrix(GmMatrix& Mu, const GmCompact2DSegmentCellIntersection* discontinuitySeg);
163 virtual void fillDisplacementJumpMappingMatrix(const GmElement* e, GmMatrix& Xe, GmMatrix& Mu);
164 virtual void get2DDiscontinuityGeometry(const GmCompact2DSegmentCellIntersection* discontinuitySeg, GmVector& Xref, GmVector& m, GmVector& nd);
165 virtual void fillEnrichedBuMatrix(const GmElement* e, const GmShape* elemShape, const GmVector& Xn, GmMatrix& Xe, GmMatrix& Mu, GmMatrix& Bu, GmMatrix& Buenr);
166 double heavisideFunction(GmVector& X, GmVector& Xref, GmVector& nd);
167 int getNumberEnrichedDofs(const GmElement* e);
168 virtual void fillHeavisideMatrix(GmMatrix& Hd, GmMatrix& Xe, GmVector& Xref, GmVector& nd);
169
170 const char* _pluginType;
172 GmpMechanicalPhysics* _mechPhys;
173 //GmSimulationData* _SimulationData; //!< Simulation data
174
175private:
176 GmDiscontinuitySet* _discontinuitySet;
177};
178#endif
GmPluginObjectFactory * objectFactory(QString pluginName, QString category="", QString objType="")
GmPluginLoader * loader() const
Basic class for the standard plane strain physics plugin object.
Definition xfemMechanicEmbeddedFracture.h:66
GmMatrix _Dsn
Constitutive tangent matrix (2 x 2)
Definition xfemMechanicEmbeddedFracture.h:171
XfemMechanicEmbeddedFracture(const char *pluginType, GmSimulationData *simulation, QString id, QString description, const GmpFemPhysicsCommonMaterialFactory *matFactory, const GmLogCategory &logger)
Constructor. Will be called by the plugin loading code.
Definition xfemMechanicEmbeddedFracture.cpp:63
const char * _pluginType
The plugin type name.
Definition xfemMechanicEmbeddedFracture.h:170
virtual bool checkAndLoadPrivateData(LuaTable &table)
Overloads default checkAndLoadPrivateData() to be able to setup materials.
Definition xfemMechanicEmbeddedFracture.cpp:222
embeddedBC_Ids
IDs for accepted boundary condition types.
Definition xfemMechanicEmbeddedFracture.h:129
@ NUM_BC_IDS
The number of boundary conditions ids above.
Definition xfemMechanicEmbeddedFracture.h:134
@ FIXED_W_BC_ID
Id for fixed Jump displacement boundary condition.
Definition xfemMechanicEmbeddedFracture.h:130
embeddedBCValueIds
IDs for property values from accepted boundary condition types.
Definition xfemMechanicEmbeddedFracture.h:139
@ BC_WY_ID
Nodal jump displacement boundary condition in y.
Definition xfemMechanicEmbeddedFracture.h:141
@ NUM_BCV_IDS
The number of boundary conditions value ids above.
Definition xfemMechanicEmbeddedFracture.h:145
@ BC_WZ_ID
Nodal jump displacement boundary condition in z.
Definition xfemMechanicEmbeddedFracture.h:142
@ BC_WX_ID
Nodal jump displacement boundary condition in x.
Definition xfemMechanicEmbeddedFracture.h:140
virtual ~XfemMechanicEmbeddedFracture()
Destructor.
Definition xfemMechanicEmbeddedFracture.cpp:96
GmpMechanicalPhysics * _mechPhys
The mechanical physics providing parameters and matrices to the coupling equation.
Definition xfemMechanicEmbeddedFracture.h:172
virtual bool fixedNodalDofsBc(QVector< int > &nodes, QVector< int > &dof, QVector< double > &values, bool *constantValues) const
See comments on base class. Fills vectors with prescribed node pore pressures.
Definition xfemMechanicEmbeddedFracture.cpp:313
virtual FemResultType fillEnrichedElementSubData(const GmElement *e, GmVector &ue, GmVector &we, int nRegDofs, int nEnrDof, GmMatrix &Kuu, GmMatrix &Kuw, GmMatrix &Kww, GmVector &fiu, GmVector &fiw)
Fills the enriched element sub-matrices and sub-vectors.
Definition xfemMechanicEmbeddedFracture.cpp:666
virtual const QVariantMap * physicsMetaDataMap()
Returns a reference for the Xfem mechanical physics attribute map, built when the function is called ...
Definition xfemMechanicEmbeddedFracture.cpp:102
embeddedStateVarIds
IDs for Mechanical xfem state vars.
Definition xfemMechanicEmbeddedFracture.h:107
@ U_ID
Id for retrieving the accessor to the displacement state var.
Definition xfemMechanicEmbeddedFracture.h:108
@ W_ID
Id for retrieving the accessor to the enriched state var
Definition xfemMechanicEmbeddedFracture.h:109
@ NUM_STATEVAR_IDS
The number of state var ids above.
Definition xfemMechanicEmbeddedFracture.h:112
virtual FemResultType fillEnrichedElementData(const GmElement *e, GmpFemMatrixSet &elemMatrices, GmpFemVectorSet &elemVectors)
Fills the element matrices and vectors for a enriched element.
Definition xfemMechanicEmbeddedFracture.cpp:496
virtual FemResultType fillElementData(const GmElement *e, GmpFemMatrixSet &elemMatrices, GmpFemVectorSet &elemVectors)
Fills the element matrices and vectors for generic elements.
Definition xfemMechanicEmbeddedFracture.cpp:455
int getNumberEnrichedDofs(const GmElement *e)
Gets the number of enrichment degrees of freedom in the given element TODO: Generalize to consider th...
Definition xfemMechanicEmbeddedFracture.cpp:590
embeddedPhysicsAttributeIds
IDs for physics attributes.
Definition xfemMechanicEmbeddedFracture.h:117
@ ISOPARAMETRIC_ID
Id for retrieving the isoParametric physics attribute.
Definition xfemMechanicEmbeddedFracture.h:118
@ CONDENSATION_ID
Id for retrieving the static condensation physics attribute.
Definition xfemMechanicEmbeddedFracture.h:119
@ NUM_ATTRI_IDS
The number of physics attribute ids above.
Definition xfemMechanicEmbeddedFracture.h:123
@ CONDENSATION_TOL
Tolerance for the static condensation process.
Definition xfemMechanicEmbeddedFracture.h:120
Basic class for a XFEM mesh. This is the basic mesh interface for xfem problems adding enrichment cap...
Definition xfemMesh.h:50
virtual XfemGaussAccessor * enrichedGaussAttributeAccessor(QString id, Unit desiredUnit, const GmLogCategory &logger) const
Equivalent to call enrichedGaussAttributeAccessor(id, 0, true, desiredUnit, logger)
Definition xfemMesh.h:86
Auxiliar class wrapping a plugin physics object. Its only purpose is to override the creation of Gaus...
Definition xfemMechanicEmbeddedFracture.h:43
virtual GmGaussAccessor * createGaussAttributeAccessor(GmElementMesh *mesh, QString id, int snum, bool locked, Unit desiredUnit, const GmLogCategory &logger) const
Overrides the standard GmpFemPhysics::createGaussAttributeAccessor() implementation to create an enri...
Definition xfemMechanicEmbeddedFracture.h:54
arma::mat GmMatrix
arma::vec GmVector
Declaration of the XfemMesh class.