tetra_element_linear Class Reference

#include <tetra_element_linear.h>

Data Structures

struct  tetrahedron_gauss_point
 

Public Member Functions

 tetra_element_linear ()
 
scalarget_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_noden [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...
 
Blobdaddy_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...
 

Detailed Description

A 10-point "quadratic" tetrahedron

Constructor & Destructor Documentation

◆ tetra_element_linear()

tetra_element_linear::tetra_element_linear ( )

Member Function Documentation

◆ add_bulk_elastic_stress()

void tetra_element_linear::add_bulk_elastic_stress ( matrix3  stress)

◆ add_bulk_elastic_stress_OLD()

void tetra_element_linear::add_bulk_elastic_stress_OLD ( matrix3  stress)

◆ add_diffusion_matrix()

void tetra_element_linear::add_diffusion_matrix ( matrix12  V)
private

Referenced by create_viscosity_matrix().

◆ add_element_force_vector()

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().

◆ add_fluctuating_stress()

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().

◆ add_force_to_node()

void tetra_element_linear::add_force_to_node ( int  i,
vector3 f 
)

◆ add_K_alpha()

void tetra_element_linear::add_K_alpha ( scalar K,
int  num_nodes 
)

◆ add_shear_elastic_stress()

void tetra_element_linear::add_shear_elastic_stress ( matrix3  J,
matrix3  stress 
)

◆ apply_element_mass_matrix()

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().

◆ apply_stress_tensor()

void tetra_element_linear::apply_stress_tensor ( matrix3  stress,
vector12  du 
)

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().

◆ calc_centroid()

void tetra_element_linear::calc_centroid ( )

◆ calc_deformation()

void tetra_element_linear::calc_deformation ( matrix3  J)

Calculates Deformation Gradient.

Referenced by Blob::calculate_deformation().

◆ calc_del2_matrix()

void tetra_element_linear::calc_del2_matrix ( )
private

Creates del2 matrix from the shape function derivatives.

Referenced by create_viscosity_matrix().

◆ calc_elastic_force_vector()

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().

◆ calc_shape_function_derivatives_and_volume()

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().

◆ calc_volume()

scalar tetra_element_linear::calc_volume ( )

Uses above functions to get volume. Easy.

Referenced by Blob::calc_volume(), and print_structural_details().

◆ calculate_electrostatic_forces()

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().

◆ calculate_jacobian()

◆ calculate_K_alpha()

void tetra_element_linear::calculate_K_alpha ( )

Calc the diffusion matrix for this element.

Referenced by Blob::build_poisson_matrices().

◆ construct_element_mass_matrix() [1/2]

void tetra_element_linear::construct_element_mass_matrix ( MassMatrixQuadratic M_alpha)

◆ construct_element_mass_matrix() [2/2]

void tetra_element_linear::construct_element_mass_matrix ( MassMatrixLinear M_alpha)

◆ create_viscosity_matrix()

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().

◆ get_element_velocity_vector()

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().

◆ get_grad_phi_at_stu()

void tetra_element_linear::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.

Referenced by Face::get_normal_flux().

◆ get_K_alpha_element_mem_loc()

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().

◆ get_opposite_node()

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().

◆ length_of_longest_edge()

scalar tetra_element_linear::length_of_longest_edge ( )

◆ linearise_element()

void tetra_element_linear::linearise_element ( )

◆ print()

void tetra_element_linear::print ( )

◆ print_structural_details()

void tetra_element_linear::print_structural_details ( )

Prints a variety of structural details about the element to analyse it's configuration.

◆ print_viscosity_matrix()

void tetra_element_linear::print_viscosity_matrix ( )

◆ volume_coord_to_xyz()

void tetra_element_linear::volume_coord_to_xyz ( scalar  eta0,
scalar  eta1,
scalar  eta2,
scalar  eta3,
vector3 r 
)

◆ what_node_is_this()

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().

◆ zero_force()

void tetra_element_linear::zero_force ( )

Field Documentation

◆ A

scalar tetra_element_linear::A

◆ B

scalar tetra_element_linear::B

second coefficient of viscosity

Referenced by add_fluctuating_stress(), Blob::load_material_params(), and tetra_element_linear().

◆ centroid

vector3 tetra_element_linear::centroid

◆ daddy_blob

◆ del2

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().

◆ dielectric

scalar tetra_element_linear::dielectric

◆ dpsi

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().

◆ E

◆ F_ij

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().

◆ G

◆ index

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().

◆ internal_stress_mag

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().

◆ J_inv_0

matrix3 tetra_element_linear::J_inv_0

◆ K_alpha

PoissonMatrixQuadratic tetra_element_linear::K_alpha

◆ last_det

scalar tetra_element_linear::last_det
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().

◆ mass

scalar tetra_element_linear::mass

◆ n

◆ node_force

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().

◆ rho

◆ viscosity_matrix

matrix12 tetra_element_linear::viscosity_matrix

◆ vol

◆ vol_0


The documentation for this class was generated from the following files: