Advanced Multi-Physics (AMP)
On-Line Documentation
hex8_element_t.h
Go to the documentation of this file.
1#ifndef HEX8_ELEMENT_T
2#define HEX8_ELEMENT_T
3
4#include "AMP/mesh/triangle_t.h"
5
6#include <vector>
7
8double compute_inverse_3_by_3_matrix( double const *mat, double *inv );
10 double const *mat,
11 double const *vec,
12 double *res );
13void compute_stress_tensor( double const *constitutive_matrix,
14 double const *strain_tensor,
15 double *stress_tensor );
16void compute_traction( double const *stress_tensor, double const *normal_vector, double *traction );
17void compute_constitutive_matrix( double const youngs_modulus,
18 double const poissons_ratio,
19 double *constitutive_matrix );
20double compute_von_mises_stress( double const *stress_tensor );
21
23{
24public:
25 explicit hex8_element_t( double const *p );
27 void set_support_points( double const *p );
28 double const *get_support_point( unsigned int i ) const;
29 double const *get_support_points() const;
30 double const *get_bounding_box();
32 double const *get_scaling_factors();
35 bool within_bounding_box( double const *p, double tolerance = 1.0e-12 );
36 bool within_bounding_polyhedron( double const *p, double tolerance = 1.0e-12 );
37 // this the user responsability to call first within_bounding_box(...) and
38 // within_bounding_polyhedron(...)
39 // before trying to map a point so that newton won't fail
40 void map_global_to_local( double const *global_coordinates, double *local_coordinates );
41 void map_local_to_global( double const *local_coordinates, double *global_coordinates );
42 bool contains_point( double const *coordinates,
43 bool coordinates_are_local = false,
44 double tolerance = 1.0e-12 );
45 void project_on_face( unsigned int f,
46 double const *local_coordinates,
47 double *local_coordinates_on_face,
48 double *shift_global_coordinates );
49 void compute_normal_to_face( unsigned int f,
50 double const *local_coordinates,
51 double const *global_coordinates,
52 double *normal_to_face );
53 void compute_normal_to_face( unsigned int face,
54 double const *local_coordinates_on_face,
55 double *normal_vector );
56
57 // static void project_on_face(unsigned int f, double const *local_coordinates, double
58 // *local_coordinates_on_face);
59 static void map_face_to_local( unsigned int face,
60 double const *local_coordinates_on_face,
61 double *local_coordinates );
62 static void map_local_to_face( unsigned int face,
63 double const *local_coordinates,
64 double *local_coordinates_on_face );
65 static void get_basis_functions_values( double const *local_coordinates,
66 double *basis_functions_values );
67 static void get_basis_functions_derivatives( double const *local_coordinates,
69 static void get_basis_functions_values_on_face( double const *local_coordinates_on_face,
70 double *basis_functions_values_on_face );
71 static void get_local_coordinates_on_face( double const *basis_functions_values_on_face,
72 double *local_coordinates_on_face );
73 static void get_normal_to_face( double const **support_points_ptr,
74 double const *local_coordinates_on_face,
75 double *normal_vector );
76 // static void compute_strain_tensor(double const * local_coordinates, double const *
77 // displacement_values, double
78 // * strain_tensor_values);
79 void compute_strain_tensor( double const *local_coordinates,
80 double const *displacement_values,
81 double *strain_tensor_values );
82 void compute_rotation_tensor( double const *local_coordinates,
83 double const *displacement_values,
84 double *rotation_tensor_values );
85 static unsigned int const *get_face( unsigned int i );
86 static unsigned int const *get_faces();
87
88private:
89 // numbering of the 8 support points (or nodes) follows libmesh hex8 convention which is as
90 // follows
91 //
92 // 7 6
93 // o--------o
94 // /: /|
95 // / : / |
96 // 4 / : 5 / |
97 // o--------o |
98 // | o....|...o 2
99 // | .3 | /
100 // | . | /
101 // |. |/
102 // o--------o
103 // 0 1
104 //
105 //
106 // reference frame xyz
107 // z y
108 // | .
109 // | .
110 // |.
111 // o------ x
112 //
113 //
114 // node 0 -> x y z = -1 -1 -1
115 // 1 +1 -1 -1
116 // 2 +1 +1 -1
117 // 3 -1 +1 -1
118 // 4 -1 -1 +1
119 // 5 +1 -1 +1
120 // 6 +1 +1 +1
121 // 7 -1 +1 +1
122 //
123 // numbering of the faces is
124 // face 0 -> at z=-1 supported by nodes 0321
125 // 1 y=-1 0154
126 // 2 x=+1 1265
127 // 3 y=+1 2376
128 // 4 x=-1 3047
129 // 5 z=+1 4567
130 //
131 // std::vector<double> support_points;
132 // std::vector<double> point_candidate;
133 double support_points[24];
135
136 // faces are oriented and defined by their 4 support nodes
137 // 3 2
138 // o--------o
139 // | |
140 // | |
141 // | |
142 // | |
143 // o--------o
144 // 0 1
145 //
146 // coordinates on the face are given in the following xy reference frame
147 //
148 // y
149 // |
150 // |
151 // |
152 // o------ x
153 //
154 static unsigned int faces[24];
155
158 std::vector<double> scaling_factors;
161 std::vector<double> translation_vector;
162
165
166 std::vector<double> bounding_box;
167 std::vector<triangle_t *> bounding_polyhedron;
168 std::vector<triangle_t *> tmp_triangles_ptr;
169 void clear_triangles_ptr( std::vector<triangle_t *> &triangles_ptr );
170
176
178 std::vector<double> residual_vector;
179 std::vector<double> jacobian_matrix;
180 std::vector<double> inverse_jacobian_matrix;
182 std::vector<double> basis_functions_values;
183 std::vector<double> basis_functions_derivatives;
184
190 // residual vector f = (sum_i x_i b_i, sum_i y_i b_i, sum_i z_i b_i)^t - (x, y, z)^t
191 // where the x_i y_i z_i, i=0...7, are the coordinates of the support points and the b_i are
192 // basis functions
193 void compute_residual_vector( double const *x, double *f );
194 // jacobian matrix J_ij = df_i / dj
195 void compute_jacobian_matrix( double const *x, double *J );
196 void compute_initial_guess( double *x );
197 // map the coordinates of the point candidate onto the reference frame of the volume element
198 // defined by the support
199 // points
200 double solve_newton( double *x,
201 double abs_tol = 1.0e-14,
202 double rel_tol = 1.0e-14,
203 unsigned int max_iter = 100,
204 bool verbose = false );
205};
206
207#endif // HEX8_ELEMENT_T
std::vector< double > center_of_element_global_coordinates
static unsigned int const * get_faces()
static void get_basis_functions_derivatives(double const *local_coordinates, double *basis_functions_derivatives)
void map_global_to_local(double const *global_coordinates, double *local_coordinates)
triangle_t ** get_bounding_polyhedron()
void compute_strain_tensor(double const *local_coordinates, double const *displacement_values, double *strain_tensor_values)
static void map_face_to_local(unsigned int face, double const *local_coordinates_on_face, double *local_coordinates)
bool within_bounding_polyhedron(double const *p, double tolerance=1.0e-12)
double const * get_bounding_box()
static void get_normal_to_face(double const **support_points_ptr, double const *local_coordinates_on_face, double *normal_vector)
std::vector< double > residual_vector
bool support_points_translated
void build_bounding_polyhedron()
bool contains_point(double const *coordinates, bool coordinates_are_local=false, double tolerance=1.0e-12)
bool within_bounding_box(double const *p, double tolerance=1.0e-12)
static void map_local_to_face(unsigned int face, double const *local_coordinates, double *local_coordinates_on_face)
hex8_element_t(double const *p)
void compute_center_of_element_data()
double const * get_support_point(unsigned int i) const
bool memory_allocated_for_newton
double point_candidate[3]
void compute_translation_vector()
std::vector< triangle_t * > tmp_triangles_ptr
std::vector< double > bounding_box
std::vector< double > center_of_element_local_coordinates
void set_support_points(double const *p)
static void get_basis_functions_values_on_face(double const *local_coordinates_on_face, double *basis_functions_values_on_face)
double const * get_scaling_factors()
void unscale_support_points()
double const * get_support_points() const
void map_local_to_global(double const *local_coordinates, double *global_coordinates)
void compute_initial_guess(double *x)
std::vector< double > translation_vector
void compute_normal_to_face(unsigned int face, double const *local_coordinates_on_face, double *normal_vector)
void compute_rotation_tensor(double const *local_coordinates, double const *displacement_values, double *rotation_tensor_values)
static void get_basis_functions_values(double const *local_coordinates, double *basis_functions_values)
std::vector< double > jacobian_matrix
void clear_triangles_ptr(std::vector< triangle_t * > &triangles_ptr)
void compute_scaling_factors()
void compute_residual_vector(double const *x, double *f)
std::vector< double > inverse_jacobian_matrix_times_residual_vector
std::vector< double > inverse_jacobian_matrix_at_center_of_element
void compute_normal_to_face(unsigned int f, double const *local_coordinates, double const *global_coordinates, double *normal_to_face)
void compute_jacobian_matrix(double const *x, double *J)
bool translation_vector_updated
static unsigned int const * get_face(unsigned int i)
void build_bounding_box()
static unsigned int faces[24]
std::vector< double > inverse_jacobian_matrix
void project_on_face(unsigned int f, double const *local_coordinates, double *local_coordinates_on_face, double *shift_global_coordinates)
bool center_of_element_data_updated
double solve_newton(double *x, double abs_tol=1.0e-14, double rel_tol=1.0e-14, unsigned int max_iter=100, bool verbose=false)
void scale_support_points()
bool bounding_polyhedron_updated
std::vector< double > scaling_factors
std::vector< double > jacobian_matrix_at_center_of_element
std::vector< triangle_t * > bounding_polyhedron
static void get_local_coordinates_on_face(double const *basis_functions_values_on_face, double *local_coordinates_on_face)
std::vector< double > basis_functions_derivatives
double support_points[24]
std::vector< double > basis_functions_values
double compute_inverse_3_by_3_matrix(double const *mat, double *inv)
void compute_traction(double const *stress_tensor, double const *normal_vector, double *traction)
void compute_n_by_n_matrix_times_vector(unsigned int n, double const *mat, double const *vec, double *res)
void compute_constitutive_matrix(double const youngs_modulus, double const poissons_ratio, double *constitutive_matrix)
double compute_von_mises_stress(double const *stress_tensor)
void compute_stress_tensor(double const *constitutive_matrix, double const *strain_tensor, double *stress_tensor)



Advanced Multi-Physics (AMP)
Oak Ridge National Laboratory
Idaho National Laboratory
Los Alamos National Laboratory
This page automatically produced from the
source code by doxygen
Last updated: Tue Mar 10 2026 13:06:40.
Comments on this page