GemaCoreLib
The GeMA Core library
gmElement.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_ELEMENT_H_
25 #define _GEMA_ELEMENT_H_
26 
27 #include "gmCell.h"
28 #include "gmShape.h"
29 
30 class GmGaussAccessor;
31 class GmIntegrationRule;
32 
38 {
39 public:
41  virtual const GmShape* shape() const { return GmShape::shapeFromElementType(type(), 0, 0); }
42 
46  virtual const GmShape* linearShape() const { return GmShape::linearShapeFromElementType(type(), 0, 0); }
47 
53  virtual void naturalCenter(GmVector& coord) const
54  {
55  shape()->naturalCenter(coord);
56  }
57 
58  virtual void borderNormal(const GmValueAccessor* nodeAccessor, int border, const GmVector* coord, GmVector& n) const;
59 
60  virtual bool borderNormalIsConstant(int border) const;
61 
63  virtual void borderTangent(const GmValueAccessor* nodeAccessor, int border, GmVector& t) const;
64 };
65 
68 {
69 public:
71  virtual int hPOrder() const = 0;
72 
74  virtual int hQOrder() const = 0;
75 
77  virtual GmCellGeometry geometry() const { return GmCellGeometry(type(), hPOrder(), hQOrder()); }
78 
80  virtual const GmShape* shape() const { return GmShape::shapeFromElementType(type(), hPOrder(), hQOrder()); }
81 
83  virtual const GmShape* linearShape() const { return GmShape::linearShapeFromElementType(type(), hPOrder(), hQOrder()); }
84 };
85 
86 #endif
87 
Base interface for FEM (finite element) mesh elements.
Definition: gmElement.h:37
The GmGaussAccessor class is a proxy object to a value accesor implementing a more convenient interfa...
Definition: gmGaussAccessor.h:38
Base interface for mesh cells.
Definition: gmCell.h:81
virtual const GmShape * shape() const
Returns a shape function object corresponding to the current element type.
Definition: gmElement.h:41
static const GmShape * linearShapeFromElementType(GmCellType etype, int P, int Q)
Returns a linear shape object suitable for handling elements of type etype. Parameters P and Q are ne...
Definition: gmShape.cpp:1052
Interface class for accessing and setting values from an "indexable" collection of values.
Definition: gmValueAccessor.h:59
A class used to return static metadata information about a cell geometry, along with some methods for...
Definition: gmCellGeometry.h:54
Integration rule base classe.
Definition: gmIntegrationRule.h:88
Shape function handling base classe.
Definition: gmShape.h:37
virtual const GmShape * shape() const
See comments on the base class.
Definition: gmElement.h:80
virtual const GmShape * linearShape() const
See comments on the base class.
Definition: gmElement.h:83
virtual GmCellType type() const =0
Returns the cell type.
#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
static const GmShape * shapeFromElementType(GmCellType etype, int P, int Q)
Returns a shape object suitable for handling elements of type etype. Parameters P and Q are needed on...
Definition: gmShape.cpp:1012
Hierarchical element.
Definition: gmElement.h:67
virtual GmCellGeometry geometry() const
See comments on the base class.
Definition: gmElement.h:77
virtual void naturalCenter(GmVector &coord) const
Definition: gmElement.h:53
Declaration of the GmCell class.
arma::vec GmVector
The basic type for a GeMA vector object. Currently based on an Armadillo vector.
Definition: gmVector.h:34
Declaration of the GmShape base class.
virtual const GmShape * linearShape() const
For quadratic elements, returns the shape function of the equivalent linear element....
Definition: gmElement.h:46