SCOREC core
Parallel unstructured mesh tools
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
apfShape.h
Go to the documentation of this file.
1 /*
2  * Copyright 2011 Scientific Computation Research Center
3  *
4  * This work is open source software, licensed under the terms of the
5  * BSD license as described in the LICENSE file in the top-level directory.
6  */
7 
8 #ifndef APFSHAPE_H
9 #define APFSHAPE_H
10 
14 #include "apf.h"
15 #include "apfNew.h"
16 #include <sstream>
17 
18 namespace apf {
19 
20 class Mesh;
21 class MeshEntity;
22 
25 {
26  public:
27  virtual ~EntityShape();
31  virtual void getValues(
32  Mesh* m,
33  MeshEntity* e,
34  Vector3 const& xi,
35  NewArray<double>& values) const = 0;
40  virtual void getLocalGradients(
41  Mesh* m,
42  MeshEntity* e,
43  Vector3 const& xi,
44  NewArray<Vector3>& grads) const = 0;
49  virtual int countNodes() const = 0;
66  virtual void alignSharedNodes(Mesh* m,
67  MeshEntity* elem, MeshEntity* shared, int order[]);
68 };
69 
74 {
75  public:
76  virtual ~FieldShape();
79  virtual EntityShape* getEntityShape(int type) = 0;
82  virtual bool hasNodesIn(int dimension) = 0;
88  virtual int countNodesOn(int type) = 0;
91  virtual int getOrder() = 0;
96  virtual void getNodeXi(int type, int node, Vector3& xi);
98  virtual const char* getName() const = 0;
99  void registerSelf(const char* name);
100 };
101 
104 FieldShape* getLagrange(int order);
105 
108 
112 FieldShape* getConstant(int dimension);
120 FieldShape* getIPShape(int dimension, int order);
126 FieldShape* getVoronoiShape(int dimension, int order);
132 FieldShape* getIPFitShape(int dimension, int order);
133 
137 FieldShape* getHierarchic(int order);
138 
140 void projectHierarchicField(Field* to, Field* from);
141 
142 FieldShape* getShapeByName(const char* name);
143 
146 int countElementNodes(FieldShape* s, int type);
147 
155  Mesh* m,
156  MeshEntity* boundary,
157  MeshEntity* element,
158  Vector3 const& xi);
159 
160 }
161 
162 #endif
FieldShape * getIPShape(int dimension, int order)
Get the Integration Point distribution.
virtual void getLocalGradients(Mesh *m, MeshEntity *e, Vector3 const &xi, NewArray< Vector3 > &grads) const =0
evaluate element shape function gradients
virtual void getNodeXi(int type, int node, Vector3 &xi)
Get the parent element coordinates of an element node.
The APF Field interface.
virtual void getValues(Mesh *m, MeshEntity *e, Vector3 const &xi, NewArray< double > &values) const =0
evaluate element shape functions
int countElementNodes(FieldShape *s, int type)
count the number of nodes affecting an element type
FieldShape * getVoronoiShape(int dimension, int order)
Get the Voronoi shape function.
virtual int countNodes() const =0
return the number of nodes affecting this element
Describes field distribution and shape functions.
Definition: apfShape.h:73
FieldShape * getConstant(int dimension)
Get the Constant shape function over some dimension.
FieldShape * getHierarchic(int order)
Get the quadratic hierarchic shape function.
virtual int getOrder()=0
Return the polynomial order of the shape functions.
void projectHierarchicField(Field *to, Field *from)
Project a hierarchic field.
virtual EntityShape * getEntityShape(int type)=0
Get the sub-descriptor for this entity type.
FieldShape * getLagrange(int order)
Get the Lagrangian shape function of some polynomial order.
virtual int countNodesOn(int type)=0
Return the number of nodes associated with an entity of this type.
virtual const char * getName() const =0
Get a unique string for this shape function scheme.
Interface to a mesh part.
Definition: apfMesh.h:103
virtual void alignSharedNodes(Mesh *m, MeshEntity *elem, MeshEntity *shared, int order[])
convert from shared node order to local element order
apf::Mesh2 Mesh
convenient mesh name
Definition: maMesh.h:27
FieldShape * getIPFitShape(int dimension, int order)
Get the IP Fit shape function.
convenience wrapper over apf::Vector&lt;3&gt;
Definition: apfVector.h:150
virtual bool hasNodesIn(int dimension)=0
Return true iff there are nodes on entities of this dimension.
Shape functions over this element.
Definition: apfShape.h:24
Vector3 boundaryToElementXi(Mesh *m, MeshEntity *boundary, MeshEntity *element, Vector3 const &xi)
Reparameterize from boundary entity to element.
FieldShape * getSerendipity()
Get the Serendipity shape functions of second order.