WARPXM v1.10.0
Loading...
Searching...
No Matches
wmunstructuredgeometryfunctions.h
Go to the documentation of this file.
1#ifndef WMUNSTRUCTUREDGEOMETRYFUNCTIONS_H_
2#define WMUNSTRUCTUREDGEOMETRYFUNCTIONS_H_
3
4// STL Includes
5#include <cmath>
6
7#include "warpxm/warpxm_config.h"
8
9template<typename T> T sign(T a);
10
11// Unstructured Grids Only -----------------------------
12
13void resetVector(real v[3]);
14
15void vectoralCrossProduct(const real vec1[3], const real vec2[3], real product[3]);
16
17real vectoralDotProduct(const real vec1[3], const real vec2[3]);
18
20
21void vectoralMultiplyByScalar(real vec[3], const real scalar);
22
24
25void vectoralTangentNormalized(const real normal[3], real tangent[3]);
26
27void vectoralTangent(const real vec[3], real tangent[3]);
28
29void vectoralBinormal(const real normal[3], const real tangent[3], real binormal[3]);
30
31void vectoralMatrixMultiply_left(const real M[3][3], const real v[3], real Mv[3]);
32
34 const real n[3],
35 const real angle,
36 real r[3]);
37
38// The following functions are the general form for creating element geometry information
39// from the transform coordinates defined in WmUnstructuredGeometry
40
41real generateElementGeometry_Line(const real tC[2*3], real areas[2], real* norms);
42
43real generateElementGeometry_01_Line(const real tC[2*3], real areas[2], real* norms);
44
45real generateElementGeometry_Triangle(const real tC[3*3], real areas[3], real* norms);
46
48
49real generateElementGeometry_Tetrahedron(const real tC[4*3], real areas[4], real* norms);
50
51real generateElementGeometry_Hexahedron(const real tC[8*3], real* areas, real* norms);
52
53real generateElementGeometry_Point(const real tC[1*3], real areas[1], real* norms);
54
55// This is where we generate and define the transform coordinates
56
57void generateTransformCoordinates_Line(const real nodePositions[], real tC[]);
58
59void generateTransformCoordinates_01_Line(const real nodePositions[], real tC[]);
60
61void generateTransformCoordinates_Triangle(const real nodePositions[], real tC[]);
62
63void generateTransformCoordinates_Quadrilateral(const real nodePositions[], real tC[]);
64
65void generateTransformCoordinates_Tetrahedron(const real nodePositions[], real tC[]);
66
67void generateTransformCoordinates_Hexahedron(const real nodePositions[], real tC[]);
68
69void generateTransformCoordinates_Point(const real nodePositions[], real tC[]);
70
71// These functions transform normalized coordinates to actual coordinates
72
74 const real normalizedPosition[3],
75 real position[3]);
76
78 const real normalizedPosition[3],
79 real position[3]);
80
82 const real normalizedPosition[3],
83 real position[3]);
84
86 const real normalizedPosition[3],
87 real position[3]);
88
90 const real normalizedPosition[3],
91 real position[3]);
92
94 const real normalizedPosition[3],
95 real position[3]);
96
98 const real normalizedPosition[3],
99 real position[3]);
100
101// These functions transform normalized coordinates to element central coordinates (actual
102// coordinates - element centroid)
103
105 const real normalizedPosition[3],
106 real position[3]);
107
109 const real normalizedPosition[3],
110 real position[3]);
111
113 const real normalizedPosition[3],
114 real position[3]);
115
117 const real normalizedPosition[3],
118 real position[3]);
119
121 const real normalizedPosition[3],
122 real position[3]);
123
125 const real normalizedPosition[3],
126 real position[3]);
127
129 const real normalizedPosition[3],
130 real position[3]);
131
132// These functions generate the element centroid from the transform coordinates (very
133// simple for most primitives)
134
135void generateCentroid_Line(const real tC[], real centroid[3]);
136
137void generateCentroid_01_Line(const real tC[], real centroid[3]);
138
139void generateCentroid_Triangle(const real tC[], real centroid[3]);
140
141void generateCentroid_Quadrilateral(const real tC[], real centroid[3]);
142
143void generateCentroid_Tetrahedron(const real tC[], real centroid[3]);
144
145void generateCentroid_Hexahedron(const real tC[], real centroid[3]);
146
147void generateCentroid_Point(const real tC[], real centroid[3]);
148
149// These are volume Jacobians designed to work with WmUnstructuredQuadrature
150
151real generateVolumeJacobian_Line(const real tC[], const real normalizedPosition[3]);
152
153real generateVolumeJacobian_01_Line(const real tC[], const real normalizedPosition[3]);
154
156 const real normalizedPosition[3]);
157
159 const real normalizedPosition[3]);
160
162 const real normalizedPosition[3]);
163
165 const real normalizedPosition[3]);
166
167real generateVolumeJacobian_Point(const real tC[], const real normalizedPosition[3]);
168
170 const real normalizedPosition[3],
171 real jacobian[][3]);
172
174 const real normalizedPosition[3],
175 real jacobian[][3]);
176
178 const real normalizedPosition[3],
179 real jacobian[][3]);
180
182 const real normalizedPosition[3],
183 real jacobian[][3]);
184
186 const real normalizedPosition[3],
187 real jacobian[][3]);
188
190 const real normalizedPosition[3],
191 real jacobian[][3]);
192
194 const real normalizedPosition[3],
195 real jacobian[][3]);
196
197void invertThreeXThreeMatrix(const real a[3][3], real in[3][3]);
198
200 const int fIndex,
201 real f_tC[][3]);
202
204 const int fIndex,
205 real f_tC[][3]);
206
208 const int fIndex,
209 real f_tC[][3]);
210
212 const int fIndex,
213 real f_tC[][3]);
214
216 const int fIndex,
217 real f_tC[][3]);
218
219#endif // WMUNSTRUCTUREDGEOMETRYFUNCTIONS_H_
#define real
Definition: wmoclunstructuredreconstruction.h:11
void generatePositionInElement_Quadrilateral(const real *tC, const real normalizedPosition[3], real position[3])
void generateCentroid_Hexahedron(const real tC[], real centroid[3])
void vectoralCrossProduct(const real vec1[3], const real vec2[3], real product[3])
void generateCentroid_Quadrilateral(const real tC[], real centroid[3])
real generateVolumeJacobian_01_Line(const real tC[], const real normalizedPosition[3])
void generateTransformCoordinates_Hexahedron(const real nodePositions[], real tC[])
void generateCentralPositionInElement_Quadrilateral(const real tC[][3], const real normalizedPosition[3], real position[3])
void generateTransformCoordinates_01_Line(const real nodePositions[], real tC[])
void vectoralTangent(const real vec[3], real tangent[3])
real vectoralNormalize(real vec[3])
void convertFaceTransformCoordinates_Triangle_To_Line(const real v_tC[][3], const int fIndex, real f_tC[][3])
real generateVolumeJacobian_Line(const real tC[], const real normalizedPosition[3])
void generateCentralPositionInElement_Line(const real tC[][3], const real normalizedPosition[3], real position[3])
void resetVector(real v[3])
real generateVolumeJacobian_Triangle(const real tC[], const real normalizedPosition[3])
void generateJacobianMatrix_Line(const real tC[][3], const real normalizedPosition[3], real jacobian[][3])
real generateElementGeometry_01_Line(const real tC[2 *3], real areas[2], real *norms)
void generateJacobianMatrix_Tetrahedron(const real tC[][3], const real normalizedPosition[3], real jacobian[][3])
real generateElementGeometry_Quadrilateral(const real tC[4 *3], real *areas, real *norms)
void generatePositionInElement_Point(const real *tC, const real normalizedPosition[3], real position[3])
T sign(T a)
void invertThreeXThreeMatrix(const real a[3][3], real in[3][3])
void generateJacobianMatrix_Quadrilateral(const real tC[][3], const real normalizedPosition[3], real jacobian[][3])
real generateVolumeJacobian_Point(const real tC[], const real normalizedPosition[3])
real vectoralDotProduct(const real vec1[3], const real vec2[3])
void generateCentralPositionInElement_Point(const real tC[][3], const real normalizedPosition[3], real position[3])
void generatePositionInElement_01_Line(const real *tC, const real normalizedPosition[3], real position[3])
real generateVolumeJacobian_Tetrahedron(const real tC[], const real normalizedPosition[3])
void generatePositionInElement_Line(const real *tC, const real normalizedPosition[3], real position[3])
void generateTransformCoordinates_Triangle(const real nodePositions[], real tC[])
void generateCentralPositionInElement_Hexahedron(const real tC[][3], const real normalizedPosition[3], real position[3])
void generateCentralPositionInElement_Tetrahedron(const real tC[][3], const real normalizedPosition[3], real position[3])
void generateCentroid_Triangle(const real tC[], real centroid[3])
void generatePositionInElement_Hexahedron(const real *tC, const real normalizedPosition[3], real position[3])
void generateJacobianMatrix_Point(const real tC[][3], const real normalizedPosition[3], real jacobian[][3])
void generateJacobianMatrix_01_Line(const real tC[][3], const real normalizedPosition[3], real jacobian[][3])
void vectoralMultiplyByScalar(real vec[3], const real scalar)
real generateElementGeometry_Hexahedron(const real tC[8 *3], real *areas, real *norms)
void generateCentralPositionInElement_Triangle(const real tC[][3], const real normalizedPosition[3], real position[3])
real generateElementGeometry_Point(const real tC[1 *3], real areas[1], real *norms)
void vectoralBinormal(const real normal[3], const real tangent[3], real binormal[3])
void generateCentroid_01_Line(const real tC[], real centroid[3])
void generateJacobianMatrix_Triangle(const real tC[][3], const real normalizedPosition[3], real jacobian[][3])
void generateTransformCoordinates_Quadrilateral(const real nodePositions[], real tC[])
real generateVolumeJacobian_Hexahedron(const real tC[], const real normalizedPosition[3])
void generateCentroid_Line(const real tC[], real centroid[3])
real generateElementGeometry_Triangle(const real tC[3 *3], real areas[3], real *norms)
real generateElementGeometry_Line(const real tC[2 *3], real areas[2], real *norms)
void convertFaceTransformCoordinates_Hexahedron_To_Quadrilateral(const real v_tC[][3], const int fIndex, real f_tC[][3])
void vectoralTangentNormalized(const real normal[3], real tangent[3])
void generateCentralPositionInElement_01_Line(const real tC[][3], const real normalizedPosition[3], real position[3])
void generateTransformCoordinates_Tetrahedron(const real nodePositions[], real tC[])
void vectoralMatrixMultiply_left(const real M[3][3], const real v[3], real Mv[3])
void generatePositionInElement_Tetrahedron(const real *tC, const real normalizedPosition[3], real position[3])
real vectoralMagnitude(const real vec[3])
void convertFaceTransformCoordinates_Line_To_Point(const real v_tC[][3], const int fIndex, real f_tC[][3])
void generateTransformCoordinates_Line(const real nodePositions[], real tC[])
void generateCentroid_Tetrahedron(const real tC[], real centroid[3])
real generateElementGeometry_Tetrahedron(const real tC[4 *3], real areas[4], real *norms)
void generateCentroid_Point(const real tC[], real centroid[3])
void vectoralRotateAroundNormalizedVector(const real v[3], const real n[3], const real angle, real r[3])
void generateJacobianMatrix_Hexahedron(const real tC[][3], const real normalizedPosition[3], real jacobian[][3])
void generateTransformCoordinates_Point(const real nodePositions[], real tC[])
void convertFaceTransformCoordinates_Tetrahedron_To_Triangle(const real v_tC[][3], const int fIndex, real f_tC[][3])
void generatePositionInElement_Triangle(const real *tC, const real normalizedPosition[3], real position[3])
real generateVolumeJacobian_Quadrilateral(const real tC[], const real normalizedPosition[3])
void convertFaceTransformCoordinates_Quadrilateral_To_Line(const real v_tC[][3], const int fIndex, real f_tC[][3])