#include <tetra_element_linear.h>
Data Structures | |
struct | tetrahedron_gauss_point |
Public Member Functions | |
tetra_element_linear () | |
scalar * | get_K_alpha_element_mem_loc (int ni, int nj) |
Get the memory location of the specified element of K_alpha. More... | |
void | calculate_K_alpha () |
Calc the diffusion matrix for this element. More... | |
void | construct_element_mass_matrix (MassMatrixQuadratic *M_alpha) |
void | construct_element_mass_matrix (MassMatrixLinear *M_alpha) |
void | add_K_alpha (scalar *K, int num_nodes) |
void | get_grad_phi_at_stu (vector3 &grad_phi, scalar s, scalar t, scalar u) |
Returns the gradient of the potential at the given (s,t,u) position in the element. More... | |
void | calculate_electrostatic_forces () |
Calculates the force on each node of the element due to the electrostatic potential gradient there. More... | |
void | calculate_jacobian (matrix3 J) |
Calculates the Jacobian matrix for this element. More... | |
void | calc_deformation (matrix3 J) |
Calculates Deformation Gradient. More... | |
void | calc_elastic_force_vector (vector12 F) |
Calculate the elastic contribution to the force. More... | |
int | calc_shape_function_derivatives_and_volume (matrix3 J) |
Inverts the given jacobian matrix J, using this to calculate the derivatives of the shape functions which are stored in dpsi. This is an array of all 12 derivatives, in the following order: dpsi = [ d(psi)_1/dx ] [ d(psi)_2/dx ] [ d(psi)_3/dx ] [ d(psi)_4/dx ] [ d(psi)_1/dy ] [ d(psi)_2/dy ] [ ... ] [ d(psi)_4/dz ]. More... | |
void | print_structural_details () |
Prints a variety of structural details about the element to analyse it's configuration. More... | |
scalar | calc_volume () |
Uses above functions to get volume. Easy. More... | |
void | create_viscosity_matrix () |
Builds the viscosity matrix from the shape function derivatives, the shear and bulk viscosity constants, and the element volume. More... | |
void | add_shear_elastic_stress (matrix3 J, matrix3 stress) |
void | add_bulk_elastic_stress (matrix3 stress) |
void | add_bulk_elastic_stress_OLD (matrix3 stress) |
void | add_fluctuating_stress (SimulationParams *params, RngStream rng[], matrix3 stress, int thread_id) |
Given the shape function derivatives, the element volume and a random number generator, this function calculates the fluctuating stress tensor, generating a stochastic change in the nodal velocities for the element under consideration. This function will add its contribution to the given 12-vector du. More... | |
void | apply_stress_tensor (matrix3 stress, vector12 du) |
Applies the given stress tensor to the shape function derivatives to get the contribution to du. More... | |
void | get_element_velocity_vector (vector12 v) |
Sets the given 12-vector to the velocities of this element's four nodes,. More... | |
void | add_element_force_vector (vector12 force) |
Add this element's nodal forces to those given in the force 12-vector. More... | |
void | add_force_to_node (int i, vector3 *f) |
Add given force to the specified node of this element. More... | |
int | what_node_is_this (int index) |
A roundabout and inefficient way of working out what node (from 0 to 9) this index corresponds to. More... | |
void | print () |
void | print_viscosity_matrix () |
void | apply_element_mass_matrix (vector12 du) |
Applies the mass matrix (for a linear tetrahedral element of density rho and equilibrium volume vol_0) to the force vector du to get the correct distribution of force between nodes. More... | |
void | volume_coord_to_xyz (scalar eta0, scalar eta1, scalar eta2, scalar eta3, vector3 *r) |
void | zero_force () |
void | linearise_element () |
void | calc_centroid () |
int | get_opposite_node (int n1, int n2, int n3) |
scalar | length_of_longest_edge () |
Data Fields | |
scalar | rho |
density More... | |
scalar | A |
shear viscosity More... | |
scalar | B |
second coefficient of viscosity More... | |
scalar | G |
shear modulus More... | |
scalar | E |
bulk modulus More... | |
scalar | dielectric |
scalar | mass |
mesh_node * | n [NUM_NODES_QUADRATIC_TET] |
A quadratic tetrahedron has 10 nodes. Keep pointers to the actual memory location of the nodes. More... | |
vector12 | dpsi |
The 12-vector containing the shape function derivatives for this element. More... | |
upper_triangular_matrix4 | del2 |
The del2 matrix for this element (in upper triangular form, since it's symmetric). Used in constructing the diffusion matrix and the poisson matrix. More... | |
PoissonMatrixQuadratic | K_alpha |
vector3 | node_force [NUM_NODES_QUADRATIC_TET] |
Store the contribution from this element to the force on each of its four nodes. More... | |
scalar | vol_0 |
The rest volume of this element. More... | |
scalar | vol |
The current volume of this element. More... | |
matrix3 | F_ij |
The gradient deformation tensor for this element (needed for potential energy calculation) More... | |
scalar | internal_stress_mag |
The double contraction of the internal stress tensor, including elastic and thermal stresses. More... | |
matrix3 | J_inv_0 |
The inverse jacobian of this element at rest. More... | |
matrix12 | viscosity_matrix |
Viscosity Matrix for the internal forces of this element. More... | |
Blob * | daddy_blob |
int | index |
Index of this element in the parent Blob. More... | |
vector3 | centroid |
Private Member Functions | |
void | calc_del2_matrix () |
Creates del2 matrix from the shape function derivatives. More... | |
void | add_diffusion_matrix (matrix12 V) |
Private Attributes | |
scalar | last_det |
The last determinant of this element's transformation (used to work out whether it has inverted itself) More... | |
A 10-point "quadratic" tetrahedron
tetra_element_linear::tetra_element_linear | ( | ) |
void tetra_element_linear::add_bulk_elastic_stress | ( | matrix3 | stress | ) |
Referenced by calc_elastic_force_vector(), and Blob::update_internal_forces().
void tetra_element_linear::add_bulk_elastic_stress_OLD | ( | matrix3 | stress | ) |
|
private |
Referenced by create_viscosity_matrix().
void tetra_element_linear::add_element_force_vector | ( | vector12 | force | ) |
Add this element's nodal forces to those given in the force 12-vector.
Referenced by Blob::update_internal_forces().
void tetra_element_linear::add_fluctuating_stress | ( | SimulationParams * | params, |
RngStream | rng[], | ||
matrix3 | stress, | ||
int | thread_id | ||
) |
Given the shape function derivatives, the element volume and a random number generator, this function calculates the fluctuating stress tensor, generating a stochastic change in the nodal velocities for the element under consideration. This function will add its contribution to the given 12-vector du.
Referenced by Blob::update_internal_forces().
void tetra_element_linear::add_force_to_node | ( | int | i, |
vector3 * | f | ||
) |
Add given force to the specified node of this element.
Referenced by calculate_electrostatic_forces(), PreComp_solver::solve(), PreComp_solver::solve_using_neighbours(), and PreComp_solver::solve_using_neighbours_non_critical().
void tetra_element_linear::add_K_alpha | ( | scalar * | K, |
int | num_nodes | ||
) |
Referenced by calc_elastic_force_vector(), and Blob::update_internal_forces().
void tetra_element_linear::apply_element_mass_matrix | ( | vector12 | du | ) |
Applies the mass matrix (for a linear tetrahedral element of density rho and equilibrium volume vol_0) to the force vector du to get the correct distribution of force between nodes.
Referenced by Blob::make_measurements().
Applies the given stress tensor to the shape function derivatives to get the contribution to du.
Referenced by calc_elastic_force_vector(), and Blob::update_internal_forces().
void tetra_element_linear::calc_centroid | ( | ) |
Referenced by Blob::calc_all_centroids(), and PreComp_solver::init().
void tetra_element_linear::calc_deformation | ( | matrix3 | J | ) |
Calculates Deformation Gradient.
Referenced by Blob::calculate_deformation().
|
private |
Creates del2 matrix from the shape function derivatives.
Referenced by create_viscosity_matrix().
void tetra_element_linear::calc_elastic_force_vector | ( | vector12 | F | ) |
Calculate the elastic contribution to the force.
Referenced by Blob::build_linear_node_elasticity_matrix().
int tetra_element_linear::calc_shape_function_derivatives_and_volume | ( | matrix3 | J | ) |
Inverts the given jacobian matrix J, using this to calculate the derivatives of the shape functions which are stored in dpsi. This is an array of all 12 derivatives, in the following order: dpsi = [ d(psi)_1/dx ] [ d(psi)_2/dx ] [ d(psi)_3/dx ] [ d(psi)_4/dx ] [ d(psi)_1/dy ] [ d(psi)_2/dy ] [ ... ] [ d(psi)_4/dz ].
Function also (as a by-product of the inversion) calculates the volume of the element whose jacobian this is, which is stored in 'vol'.
Referenced by Blob::build_linear_node_viscosity_matrix(), calc_elastic_force_vector(), Blob::calc_rest_state_info(), calc_volume(), and NoMassCGSolver::init().
scalar tetra_element_linear::calc_volume | ( | ) |
Uses above functions to get volume. Easy.
Referenced by Blob::calc_volume(), and print_structural_details().
void tetra_element_linear::calculate_electrostatic_forces | ( | ) |
Calculates the force on each node of the element due to the electrostatic potential gradient there.
Referenced by Blob::update_internal_forces().
void tetra_element_linear::calculate_jacobian | ( | matrix3 | J | ) |
Calculates the Jacobian matrix for this element.
Referenced by Blob::build_linear_node_viscosity_matrix(), calc_elastic_force_vector(), Blob::calc_rest_state_info(), calc_volume(), Blob::calculate_deformation(), Blob::check_inversion(), PreComp_solver::compute_bead_positions(), NoMassCGSolver::init(), PreComp_solver::init(), and Blob::update_internal_forces().
void tetra_element_linear::calculate_K_alpha | ( | ) |
Calc the diffusion matrix for this element.
Referenced by Blob::build_poisson_matrices().
void tetra_element_linear::construct_element_mass_matrix | ( | MassMatrixQuadratic * | M_alpha | ) |
Referenced by Blob::build_linear_node_mass_matrix(), and Blob::build_mass_matrix().
void tetra_element_linear::construct_element_mass_matrix | ( | MassMatrixLinear * | M_alpha | ) |
void tetra_element_linear::create_viscosity_matrix | ( | ) |
Builds the viscosity matrix from the shape function derivatives, the shear and bulk viscosity constants, and the element volume.
Referenced by Blob::build_linear_node_viscosity_matrix(), NoMassCGSolver::init(), and Blob::update_internal_forces().
void tetra_element_linear::get_element_velocity_vector | ( | vector12 | v | ) |
Sets the given 12-vector to the velocities of this element's four nodes,.
Referenced by Blob::make_measurements(), and Blob::update_internal_forces().
Returns the gradient of the potential at the given (s,t,u) position in the element.
Referenced by Face::get_normal_flux().
scalar * tetra_element_linear::get_K_alpha_element_mem_loc | ( | int | ni, |
int | nj | ||
) |
Get the memory location of the specified element of K_alpha.
Referenced by Blob::init().
int tetra_element_linear::get_opposite_node | ( | int | n1, |
int | n2, | ||
int | n3 | ||
) |
Returns the opposite node for a 2nd order face, e. g., returns 3 for face [0,4,5]. The 2nd order nodes were created at setup time, in: FFEA_initialise/FFEA_convert_from_volume/convert_tetrahedra_linear_to_quadratic.py
Referenced by Blob::load_surface().
scalar tetra_element_linear::length_of_longest_edge | ( | ) |
Referenced by Blob::calc_rest_state_info().
void tetra_element_linear::linearise_element | ( | ) |
Referenced by Blob::init(), Blob::linearise_elements(), and Blob::update_positions().
void tetra_element_linear::print | ( | ) |
void tetra_element_linear::print_structural_details | ( | ) |
Prints a variety of structural details about the element to analyse it's configuration.
void tetra_element_linear::print_viscosity_matrix | ( | ) |
void tetra_element_linear::volume_coord_to_xyz | ( | scalar | eta0, |
scalar | eta1, | ||
scalar | eta2, | ||
scalar | eta3, | ||
vector3 * | r | ||
) |
int tetra_element_linear::what_node_is_this | ( | int | index | ) |
A roundabout and inefficient way of working out what node (from 0 to 9) this index corresponds to.
Referenced by Blob::load_surface().
void tetra_element_linear::zero_force | ( | ) |
Referenced by tetra_element_linear(), and Blob::zero_force().
scalar tetra_element_linear::A |
shear viscosity
Referenced by add_diffusion_matrix(), add_fluctuating_stress(), Blob::load_material_params(), and tetra_element_linear().
scalar tetra_element_linear::B |
second coefficient of viscosity
Referenced by add_fluctuating_stress(), Blob::load_material_params(), and tetra_element_linear().
vector3 tetra_element_linear::centroid |
Referenced by calc_centroid(), and PreComp_solver::init().
Blob* tetra_element_linear::daddy_blob |
upper_triangular_matrix4 tetra_element_linear::del2 |
The del2 matrix for this element (in upper triangular form, since it's symmetric). Used in constructing the diffusion matrix and the poisson matrix.
Referenced by add_diffusion_matrix(), and calc_del2_matrix().
scalar tetra_element_linear::dielectric |
Referenced by calculate_K_alpha(), Blob::load_material_params(), and tetra_element_linear().
vector12 tetra_element_linear::dpsi |
The 12-vector containing the shape function derivatives for this element.
Referenced by apply_stress_tensor(), calc_del2_matrix(), and calc_shape_function_derivatives_and_volume().
scalar tetra_element_linear::E |
bulk modulus
Referenced by add_bulk_elastic_stress(), Blob::calculate_strain_energy(), Blob::load_material_params(), Blob::make_measurements(), and tetra_element_linear().
matrix3 tetra_element_linear::F_ij |
The gradient deformation tensor for this element (needed for potential energy calculation)
Referenced by add_shear_elastic_stress(), calc_deformation(), and tetra_element_linear().
scalar tetra_element_linear::G |
shear modulus
Referenced by add_bulk_elastic_stress(), add_shear_elastic_stress(), Blob::calculate_strain_energy(), Blob::load_material_params(), Blob::make_measurements(), and tetra_element_linear().
int tetra_element_linear::index |
Index of this element in the parent Blob.
Referenced by PreComp_solver::init(), Blob::load_topology(), and print_structural_details().
scalar tetra_element_linear::internal_stress_mag |
The double contraction of the internal stress tensor, including elastic and thermal stresses.
Referenced by tetra_element_linear(), and Blob::update_internal_forces().
matrix3 tetra_element_linear::J_inv_0 |
The inverse jacobian of this element at rest.
Referenced by add_shear_elastic_stress(), calc_deformation(), rod::Rod_blob_interface::set_initial_values(), and tetra_element_linear().
PoissonMatrixQuadratic tetra_element_linear::K_alpha |
Referenced by add_K_alpha(), calculate_K_alpha(), and get_K_alpha_element_mem_loc().
|
private |
The last determinant of this element's transformation (used to work out whether it has inverted itself)
Referenced by calc_shape_function_derivatives_and_volume(), and tetra_element_linear().
scalar tetra_element_linear::mass |
Referenced by Blob::calc_rest_state_info(), Blob::get_CoM(), and Blob::make_measurements().
mesh_node* tetra_element_linear::n[NUM_NODES_QUADRATIC_TET] |
A quadratic tetrahedron has 10 nodes. Keep pointers to the actual memory location of the nodes.
Referenced by add_K_alpha(), Blob::build_linear_node_elasticity_matrix(), Blob::build_linear_node_mass_matrix(), Blob::build_linear_node_viscosity_matrix(), Blob::build_mass_matrix(), calc_centroid(), calculate_electrostatic_forces(), calculate_jacobian(), calculate_K_alpha(), Blob::calculate_node_element_connectivity(), PreComp_solver::compute_bead_positions(), ffea_test::connection_energy_3(), ffea_test::connection_test(), construct_element_mass_matrix(), rod::Rod_blob_interface::do_connection_timestep(), Blob::get_CoM(), rod::Rod_blob_interface::get_element_id(), get_element_velocity_vector(), get_grad_phi_at_stu(), MatrixFixedSparsityPattern::init(), MassLumpedSolver::init(), ConjugateGradientSolver::init(), SparseSubstitutionSolver::init(), NoMassCGSolver::init(), PreComp_solver::init(), Blob::init(), length_of_longest_edge(), linearise_element(), Blob::linearise_force(), Blob::load_topology(), Blob::make_measurements(), print(), rod::Rod_blob_interface::Rod_blob_interface(), rod::Rod_blob_interface::set_tet(), tetra_element_linear(), volume_coord_to_xyz(), and what_node_is_this().
vector3 tetra_element_linear::node_force[NUM_NODES_QUADRATIC_TET] |
Store the contribution from this element to the force on each of its four nodes.
Referenced by add_element_force_vector(), add_force_to_node(), Blob::calculate_node_element_connectivity(), print(), and zero_force().
scalar tetra_element_linear::rho |
matrix12 tetra_element_linear::viscosity_matrix |
Viscosity Matrix for the internal forces of this element.
Referenced by Blob::build_linear_node_viscosity_matrix(), create_viscosity_matrix(), NoMassCGSolver::init(), print_viscosity_matrix(), and tetra_element_linear().
scalar tetra_element_linear::vol |
The current volume of this element.
Referenced by add_bulk_elastic_stress(), add_fluctuating_stress(), add_shear_elastic_stress(), apply_stress_tensor(), Blob::calc_rest_state_info(), calc_shape_function_derivatives_and_volume(), calc_volume(), Blob::calculate_strain_energy(), create_viscosity_matrix(), Blob::make_measurements(), print(), and tetra_element_linear().
scalar tetra_element_linear::vol_0 |
The rest volume of this element.
Referenced by add_bulk_elastic_stress(), add_shear_elastic_stress(), apply_element_mass_matrix(), Blob::calc_rest_state_info(), Blob::calculate_strain_energy(), construct_element_mass_matrix(), ConjugateGradientSolver::init(), MassLumpedSolver::init(), SparseSubstitutionSolver::init(), Blob::init(), Blob::make_measurements(), and tetra_element_linear().