Face.h
Go to the documentation of this file.
1 //
2 // This file is part of the FFEA simulation package
3 //
4 // Copyright (c) by the Theory and Development FFEA teams,
5 // as they appear in the README.md file.
6 //
7 // FFEA is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by
9 // the Free Software Foundation, either version 3 of the License, or
10 // (at your option) any later version.
11 //
12 // FFEA is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
16 //
17 // You should have received a copy of the GNU General Public License
18 // along with FFEA. If not, see <http://www.gnu.org/licenses/>.
19 //
20 // To help us fund FFEA development, we humbly ask that you cite
21 // the research papers on the package.
22 //
23 
24 #ifndef FACE_H_INCLUDED
25 #define FACE_H_INCLUDED
26 
27 #include <math.h>
28 
29 #include "mesh_node.h"
30 #include "tetra_element_linear.h"
31 #include "SecondOrderFunctions.h"
32 #include "SimulationParams.h"
33 #include "CheckTetrahedraOverlap.h"
34 #include "VolumeIntersection.h"
35 #include "mat_vec_types.h"
36 #include "mat_vec_fns.h"
37 
38 class Face {
39 public:
40  Face();
41 
42  ~Face();
43 
46  mesh_node *n[4];
47 
49  int index;
50 
53 
56 
59 
62 
65 
68 
73 
74 
77 
79  // bool *ssint_bb_interaction_flag; // DEPRECATED
81 
83 
84  int num_blobs;
85  // vector3 *vdw_bb_force; // DEPRECATED
86  // scalar *vdw_bb_energy; // DEPRECATED
87  // vector3 *vdw_xz_force; // DEPRECATED
88  // scalar vdw_xz_energy; // DEPRECATED
90 
97  bool checkTetraIntersection(Face *f2);
98  bool checkTetraIntersection(Face *f2, scalar *blob_corr,int f1_daddy_blob_index,int f2_daddy_blob_index);
99 
106  scalar getTetraIntersectionVolume(Face *f2, scalar *blob_corr,int f1_daddy_blob_index,int f2_daddy_blob_index);
107 
115  scalar checkTetraIntersectionAndGetVolume(Face *f2,scalar *blob_corr,int f1_daddy_blob_index,int f2_daddy_blob_index);
116 
117 
124  void getTetraIntersectionVolumeAndArea(Face *f2, geoscalar &vol, geoscalar &area, scalar *blob_corr,int f1_daddy_blob_index,int f2_daddy_blob_index);
125 
126 
136  bool getTetraIntersectionVolumeTotalGradientAndShapeFunctions(Face *f2, geoscalar dr, grr3 (&dVdr), geoscalar &vol, grr4 (&phi1), grr4 (&phi2));
137  bool getTetraIntersectionVolumeTotalGradientAndShapeFunctions(Face *f2, geoscalar dr, grr3 (&dVdr), geoscalar &vol, grr4 (&phi1), grr4 (&phi2), scalar *blob_corr, int f1_daddy_blob_index, int f2_daddy_blob_index);
138 
139 
141 
142  int init(int index, tetra_element_linear *e, mesh_node *n0, mesh_node *n1, mesh_node *n2, mesh_node *oposite, SecondOrderFunctions::stu centroid_stu, Blob *daddy_blob, SimulationParams *params);
143 
144  int init(int index, mesh_node *n0, mesh_node *n1, mesh_node *n2, mesh_node *opposite, Blob *daddy_blob, SimulationParams *params);
145 
146  void set_ssint_interaction_type(int ssint_interaction_type);
147 
148  int build_opposite_node();
149 
151  void set_kinetic_state(bool state);
152 
153  vector3 * get_centroid();
154  void print_centroid();
155  void print_nodes();
156  scalar get_area();
157 
159  void barycentric_calc_point(scalar b1, scalar b2, scalar b3, vector3 *p);
160  void barycentric_calc_point_f2(scalar b1, scalar b2, scalar b3, vector3 *p,scalar *blob_corr,int f1_daddy_blob_index,int f2_daddy_blob_index);
161 
164 
166 
167  void add_force_to_node(int i, vector3 *f);
168  template <class brr3> void add_force_to_node(int i, brr3 (&f));
169 
170  void add_force_to_node_atomic(int i, vector3 *f);
171 
172  // void add_bb_vdw_force_to_record(vector3 *f, int other_blob_index); // DEPRECATED
173  // template <class brr3> void add_bb_vdw_force_to_record(brr3 &f, int other_blob_index); // DEPRECATED
174 
175  // void add_bb_vdw_energy_to_record(scalar energy, int other_blob_index); // DEPRECATED
176 
177  // void add_xz_vdw_force_to_record(vector3 *f); // DEPRECATED
178 
179  // void add_xz_vdw_energy_to_record(scalar energy); // DEPRECATED
180 
181  void zero_force();
182 
183  // void zero_vdw_bb_measurement_data(); // DEPRECATED
184 
185  // void zero_vdw_xz_measurement_data(); // DEPRECATED
186 
187  void set_ssint_xz_interaction_flag(bool state);
188 
189  // void set_vdw_bb_interaction_flag(bool state, int other_blob_index); // DEPRECATED
190 
191  template <class brr3> void vec3Vec3SubsToArr3Mod(Face *f2, brr3 (&w), scalar *blob_corr,int f1_daddy_blob_index,int f2_daddy_blob_index);
192 
193  bool is_ssint_active();
194  bool is_kinetic_active();
195 
197 
198 private:
199  int stuff;
201 
202 };
203 
204 #endif
Definition: tetra_element_linear.h:136
void set_kinetic_state(bool state)
Definition: Face.cpp:193
scalar area
Definition: Face.h:61
void set_ssint_xz_interaction_flag(bool state)
Definition: Face.cpp:377
void print_centroid()
Definition: Face.cpp:229
Definition: Blob.h:94
int stuff
Definition: Face.h:199
bool is_ssint_active()
Definition: Face.cpp:387
scalar average_phi()
Definition: Face.cpp:280
Blob * daddy_blob
Definition: Face.h:140
void add_force_to_node(int i, vector3 *f)
Definition: Face.cpp:314
void getTetraIntersectionVolumeAndArea(Face *f2, geoscalar &vol, geoscalar &area)
Definition: Face.cpp:429
scalar get_normal_flux()
Definition: Face.cpp:284
void calc_area_normal_centroid()
Definition: Face.cpp:197
SecondOrderFunctions::stu centroid_stu
Definition: Face.h:76
void add_force_to_node_atomic(int i, vector3 *f)
Definition: Face.cpp:320
void vec3Vec3SubsToArr3Mod(Face *f2, brr3(&w), scalar *blob_corr, int f1_daddy_blob_index, int f2_daddy_blob_index)
Definition: Face.cpp:636
scalar length_of_longest_edge()
Definition: Face.cpp:616
double geoscalar
Definition: mat_vec_types.h:37
geoscalar grr3[3]
Definition: mat_vec_types.h:71
geoscalar grr4[4]
Definition: mat_vec_types.h:75
int build_opposite_node()
Definition: Face.cpp:153
tetra_element_linear * e
Definition: Face.h:52
void set_ssint_interaction_type(int ssint_interaction_type)
Definition: Face.cpp:149
int ssint_interaction_type
Definition: Face.h:55
bool ssint_xz_interaction_flag
Definition: Face.h:78
scalar area_0
Definition: Face.h:58
bool checkTetraIntersection(Face *f2)
Definition: Face.cpp:399
bool dealloc_n3
Definition: Face.h:200
int init(int index, tetra_element_linear *e, mesh_node *n0, mesh_node *n1, mesh_node *n2, mesh_node *oposite, SecondOrderFunctions::stu centroid_stu, Blob *daddy_blob, SimulationParams *params)
Definition: Face.cpp:73
bool getTetraIntersectionVolumeTotalGradientAndShapeFunctions(Face *f2, geoscalar dr, grr3(&dVdr), geoscalar &vol, grr4(&phi1), grr4(&phi2))
Definition: Face.cpp:473
void zero_force()
Definition: Face.cpp:352
int index
Definition: Face.h:49
Definition: mesh_node.h:39
int num_blobs
Definition: Face.h:84
void print_nodes()
Definition: Face.cpp:236
bool is_kinetic_active()
Definition: Face.cpp:395
Definition: SimulationParams.h:75
vector3 force[4]
Definition: Face.h:72
bool kinetically_active
Definition: Face.h:80
scalar getTetraIntersectionVolume(Face *f2)
Definition: Face.cpp:406
void barycentric_calc_point_f2(scalar b1, scalar b2, scalar b3, vector3 *p, scalar *blob_corr, int f1_daddy_blob_index, int f2_daddy_blob_index)
Definition: Face.cpp:271
scalar get_area()
Definition: Face.cpp:244
static const int i
index of ith thing
Definition: rod_math_v9.h:63
scalar checkTetraIntersectionAndGetVolume(Face *f2)
Definition: Face.cpp:415
mesh_node * n[4]
Definition: Face.h:46
Face()
Definition: Face.cpp:26
Definition: SecondOrderFunctions.h:53
vector3 * get_centroid()
Definition: Face.cpp:221
Definition: mat_vec_types.h:90
double scalar
Definition: mat_vec_types.h:36
Definition: Face.h:38
void barycentric_calc_point(scalar b1, scalar b2, scalar b3, vector3 *p)
Definition: Face.cpp:265
vector3 normal
Definition: Face.h:64
vector3 centroid
Definition: Face.h:67
~Face()
Definition: Face.cpp:47