-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathV_GaussIntegration.hpp
116 lines (90 loc) · 4.6 KB
/
V_GaussIntegration.hpp
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
/*=========================================================================
Module: V_GaussIntegration.hpp
Copyright 2003,2006,2019 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
Under the terms of Contract DE-NA0003525 with NTESS,
the U.S. Government retains certain rights in this software.
See LICENSE for details.
=========================================================================*/
/*
*
* GaussIntegration.hpp declaration of gauss integration functions
*
* This file is part of VERDICT
*
*/
#ifndef GAUSS_INTEGRATION_HPP
#define GAUSS_INTEGRATION_HPP
#include "verdict.h"
namespace VERDICT_NAMESPACE
{
static constexpr int maxTotalNumberGaussPoints = 27;
static constexpr int maxNumberNodes = 20;
static constexpr int maxNumberGaussPoints = 3;
static constexpr int maxNumberGaussPointsTri = 6;
static constexpr int maxNumberGaussPointsTet = 4;
struct GaussIntegration
{
VERDICT_HOST_DEVICE void get_signs_for_node_local_coord_hex(
int node_id, double& sign_y1, double& sign_y2, double& sign_y3);
//- to get the signs for coordinates of hex nodes in the local computational space
// constructors
VERDICT_HOST_DEVICE void initialize(int n = 2, int m = 4, int dim = 2, int tri = 0);
// manipulators
VERDICT_HOST_DEVICE void get_gauss_pts_and_weight();
//- get gauss point locations and weights
VERDICT_HOST_DEVICE void get_tri_rule_pts_and_weight();
//- get integration points and weights for triangular rules
VERDICT_HOST_DEVICE void calculate_shape_function_2d_tri();
//- calculate the shape functions and derivatives of shape functions
//- at integration points for 2D triangular elements
VERDICT_HOST_DEVICE void calculate_shape_function_2d_quad();
//- calculate the shape functions and derivatives of shape functions
//- at gaussian points for 2D quad elements
VERDICT_HOST_DEVICE void get_shape_func(double shape_function[], double dndy1_at_gauss_pts[],
double dndy2_at_gauss_ptsp[], double gauss_weight[]);
//- get shape functions and the derivatives
VERDICT_HOST_DEVICE void get_shape_func(double shape_function[], double dndy1_at_gauss_pts[],
double dndy2_at_gauss_pts[], double dndy3_at_gauss_pts[], double gauss_weight[]);
//- get shape functions and the derivatives for 3D elements
VERDICT_HOST_DEVICE void calculate_derivative_at_nodes(
double dndy1_at_nodes[][maxNumberNodes], double dndy2_at_nodes[][maxNumberNodes]);
//- calculate shape function derivatives at nodes
VERDICT_HOST_DEVICE void calculate_shape_function_3d_hex();
//- calculate shape functions and derivatives of shape functions
//- at gaussian points for 3D hex elements
VERDICT_HOST_DEVICE void calculate_derivative_at_nodes_3d(double dndy1_at_nodes[][maxNumberNodes],
double dndy2_at_nodes[][maxNumberNodes], double dndy3_at_nodes[][maxNumberNodes]);
//- calculate shape function derivatives at nodes for hex elements
VERDICT_HOST_DEVICE void calculate_derivative_at_nodes_2d_tri(
double dndy1_at_nodes[][maxNumberNodes], double dndy2_at_nodes[][maxNumberNodes]);
//- calculate shape function derivatives at nodes for triangular elements
VERDICT_HOST_DEVICE void calculate_shape_function_3d_tet();
//- calculate shape functions and derivatives of shape functions
//- at integration points for 3D tet elements
VERDICT_HOST_DEVICE void get_tet_rule_pts_and_weight();
//- get integration points and weights for tetrhedron rules
VERDICT_HOST_DEVICE void calculate_derivative_at_nodes_3d_tet(double dndy1_at_nodes[][maxNumberNodes],
double dndy2_at_nodes[][maxNumberNodes], double dndy3_at_nodes[][maxNumberNodes]);
//- calculate shape function derivatives at nodes for tetrahedron elements
VERDICT_HOST_DEVICE void get_node_local_coord_tet(int node_id, double& y1, double& y2, double& y3, double& y4);
//- get nodal volume coordinates for tetrahedron element
int numberGaussPoints;
int numberNodes;
int numberDims;
double gaussPointY[maxNumberGaussPoints];
double gaussWeight[maxNumberGaussPoints];
double shapeFunction[maxTotalNumberGaussPoints][maxNumberNodes];
double dndy1GaussPts[maxTotalNumberGaussPoints][maxNumberNodes];
double dndy2GaussPts[maxTotalNumberGaussPoints][maxNumberNodes];
double dndy3GaussPts[maxTotalNumberGaussPoints][maxNumberNodes];
double totalGaussWeight[maxTotalNumberGaussPoints];
int totalNumberGaussPts;
double y1Area[maxNumberGaussPointsTri];
double y2Area[maxNumberGaussPointsTri];
double y1Volume[maxNumberGaussPointsTet];
double y2Volume[maxNumberGaussPointsTet];
double y3Volume[maxNumberGaussPointsTet];
double y4Volume[maxNumberGaussPointsTet];
};
} // namespace verdict
#endif