MechanicalFemPhysics
The GeMA Mechanical FEM Physics Plugin
gmpMechanicalEmbeddedFracture.h
Go to the documentation of this file.
1 /************************************************************************
2 **
3 ** Copyright (C) 2014 by Carlos Augusto Teixera Mendes
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 
24 #ifndef _GEMA_PLUGIN_MECHANICAL_EMBEDDED_FRACTURE_H_
25 #define _GEMA_PLUGIN_MECHANICAL_EMBEDDED_FRACTURE_H_
26 
27 #include "gmpMechanicalPhysics.h"
28 
29 #include <gmpFemPhysicsCommon.h>
30 #include <gmpFemPhysicsData.h>
31 #include <gmDiscontinuitySet.h>
32 #include <gmDiscontinuity.h>
35 #include <gmTrace.h>
36 
37 class GmGaussAccessor;
38 
41 class GMP_MECHANICAL_PHYSICS_API_EXPORT GmpMechanicalEmbeddedFracture: public GmpMechanicalSolid
42 {
43 public:
44 
45  // constructor
46  GmpMechanicalEmbeddedFracture(const char* pluginType, GmSimulationData* simulation, QString id, QString description,
47  const GmpFemPhysicsCommonMaterialFactory* matFactory, const GmLogCategory& logger);
48 
49  // destructor
51 
52  // set physic map
53  virtual const QVariantMap* physicsMetaDataMap();
54  bool numberEnhancedDofs(const GmElement* e, int & ndofw);
55  //virtual bool beforeElementStiffnessLoop(const GmpFemMatrixSet& elemMatrices, const GmpFemVectorSet& elemVectors);
56  virtual FemResultType fillElementData(const GmElement* e, GmpFemMatrixSet& elemMatrices, GmpFemVectorSet& elemVectors);
57  // Fills fracture contribution
58  virtual FemResultType fillEnrichedElementData(const GmElement* e, GmMatrix& K, GmVector& Fi, bool needsK, bool needsFi);
59  void initializeFractureGeometry(double & ld, GmVector & m1, GmVector & m2, GmVector & nd, GmVector & Xref, GmMatrix & Xf, int nfn);
60  void elementStiffnessSubMtrcs(const GmElement * e, const GmElement * ef, GmVector & we, GmMatrix & Kaa, GmMatrix & Kaw, GmMatrix & Kwa, GmVector & Fi, bool needsFi);
61  void fillBulkContribution(const GmElement * e, const GmElement * ef, GmVector & we, GmMatrix & Kww, GmVector & Fint);
62  void fillGrMtrx(const GmElement * e, GmMatrix & Gr, GmMatrix & Bu, GmVector & Xip);
63  void elementStiffnessSubMtrx_Kaw(GmMatrix & Kaa, GmMatrix & Kaw, GmMatrix & Xe, const GmElement * e, const GmElement * ef);
64  //void elementStiffnessSubMtrx_Kaw(GmMatrix & Kaa, GmMatrix & Kaw, GmMatrix & Xe, GmVector & m1, GmVector & nd, GmVector & Xref, double ld, int d, int ne, int nfn);
65  void elementStiffnessSubMtrx_Kwa(GmMatrix & Kaa, GmMatrix & Kwa, GmMatrix & Xe, GmVector & m1, GmVector & nd, GmVector & Xref, double ld, int d, int ne, int nfn);
66  void elementStiffnessSubMtrx_Kww(GmMatrix & Kaa, GmMatrix & Kww, GmMatrix & Xe, GmVector & m1, GmVector & nd, GmVector & Xref, double ld, int d, int ne, int nfn);
67  void computeJumpDisplacements(const GmElement * e, GmVector & we, GmMatrix & Kww);
68  void fillFractureElementData(const GmElement * ef, GmVector & strain, GmMatrix & Kd, GmVector & Fdi);
69  void updateFractureDisplacementJumps(const GmElement * ef, GmVector & we);
70  void getNodalDisplacementJumps(const GmElement * ef, GmVector & we);
71  double heavisideFnc(GmVector & X, GmVector & Xref, GmVector & nd);
72  void elementHeavisideMtrx(GmMatrix & Hd, GmVector & Xref, GmMatrix & Xe, GmVector & nd, int ne);
73  void rotationMtrx(const GmElement * ef, GmMatrix & Rot);
74  void mappingTranslationMtrx(GmMatrix & Mtr);
75  void mappingRelativeRotationMtrx(GmMatrix & Mrot, GmVector & X, GmVector & m1, GmVector & Xref, double ld);
76  void mappingRigidBodyMtrx(GmMatrix & Mrb, GmVector & X, GmVector & m1, GmVector & Xref, double ld, int nfn);
77  void elementMappingMtrx(GmMatrix & Me, GmVector & m1, GmMatrix & Xe, GmVector & Xref, double ld, int nfn, int ne);
78  void fillMiddleCoordinates(const GmElement * e, GmMatrix & X, GmMatrix & MX);
79  void constructShapeFncMtrx(GmMatrix & Nw, GmVector & N);
80  // See comments on the base class
81  virtual bool calcDerivedResults(bool nonLinearSolver);
82  // Comments on the base class
83  //virtual bool dofByElement(bool* fixed, bool* addOnly, bool* trackChanges) const;
84  // Comments on the base class
85  virtual const GmElementDof* dofMapping(const GmElement* e) const;
86 
87 protected:
90  {
92 
93  // ------ NO ADDING BELOW THIS LINE
95  };
96 
99  {
102 
103  // ------ NO ADDING BELOW THIS LINE
105  };
106 
107  // See comments on the base class
108  virtual bool loadPrivateData(LuaTable& table);
109 
110 private:
111  const char* _pluginType;
112  GmpFemPhysicsData _fractureData;
113 };
114 
115 #endif
The number of physics attribute ids above.
Definition: gmpMechanicalPhysics.h:101
Declaration of the GmpMechanicalPhysics class.
virtual bool calcDerivedResults(bool nonLinearSolver)
Calc stress component on nodes and/or Gauss points, ADDING the calculated value to the current result...
Definition: gmpMechanicalSolid.cpp:558
virtual FemResultType fillElementData(const GmElement *e, GmpFemMatrixSet &elemMatrices, GmpFemVectorSet &elemVectors)
Fills the element matrices and vectors for a generic elements.
Definition: gmpMechanicalSolid.cpp:234
StateVarIds
IDs for Mechanical and Hydro physics state vars.
Definition: gmpMechanicalEmbeddedFracture.h:89
The number of state var ids above.
Definition: gmpMechanicalEmbeddedFracture.h:94
embeddedPhysicsAttributeIds
IDs for physics attributes.
Definition: gmpMechanicalEmbeddedFracture.h:98
virtual const QVariantMap * physicsMetaDataMap()
Returns a reference for the single mechanical physics attribute map, built when the function is calle...
Definition: gmpMechanicalSolid.cpp:61
GmpFemPhysicsData _fractureData
fiber data
Definition: gmpMechanicalEmbeddedFracture.h:112
const char * _pluginType
The plugin type name.
Definition: gmpMechanicalEmbeddedFracture.h:111
The number of physics attribute ids above.
Definition: gmpMechanicalEmbeddedFracture.h:104
Basic class for the mechanical physics plugin object.
Definition: gmpMechanicalSolid.h:35
Basic class for the mechanical physics plugin object.
Definition: gmpMechanicalEmbeddedFracture.h:41
The number of state var ids above.
Definition: gmpMechanicalPhysics.h:110
arma::vec GmVector
arma::mat GmMatrix