Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
ElmerCSC
GitHub Repository: ElmerCSC/elmerfem
Path: blob/devel/ElmerGUI/netgen/libsrc/meshing/curvedelems_new.hpp
3206 views
1
#ifndef CURVEDELEMS_NEWH
2
#define CURVEDELEMS_NEWH
3
4
/**************************************************************************/
5
/* File: curvedelems.hpp */
6
/* Author: Robert Gaisbauer (first version) */
7
/* redesign by Joachim Schoeberl */
8
/* Date: 27. Sep. 02, Feb 2006 */
9
/**************************************************************************/
10
11
12
13
14
class Refinement;
15
16
17
class CurvedElements
18
{
19
const Mesh & mesh;
20
21
ARRAY<int> edgeorder;
22
ARRAY<int> faceorder;
23
24
ARRAY<int> edgecoeffsindex;
25
ARRAY<int> facecoeffsindex;
26
27
ARRAY< Vec<3> > edgecoeffs;
28
ARRAY< Vec<3> > facecoeffs;
29
30
ARRAY< double > edgeweight; // for rational 2nd order splines
31
32
int order;
33
bool rational;
34
35
bool ishighorder;
36
37
public:
38
CurvedElements (const Mesh & amesh);
39
~CurvedElements();
40
41
// bool IsHighOrder() const { return order > 1; }
42
bool IsHighOrder() const { return ishighorder; }
43
44
void SetHighOrder (int aorder) { order=aorder; }
45
46
void BuildCurvedElements(Refinement * ref, int aorder, bool arational = false);
47
48
int GetOrder () { return order; }
49
50
51
bool IsSegmentCurved (SegmentIndex segnr) const;
52
bool IsSurfaceElementCurved (SurfaceElementIndex sei) const;
53
bool IsElementCurved (ElementIndex ei) const;
54
55
56
void CalcSegmentTransformation (double xi, SegmentIndex segnr,
57
Point<3> & x)
58
{ CalcSegmentTransformation (xi, segnr, &x, NULL); };
59
60
void CalcSegmentTransformation (double xi, SegmentIndex segnr,
61
Vec<3> & dxdxi)
62
{ CalcSegmentTransformation (xi, segnr, NULL, &dxdxi); };
63
64
void CalcSegmentTransformation (double xi, SegmentIndex segnr,
65
Point<3> & x, Vec<3> & dxdxi)
66
{ CalcSegmentTransformation (xi, segnr, &x, &dxdxi, NULL); };
67
68
void CalcSegmentTransformation (double xi, SegmentIndex segnr,
69
Point<3> & x, Vec<3> & dxdxi, bool & curved)
70
{ CalcSegmentTransformation (xi, segnr, &x, &dxdxi, &curved); };
71
72
73
74
void CalcSurfaceTransformation (const Point<2> & xi, SurfaceElementIndex elnr,
75
Point<3> & x)
76
{ CalcSurfaceTransformation (xi, elnr, &x, NULL); };
77
78
void CalcSurfaceTransformation (const Point<2> & xi, SurfaceElementIndex elnr,
79
Mat<3,2> & dxdxi)
80
{ CalcSurfaceTransformation (xi, elnr, NULL, &dxdxi); };
81
82
void CalcSurfaceTransformation (const Point<2> & xi, SurfaceElementIndex elnr,
83
Point<3> & x, Mat<3,2> & dxdxi)
84
{ CalcSurfaceTransformation (xi, elnr, &x, &dxdxi, NULL); };
85
86
void CalcSurfaceTransformation (const Point<2> & xi, SurfaceElementIndex elnr,
87
Point<3> & x, Mat<3,2> & dxdxi, bool & curved)
88
{ CalcSurfaceTransformation (xi, elnr, &x, &dxdxi, &curved); };
89
90
91
92
93
94
void CalcElementTransformation (const Point<3> & xi, ElementIndex elnr,
95
Point<3> & x)
96
{ CalcElementTransformation (xi, elnr, &x, NULL); };
97
98
void CalcElementTransformation (const Point<3> & xi, ElementIndex elnr,
99
Mat<3,3> & dxdxi)
100
{ CalcElementTransformation (xi, elnr, NULL, &dxdxi); };
101
102
void CalcElementTransformation (const Point<3> & xi, ElementIndex elnr,
103
Point<3> & x, Mat<3,3> & dxdxi)
104
{ CalcElementTransformation (xi, elnr, &x, &dxdxi /* , NULL */ ); };
105
106
void CalcElementTransformation (const Point<3> & xi, ElementIndex elnr,
107
Point<3> & x, Mat<3,3> & dxdxi,
108
void * buffer, bool valid)
109
{ CalcElementTransformation (xi, elnr, &x, &dxdxi, /* NULL, */ buffer, valid ); };
110
111
// void CalcElementTransformation (const Point<3> & xi, ElementIndex elnr,
112
// Point<3> & x, Mat<3,3> & dxdxi) // , bool & curved)
113
// { CalcElementTransformation (xi, elnr, &x, &dxdxi /* , &curved * ); }
114
115
116
117
void CalcMultiPointSegmentTransformation (ARRAY<double> * xi, SegmentIndex segnr,
118
ARRAY<Point<3> > * x,
119
ARRAY<Vec<3> > * dxdxi);
120
121
void CalcMultiPointSurfaceTransformation (ARRAY< Point<2> > * xi, SurfaceElementIndex elnr,
122
ARRAY< Point<3> > * x,
123
ARRAY< Mat<3,2> > * dxdxi);
124
125
void CalcMultiPointElementTransformation (ARRAY< Point<3> > * xi, ElementIndex elnr,
126
ARRAY< Point<3> > * x,
127
ARRAY< Mat<3,3> > * dxdxi);
128
129
void CalcMultiPointElementTransformation (ElementIndex elnr, int n,
130
const double * xi, int sxi,
131
double * x, int sx,
132
double * dxdxi, int sdxdxi);
133
134
135
136
137
private:
138
139
void CalcSegmentTransformation (double xi, SegmentIndex segnr,
140
Point<3> * x = NULL, Vec<3> * dxdxi = NULL, bool * curved = NULL);
141
142
void CalcSurfaceTransformation (Point<2> xi, SurfaceElementIndex elnr,
143
Point<3> * x = NULL, Mat<3,2> * dxdxi = NULL, bool * curved = NULL);
144
145
void CalcElementTransformation (Point<3> xi, ElementIndex elnr,
146
Point<3> * x = NULL, Mat<3,3> * dxdxi = NULL, // bool * curved = NULL,
147
void * buffer = NULL, bool valid = 0);
148
149
150
151
152
153
154
class SegmentInfo
155
{
156
public:
157
SegmentIndex elnr;
158
int order;
159
int nv;
160
int ndof;
161
int edgenr;
162
};
163
164
void CalcElementShapes (SegmentInfo & elnr, double xi, Vector & shapes) const;
165
void GetCoefficients (SegmentInfo & elnr, ARRAY<Vec<3> > & coefs) const;
166
void CalcElementDShapes (SegmentInfo & elnr, double xi, Vector & dshapes) const;
167
168
169
class ElementInfo
170
{
171
public:
172
ElementIndex elnr;
173
int order;
174
int nv;
175
int ndof;
176
int nedges;
177
int nfaces;
178
int edgenrs[12];
179
int facenrs[6];
180
Mat<3> hdxdxi;
181
Vec<3> hcoefs[10]; // enough for second order tets
182
};
183
184
185
void CalcElementShapes (ElementInfo & info, const Point<3> & xi, Vector & shapes) const;
186
void GetCoefficients (ElementInfo & info, Vec<3> * coefs) const;
187
void CalcElementDShapes (ElementInfo & info, const Point<3> & xi, MatrixFixWidth<3> & dshapes) const;
188
189
190
class SurfaceElementInfo
191
{
192
public:
193
SurfaceElementIndex elnr;
194
int order;
195
int nv;
196
int ndof;
197
ArrayMem<int,4> edgenrs;
198
int facenr;
199
};
200
201
void CalcElementShapes (SurfaceElementInfo & elinfo, const Point<2> & xi, Vector & shapes) const;
202
void GetCoefficients (SurfaceElementInfo & elinfo, ARRAY<Vec<3> > & coefs) const;
203
void CalcElementDShapes (SurfaceElementInfo & elinfo, const Point<2> & xi, DenseMatrix & dshapes) const;
204
};
205
206
207
208
#endif
209
210