MechanicalFemPhysics
The GeMA Mechanical FEM Physics Plugin
gmpSpring.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_SPRING_H_
25 #define _GEMA_PLUGIN_SPRING_H_
26 
27 #include "gmpMechanicalPhysics.h"
28 #include <gmpFemPhysicsCommon.h>
29 #include <gmMathUtils.h>
30 
31 class GmGaussAccessor;
32 
36 {
37 public:
38 
39  //constructor
40  GmpSpring(const char* pluginType, GmSimulationData* simulation, QString id, QString description,
41  const GmpFemPhysicsCommonMaterialFactory* matFactory, const GmLogCategory& logger);
42 
43  //destructor
44  virtual ~GmpSpring();
45 
48  {
49  KS_ID ,
50 
51  // --- NO ADDING BELOW THIS LINE
53  };
54 
55  // See comments on the base class
56  virtual const QVariantMap* physicsMetaDataMap();
57  // See comments on the base class
58  virtual double fillBuMatrix(const GmElement* e, const GmShape* shape, const GmVector& ncoord, const GmMatrix& X, const GmVector& N, const GmMatrix& J, GmMatrix& Bp);
59  // See comments on the base class
60  virtual FemResultType fillElementData(const GmElement* e, GmpFemMatrixSet& elemMatrices, GmpFemVectorSet& elemVectors);
61  // Recovers the derived results
62  virtual bool calcDerivedResults(bool nonLinearSolver);
63 
64 protected:
65  // See comments on the base class
66  virtual bool checkAndLoadAttributeAccessors(LuaTable& nodeTable, LuaTable& gaussTable);
67 
68 private:
69  double calcElementStress(GmElement* e);
70 
71 };
72 
73 #endif
Declaration of the GmpMechanicalPhysics class.
double calcElementStress(GmElement *e)
Calculates the bar internal stress.
Definition: gmpSpring.cpp:226
virtual FemResultType fillElementData(const GmElement *e, GmpFemMatrixSet &elemMatrices, GmpFemVectorSet &elemVectors)
Fills the element internal force and stiffness.
Definition: gmpSpring.cpp:118
Basic class for the standard stress bar physics plugin object.
Definition: gmpSpring.h:35
The number of property ids above.
Definition: gmpSpring.h:52
springPropertyIds
IDs for physics element properties.
Definition: gmpSpring.h:47
virtual ~GmpSpring()
Destructor.
Definition: gmpSpring.cpp:57
virtual double fillBuMatrix(const GmElement *e, const GmShape *shape, const GmVector &ncoord, const GmMatrix &X, const GmVector &N, const GmMatrix &J, GmMatrix &Bp)
Given a point 'ncood', the element coordinate matrix 'X', the point shape functions 'N' and the trans...
Definition: gmpSpring.cpp:192
virtual bool checkAndLoadAttributeAccessors(LuaTable &nodeTable, LuaTable &gaussTable)
Reimplementation of the common function to init the _mechanicPoint structure.
Definition: gmpSpring.cpp:84
virtual const QVariantMap * physicsMetaDataMap()
Returns a reference for the single Hydraulics attribute map, built when the function is called for th...
Definition: gmpSpring.cpp:62
GmpSpring(const char *pluginType, GmSimulationData *simulation, QString id, QString description, const GmpFemPhysicsCommonMaterialFactory *matFactory, const GmLogCategory &logger)
Constructor.
Definition: gmpSpring.cpp:50
arma::vec GmVector
Id for retrieving the accessor of axial elastic stiffness.
Definition: gmpSpring.h:49
arma::mat GmMatrix
Basic class for the mechanical physics plugin object.
Definition: gmpMechanicalPhysics.h:37
virtual bool calcDerivedResults(bool nonLinearSolver)
Recovers per element stresses for bar elements, storing the results in an element attribute.
Definition: gmpSpring.cpp:210