Newer
Older
Éric Béchet
committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
//
// C++ Interface: MSubElement
//
// Description:
//
//
// Authors: <Frederic Duboeuf>, (C) 2012
//
// Copyright: See COPYING file that comes with this distribution
//
//
#ifndef _MSUBELEMENT_H_
#define _MSUBELEMENT_H_
#include "GmshMessage.h"
#include "MElement.h"
#include "MTetrahedron.h"
#include "MTriangle.h"
#include "MLine.h"
#include "MPoint.h"
class MSubTetrahedron : public MTetrahedron
{
protected:
bool _owner;
MElement* _orig;
std::vector<MElement*> _parents;
IntPt *_intpt;
public:
MSubTetrahedron(MVertex *v0, MVertex *v1, MVertex *v2, MVertex *v3, int num=0, int part=0, bool owner=false, MElement* orig=NULL)
: MTetrahedron(v0, v1, v2, v3, num, part), _owner(owner), _orig(orig), _intpt(0) {}
MSubTetrahedron(std::vector<MVertex*> v, int num=0, int part=0, bool owner=false, MElement* orig=NULL)
: MTetrahedron(v, num, part), _owner(owner), _orig(orig), _intpt(0) {}
~MSubTetrahedron();
virtual int getTypeForMSH() const { return MSH_TET_SUB; }
virtual const polynomialBasis* getFunctionSpace(int order=-1) const;
virtual const JacobianBasis* getJacobianFuncSpace(int order=-1) const;
virtual void getShapeFunctions(double u, double v, double w, double s[], int o);
virtual void getGradShapeFunctions(double u, double v, double w, double s[][3], int o);
virtual void getHessShapeFunctions(double u, double v, double w, double s[][3][3], int o);
// the parametric coordinates of the LineChildren are
// the coordinates in the local parent element.
virtual bool isInside(double u, double v, double w);
virtual void getIntegrationPoints(int pOrder, int *npts, IntPt **pts);
virtual MElement *getParent() const { return _orig; }
virtual void setParent(MElement *p, bool owner = false) { _orig = p; _owner = owner; }
virtual bool ownsParent() const { return _owner; }
virtual std::vector<MElement*> getMultiParents() const { return _parents; }
virtual void setMultiParent(std::vector<MElement*> &parents, bool owner = false) { _parents = parents; _orig = _parents[0]; _owner = owner; }
};
class MSubTriangle : public MTriangle
{
protected:
bool _owner;
MElement* _orig;
std::vector<MElement*> _parents;
IntPt *_intpt;
public:
MSubTriangle(MVertex *v0, MVertex *v1, MVertex *v2, int num=0, int part=0, bool owner=false, MElement* orig=NULL)
: MTriangle(v0, v1, v2, num, part), _owner(owner), _orig(orig), _intpt(0) {}
MSubTriangle(std::vector<MVertex*> v, int num=0, int part=0, bool owner=false, MElement* orig=NULL)
: MTriangle(v, num, part), _owner(owner), _orig(orig), _intpt(0) {}
~MSubTriangle();
virtual int getTypeForMSH() const { return MSH_TRI_SUB; }
virtual const polynomialBasis* getFunctionSpace(int order=-1) const;
virtual const JacobianBasis* getJacobianFuncSpace(int order=-1) const;
virtual void getShapeFunctions(double u, double v, double w, double s[], int o);
virtual void getGradShapeFunctions(double u, double v, double w, double s[][3], int o);
virtual void getHessShapeFunctions(double u, double v, double w, double s[][3][3], int o);
// the parametric coordinates of the LineChildren are
// the coordinates in the local parent element.
virtual bool isInside(double u, double v, double w);
virtual void getIntegrationPoints(int pOrder, int *npts, IntPt **pts);
virtual MElement *getParent() const { return _orig; }
virtual void setParent(MElement *p, bool owner = false) { _orig = p; _owner = owner; }
virtual bool ownsParent() const { return _owner; }
virtual std::vector<MElement*> getMultiParents() const { return _parents; }
virtual void setMultiParent(std::vector<MElement*> &parents, bool owner = false) { _parents = parents; _orig = _parents[0]; _owner = owner; }
};
class MSubLine : public MLine
{
protected:
bool _owner;
MElement* _orig;
std::vector<MElement*> _parents;
IntPt *_intpt;
public:
MSubLine(MVertex *v0, MVertex *v1, int num=0, int part=0, bool owner=false, MElement* orig=NULL)
: MLine(v0, v1, num, part), _owner(owner), _orig(orig), _intpt(0) {}
MSubLine(std::vector<MVertex*> v, int num=0, int part=0, bool owner=false, MElement* orig=NULL)
: MLine(v, num, part), _owner(owner), _orig(orig), _intpt(0) {}
~MSubLine();
virtual int getTypeForMSH() const { return MSH_LIN_SUB; }
virtual const polynomialBasis* getFunctionSpace(int order=-1) const;
virtual const JacobianBasis* getJacobianFuncSpace(int order=-1) const;
virtual void getShapeFunctions(double u, double v, double w, double s[], int o);
virtual void getGradShapeFunctions(double u, double v, double w, double s[][3], int o);
virtual void getHessShapeFunctions(double u, double v, double w, double s[][3][3], int o);
// the parametric coordinates of the LineChildren are
// the coordinates in the local parent element.
virtual bool isInside(double u, double v, double w);
virtual void getIntegrationPoints(int pOrder, int *npts, IntPt **pts);
virtual MElement *getParent() const { return _orig; }
virtual void setParent(MElement *p, bool owner = false) { _orig = p; _owner = owner; }
virtual bool ownsParent() const { return _owner; }
virtual std::vector<MElement*> getMultiParents() const { return _parents; }
virtual void setMultiParent(std::vector<MElement*> &parents, bool owner = false) { _parents = parents; _orig = _parents[0]; _owner = owner; }
};
class MSubPoint : public MPoint
{
protected:
bool _owner;
MElement* _orig;
std::vector<MElement*> _parents;
IntPt *_intpt;
public:
MSubPoint(MVertex *v0, int num=0, int part=0, bool owner=false, MElement* orig=NULL)
: MPoint(v0, num, part), _owner(owner), _orig(orig), _intpt(0) {}
MSubPoint(std::vector<MVertex*> v, int num=0, int part=0, bool owner=false, MElement* orig=NULL)
: MPoint(v, num, part), _owner(owner), _orig(orig), _intpt(0) {}
~MSubPoint();
virtual int getTypeForMSH() const { return MSH_PNT_SUB; }
virtual const polynomialBasis* getFunctionSpace(int order=-1) const;
virtual const JacobianBasis* getJacobianFuncSpace(int order=-1) const;
virtual void getShapeFunctions(double u, double v, double w, double s[], int o);
virtual void getGradShapeFunctions(double u, double v, double w, double s[][3], int o);
virtual void getHessShapeFunctions(double u, double v, double w, double s[][3][3], int o);
// the parametric coordinates of the PointChildren are
// the coordinates in the local parent element.
virtual bool isInside(double u, double v, double w);
virtual void getIntegrationPoints(int pOrder, int *npts, IntPt **pts);
virtual MElement *getParent() const { return _orig; }
virtual void setParent(MElement *p, bool owner = false) { _orig = p; _owner = owner; }
virtual bool ownsParent() const { return _owner; }
virtual std::vector<MElement*> getMultiParents() const { return _parents; }
virtual void setMultiParent(std::vector<MElement*> &parents, bool owner = false) { _parents = parents; _orig = _parents[0]; _owner = owner; }
};
#endif // _MSUBELEMENT_H_