GemaCoreLib
The GeMA Core library
gmGaussCoordinates.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 
23 #ifndef _GEMA_GAUSSCOORDINATES_H_
24 #define _GEMA_GAUSSCOORDINATES_H_
25 
26 #include "gmMatrix.h"
27 #include "gmIntegrationRule.h"
28 #include "gmElement.h"
29 
30 class GmElementMesh;
31 class GmValueAccessor;
32 
38 {
39 public:
41  int numPoints() const { assert(_ir); return _ir->numPoints(); }
42 
44  void coord(int ip, GmVector& c) const
45  {
46  assert(_ir && _shape);
47  GmVector ncrd;
48  double dummyWeight;
49  _ir->integrationPoint(ip, ncrd, &dummyWeight);
50  _shape->naturalToCartesian(ncrd, _X, c);
51  }
52 
54  const GmShape* shape() const { return _shape; }
55 
57  const GmIntegrationRule* integrationRule() const { return _ir; }
58 
62  GmMatrix& coordMatrix() { return _X; }
63 
64 protected:
66  GmGaussCoordinates(const GmShape* shape, const GmIntegrationRule* ir)
67  : _shape(shape), _ir(ir) {}
68 
69  const GmShape* _shape;
72 };
73 
80 {
81 public:
82  GmSingleGaussCoordinates(const GmIntegrationRule* ir, const GmElement* e, const GmValueAccessor* coordAc);
83  GmSingleGaussCoordinates(const GmElementMesh* mesh, int ruleSet, const GmElement* e, const GmValueAccessor* coordAc);
84 };
85 
102 {
103 public:
104  GmMultiGaussCoordinates(const GmElementMesh* mesh, int ruleSet, const GmValueAccessor* coordAc);
105 
106  void setElement(const GmElement* e);
107 
108 private:
110  int _ruleSet;
113 };
114 
115 
116 #endif
117 
118 
Base interface for FEM (finite element) mesh elements.
Definition: gmElement.h:37
GmCellType _lastType
The type of the last element.
Definition: gmGaussCoordinates.h:112
int _ruleSet
The rule set defining the integration rules used by the elements.
Definition: gmGaussCoordinates.h:110
int numPoints() const
Return the number of integration points for this element.
Definition: gmGaussCoordinates.h:41
A helper class that returns the coordinates of an element's Gauss points. Should be used when we want...
Definition: gmGaussCoordinates.h:79
const GmShape * shape() const
Returns the current element shape function.
Definition: gmGaussCoordinates.h:54
Declaration of the GmMatrix class.
const GmIntegrationRule * _ir
The integration rule defining the set of Gauss points.
Definition: gmGaussCoordinates.h:70
const GmValueAccessor * _coordAc
The node coordinate accessor.
Definition: gmGaussCoordinates.h:111
Interface class for accessing and setting values from an "indexable" collection of values.
Definition: gmValueAccessor.h:59
A helper class that returns the coordinates of an element's Gauss points. This class should not be in...
Definition: gmGaussCoordinates.h:37
const GmElementMesh * _mesh
The mesh containing the traversed elements.
Definition: gmGaussCoordinates.h:109
Declaration of the GmIntegrationRule class and its helper decendants.
Integration rule base classe.
Definition: gmIntegrationRule.h:88
Shape function handling base classe.
Definition: gmShape.h:37
GmMatrix _X
The matrix with element node coordinates.
Definition: gmGaussCoordinates.h:71
GmMatrix & coordMatrix()
Returns a WRITABLE reference to the current element node coordinates. Can be used to alter the standa...
Definition: gmGaussCoordinates.h:62
GmGaussCoordinates(const GmShape *shape, const GmIntegrationRule *ir)
The basic constructor. Accepts NULL parameters as long as they are filled before using numPoints() or...
Definition: gmGaussCoordinates.h:66
#define GMC_API_EXPORT
Macro for controling if the class is being exported (GEMA_CORE_LIB defined) or imported (GEMA_CORE_LI...
Definition: gmCoreConfig.h:35
GmCellType
Mesh Cell types. Don't change type orders or add types without reading comments below.
Definition: gmCellType.h:30
A helper class that returns the coordinates of an element's Gauss points, tailored to be used inside ...
Definition: gmGaussCoordinates.h:101
Base interface for FEM (finite element) meshes.
Definition: gmElementMesh.h:40
Implementation of the GmElement class.
const GmIntegrationRule * integrationRule() const
Returns the current element integration rule.
Definition: gmGaussCoordinates.h:57
arma::vec GmVector
The basic type for a GeMA vector object. Currently based on an Armadillo vector.
Definition: gmVector.h:34
const GmShape * _shape
The shape function for the element type.
Definition: gmGaussCoordinates.h:69
void coord(int ip, GmVector &c) const
Fills c with the cartesian coordinates of integration point ip.
Definition: gmGaussCoordinates.h:44
arma::mat GmMatrix
The basic type for a GeMA matrix object. Currently based on an Armadillo matrix.
Definition: gmMatrix.h:38