Xfem
The Xfem Plugin
xfemHydraulicEmbeddedFracture.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_HYDRAULIC_EMBEDDEDFRACTURE_H_
24 #define _GEMA_XFEM_HYDRAULIC_EMBEDDEDFRACTURE_H_
25 
26 #include <gmpFemPhysicsCoupled.h>
27 #include <gmpHydraulic.h>
28 #include <gmDiscontinuitySet.h>
29 #include <gmDiscontinuity.h>
32 
33 #include "xfemMesh.h"
34 
35 class GmpHydraulicPhysics;
36 class GmGaussAccessor;
37 
40 class XfemHydraulicEmbeddedFracture : public GmpFemPhysicsCoupled
41 {
42 public:
43  // constructor
44  XfemHydraulicEmbeddedFracture(const char* pluginType, GmSimulationData* simulation, QString id, QString description,
45  const GmpFemPhysicsCommonMaterialFactory* matFactory, const GmLogCategory& logger);
46  // destructor
48 
49  // Comments on the base class
50  virtual const char* pluginName() const { return "Xfem"; }
51 
52  virtual const char* pluginType() const { return _pluginType; }
53 
54  // set physic map
55  virtual const QVariantMap* physicsMetaDataMap();
56 
57  // Comments on the base class
58 
59  virtual bool dofByElement(bool* fixed, bool* addOnly, bool* trackChanges) const;
60 
61  virtual const GmElementDof* dofMapping(const GmElement* e) const;
62 
63  virtual bool fixedNodalDofsBc(QList<int>& nodes, QList<int>&dof, QList<double>& values, bool* constantValues) const;
64 
65  virtual bool fixedNodalForcesBc(QList<int>& nodes, QList<int>&dof, QList<double>& values) const;
66 
67  virtual FemResultType fillElementDataForBc(const GmElement* e, const GmBoundaryCondition* bc, int bcIndex, int bcListIndex,
68  int border, GmpFemMatrixSet& elemMatrices, GmpFemVectorSet& elemVectors);
69 
70  virtual FemResultType fillElementData(const GmElement* e, GmpFemMatrixSet& elemMatrices, GmpFemVectorSet& elemVectors);
71 
72  virtual FemResultType fillEnrichedElementData(const GmElement* e, GmpFemMatrixSet& elemMatrices, GmpFemVectorSet& elemVectors);
73 
74  virtual FemResultType fillEnrichedElementSubData(const GmElement* e, GmVector& pe, GmVector& Dpe, int nRegDofs, int nEnrDof, GmMatrix& Scc, GmMatrix& Scd, GmMatrix& Sdd, GmMatrix& Hcc, GmMatrix& Hcd, GmMatrix& Hdd, GmVector& qic, GmVector& qid);
75 
76 protected:
77 
80  {
81  P_ID,
83 
84  // ------ NO ADDING BELOW THIS LINE
86  };
87 
90  {
94 
95  // ------ NO ADDING BELOW THIS LINE
97  };
98 
99 
102  {
104 
105 
106  // ------ NO ADDING BELOW THIS LINE
108  };
109 
112  {
116 
117  // ------ NO ADDING BELOW THIS LINE
119  };
120 
121  virtual bool beforeElementStiffnessLoop(const GmpFemMatrixSet& elemMatrices, const GmpFemVectorSet& elemVectors);
122  virtual bool checkAndLoadPrivateData(LuaTable& table);
123  virtual void fillElementPressureJumps(const GmElement* e, GmVector& Dpe);
124  virtual void oldElementDisplacementJumps(const GmElement* e, GmVector& we);
125  virtual void fillDiscontinuitySetElementData(const GmElement* e, GmVector& we, GmMatrix& Kd, GmVector& fid);
126  virtual void assembleElementData(bool needsK, bool needsFi, GmMatrix& elemK, GmMatrix& Kuu, GmMatrix& Kuw, GmMatrix& Kww, GmVector& elemFi, GmVector& fiu, GmVector& fiw);
127  virtual void get2DDiscontinuityRotationMatrix(const GmCompact2DSegmentCellIntersection* discontinuitySeg, GmMatrix& R);
128  virtual void discontinuityCohesiveLaw(double ks, double kn, GmVector& w, GmVector& td, GmMatrix& Td);
129  virtual void fillPressureJumpMappingMatrix(const GmElement* e, GmMatrix& Xe, GmMatrix& Mp);
130  virtual void get2DDiscontinuityGeometry(const GmCompact2DSegmentCellIntersection* discontinuitySeg, GmVector& Xref, GmVector& m, GmVector& nd);
131  virtual void fillEnrichedBuMatrix(const GmElement* e, const GmShape* elemShape, const GmVector& Xn, GmMatrix& Xe, GmMatrix& Mu, GmMatrix& Bu, GmMatrix& Buenr);
132  double heavisideFunction(GmVector& X, GmVector& Xref, GmVector& nd);
133  int getNumberEnrichedDofs(const GmElement* e);
134  virtual void fillHeavisideMatrix(GmMatrix& Hd, GmMatrix& Xe, GmVector& Xref, GmVector& nd);
135 
136  virtual double fillBpMatrix(const GmShape* shape, const GmVector& ncoord, const GmMatrix& X, const GmVector& N, const GmMatrix& J, GmMatrix& Bp)
137  {
138  S_TRACE();
139  Q_UNUSED(X); Q_UNUSED(N);
140  return shape->shapeCartesianPartialsFromJacobian(ncoord, J, Bp, true);
141  }
142 
143  const char* _pluginType;
145  GmpHydraulic* _hydroPhys;
146  //GmSimulationData* _SimulationData; //!< Simulation data
147 
148 private:
149  GmDiscontinuitySet* _discontinuitySet;
150 };
151 #endif
virtual FemResultType fillEnrichedElementSubData(const GmElement *e, GmVector &pe, GmVector &Dpe, int nRegDofs, int nEnrDof, GmMatrix &Scc, GmMatrix &Scd, GmMatrix &Sdd, GmMatrix &Hcc, GmMatrix &Hcd, GmMatrix &Hdd, GmVector &qic, GmVector &qid)
Fills the enriched element sub-matrices and sub-vectors.
Definition: xfemHydraulicEmbeddedFracture.cpp:490
GmpHydraulic * _hydroPhys
The mechanical physics providing parameters and matrices to the coupling equation.
Definition: xfemHydraulicEmbeddedFracture.h:145
virtual const QVariantMap * physicsMetaDataMap()
Returns a reference for the Xfem mechanical physics attribute map, built when the function is called ...
Definition: xfemHydraulicEmbeddedFracture.cpp:95
embeddedPhysicsAttributeIds
IDs for physics attributes.
Definition: xfemHydraulicEmbeddedFracture.h:89
virtual FemResultType fillElementData(const GmElement *e, GmpFemMatrixSet &elemMatrices, GmpFemVectorSet &elemVectors)
Fills the element matrices and vectors for generic elements.
Definition: xfemHydraulicEmbeddedFracture.cpp:323
Nodal jump displacement boundary condition in y.
Definition: xfemHydraulicEmbeddedFracture.h:114
#define S_TRACE()
Id for retrieving the accessor to the pore-pressure state var.
Definition: xfemHydraulicEmbeddedFracture.h:81
Id for retrieving the accessor to the discontinuity pore-pressure state var.
Definition: xfemHydraulicEmbeddedFracture.h:82
int getNumberEnrichedDofs(const GmElement *e)
Gets the number of enrichment degrees of freedom in the given element TODO: Generalize to consider th...
Definition: xfemHydraulicEmbeddedFracture.cpp:458
embeddedStateVarIds
IDs for Mechanical xfem state vars.
Definition: xfemHydraulicEmbeddedFracture.h:79
virtual bool checkAndLoadPrivateData(LuaTable &table)
Overloads default checkAndLoadPrivateData() to be able to setup materials.
Definition: xfemHydraulicEmbeddedFracture.cpp:146
XfemHydraulicEmbeddedFracture(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: xfemHydraulicEmbeddedFracture.cpp:60
Id for retrieving the static condensation physics attribute.
Definition: xfemHydraulicEmbeddedFracture.h:92
The number of boundary conditions value ids above.
Definition: xfemHydraulicEmbeddedFracture.h:118
virtual FemResultType fillEnrichedElementData(const GmElement *e, GmpFemMatrixSet &elemMatrices, GmpFemVectorSet &elemVectors)
Fills the element matrices and vectors for a enriched element.
Definition: xfemHydraulicEmbeddedFracture.cpp:360
Id for fixed Jump displacement boundary condition.
Definition: xfemHydraulicEmbeddedFracture.h:103
Declaration of the XfemMesh class.
Tolerance for the static condensation process.
Definition: xfemHydraulicEmbeddedFracture.h:93
The number of physics attribute ids above.
Definition: xfemHydraulicEmbeddedFracture.h:96
const char * _pluginType
The plugin type name.
Definition: xfemHydraulicEmbeddedFracture.h:143
The number of state var ids above.
Definition: xfemHydraulicEmbeddedFracture.h:85
Nodal jump displacement boundary condition in x.
Definition: xfemHydraulicEmbeddedFracture.h:113
GmMatrix _Dsn
Constitutive tangent matrix (2 x 2)
Definition: xfemHydraulicEmbeddedFracture.h:144
Nodal jump displacement boundary condition in z.
Definition: xfemHydraulicEmbeddedFracture.h:115
Basic class for the hydraulic embedded physics plugin object.
Definition: xfemHydraulicEmbeddedFracture.h:40
virtual ~XfemHydraulicEmbeddedFracture()
Destructor.
Definition: xfemHydraulicEmbeddedFracture.cpp:89
virtual double shapeCartesianPartialsFromJacobian(const GmVector &ncoord, const GmMatrix &J, GmMatrix &dN, bool transposed=false) const
The number of boundary conditions ids above.
Definition: xfemHydraulicEmbeddedFracture.h:107
arma::vec GmVector
embeddedBCValueIds
IDs for property values from accepted boundary condition types.
Definition: xfemHydraulicEmbeddedFracture.h:111
arma::mat GmMatrix
embeddedBC_Ids
IDs for accepted boundary condition types.
Definition: xfemHydraulicEmbeddedFracture.h:101
Id for retrieving the isoParametric physics attribute.
Definition: xfemHydraulicEmbeddedFracture.h:91
virtual bool fixedNodalDofsBc(QList< int > &nodes, QList< int > &dof, QList< double > &values, bool *constantValues) const
See comments on base class. Fills vectors with prescribed node pore pressures (TODO fill Pd)
Definition: xfemHydraulicEmbeddedFracture.cpp:242