Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008 #ifndef APFSHAPE_H
00009 #define APFSHAPE_H
00010
00014 #include "apf.h"
00015 #include "apfNew.h"
00016 #include <sstream>
00017
00018 namespace apf {
00019
00020 class Mesh;
00021 class MeshEntity;
00022
00024 class EntityShape
00025 {
00026 public:
00027 virtual ~EntityShape();
00031 virtual void getValues(
00032 Mesh* m,
00033 MeshEntity* e,
00034 Vector3 const& xi,
00035 NewArray<double>& values) const = 0;
00040 virtual void getLocalGradients(
00041 Mesh* m,
00042 MeshEntity* e,
00043 Vector3 const& xi,
00044 NewArray<Vector3>& grads) const = 0;
00049 virtual int countNodes() const = 0;
00066 virtual void alignSharedNodes(Mesh* m,
00067 MeshEntity* elem, MeshEntity* shared, int order[]);
00068 };
00069
00073 class FieldShape
00074 {
00075 public:
00076 virtual ~FieldShape();
00079 virtual EntityShape* getEntityShape(int type) = 0;
00082 virtual bool hasNodesIn(int dimension) = 0;
00088 virtual int countNodesOn(int type) = 0;
00091 virtual int getOrder() = 0;
00096 virtual void getNodeXi(int type, int node, Vector3& xi);
00098 virtual const char* getName() const = 0;
00099 void registerSelf(const char* name);
00100 };
00101
00104 FieldShape* getLagrange(int order);
00105
00107 FieldShape* getSerendipity();
00108
00112 FieldShape* getConstant(int dimension);
00120 FieldShape* getIPShape(int dimension, int order);
00126 FieldShape* getVoronoiShape(int dimension, int order);
00132 FieldShape* getIPFitShape(int dimension, int order);
00133
00137 FieldShape* getHierarchic(int order);
00138
00140 void projectHierarchicField(Field* to, Field* from);
00141
00142 FieldShape* getShapeByName(const char* name);
00143
00146 int countElementNodes(FieldShape* s, int type);
00147
00154 Vector3 boundaryToElementXi(
00155 Mesh* m,
00156 MeshEntity* boundary,
00157 MeshEntity* element,
00158 Vector3 const& xi);
00159
00160 }
00161
00162 #endif