rod_math_v9.h File Reference
#include <cmath>
#include <iostream>
#include <assert.h>
#include "dimensions.h"
#include <stdlib.h>
#include <boost/math/special_functions/fpclassify.hpp>

Go to the source code of this file.

Namespaces

 rod
 

Macros

#define OUT
 This is used to denote when a function modifies one of its parameters. More...
 
#define _USE_MATH_DEFINES
 This has to come before including cmath. More...
 
#define OMP_SIMD_INTERNAL   _Pragma("omp simd")
 
#define vec3d(x)   for(int x = 0; x < 3; ++ x)
 Shorthand to loop over elements of our 1d arrays representing 3d vectors. More...
 

Functions

void rod::rod_abort (std::string message)
 
void rod::print_array (std::string array_name, float array[], int length)
 
void rod::print_array (std::string array_name, double array[], int length)
 
void rod::normalize (float in[3], OUT float out[3])
 
void rod::normalize_unsafe (float in[3], OUT float out[3])
 
float rod::absolute (float in[3])
 
void rod::cross_product (float a[3], float b[3], float out[3])
 
void rod::cross_product_unsafe (float a[3], float b[3], float out[3])
 
void rod::get_rotation_matrix (float a[3], float b[3], float rotation_matrix[9])
 
void rod::apply_rotation_matrix (float vec[3], float matrix[9], OUT float rotated_vec[3])
 
void rod::apply_rotation_matrix_row (float vec[3], float matrix[9], OUT float rotated_vec[3])
 
void rod::matmul_3x3_3x3 (float a[9], float b[9], OUT float out[9])
 
void rod::get_p_i (float curr_r[3], float next_r[3], OUT float p_i[3])
 
void rod::rodrigues_rotation (float v[3], float k[3], float theta, OUT float v_rot[3])
 
float rod::safe_cos (float in)
 
float rod::get_l_i (float p_i[3], float p_im1[3])
 
float rod::get_signed_angle (float m1[3], float m2[3], float l[3])
 
void rod::perpendicularize (float m_i[3], float p_i[3], OUT float m_i_prime[3])
 
void rod::update_m1_matrix (float m_i[3], float p_i[3], float p_i_prime[3], float m_i_prime[3])
 
float rod::get_stretch_energy (float k, float p_i[3], float p_i_equil[3])
 
void rod::parallel_transport (float m[3], float m_prime[3], float p_im1[3], float p_i[3])
 
float rod::get_twist_energy (float beta, float m_i[3], float m_im1[3], float m_i_equil[3], float m_im1_equil[3], float p_im1[3], float p_i[3], float p_im1_equil[3], float p_i_equil[3])
 
void rod::get_kb_i (float p_im1[3], float p_i[3], float e_im1_equil[3], float e_i_equil[3], OUT float kb_i[3])
 
void rod::get_omega_j_i (float kb_i[3], float n_j[3], float m_j[3], OUT float omega_j_i[2])
 
float rod::get_bend_energy (float omega_i_im1[2], float omega_i_im1_equil[2], float B_equil[4])
 
float rod::get_bend_energy_from_p (float p_im1[3], float p_i[3], float p_im1_equil[3], float p_i_equil[3], float n_im1[3], float m_im1[3], float n_im1_equil[3], float m_im1_equil[3], float n_i[3], float m_i[3], float n_i_equil[3], float m_i_equil[3], float B_i_equil[4], float B_im1_equil[4])
 
float rod::get_weights (float a[3], float b[3])
 
void rod::get_mutual_element_inverse (float pim1[3], float pi[3], float weight, OUT float mutual_element[3])
 
void rod::get_mutual_axes_inverse (float mim1[3], float mi[3], float weight, OUT float m_mutual[3])
 
float rod::get_bend_energy_mutual_parallel_transport (float p_im1[3], float p_i[3], float p_im1_equil[3], float p_i_equil[3], float n_im1[3], float m_im1[3], float n_im1_equil[3], float m_im1_equil[3], float n_i[3], float m_i[3], float n_i_equil[3], float m_i_equil[3], float B_i_equil[4], float B_im1_equil[4])
 
float rod::get_translational_friction (float viscosity, float radius, bool rotational)
 
float rod::get_rotational_friction (float viscosity, float radius, float length, bool safe)
 
float rod::get_force (float bend_energy, float stretch_energy, float delta_x)
 
float rod::get_torque (float twist_energy, float delta_theta)
 
float rod::get_delta_r (float friction, float timestep, float force, float noise, float external_force)
 
float rod::get_noise (float timestep, float kT, float friction, float random_number)
 
void rod::load_p (float p[4][3], float *r, int offset)
 
void rod::load_m (float m_loaded[4][3], float *m, int offset)
 
void rod::normalize_all (float p[4][3])
 
void rod::absolute_all (float p[4][3], float absolutes[4])
 
void rod::cross_all (float p[4][3], float m[4][3], OUT float n[4][3])
 
void rod::delta_e_all (float p[4][3], float new_p[4][3], OUT float delta_p[4][3])
 
void rod::update_m1_all (float m[4][3], float absolutes[4], float t[4][3], float delta_e[4][3], OUT float m_out[4][3])
 
void rod::update_m1_matrix_all (float m[4][3], float p[4][3], float p_prime[4][3], OUT float m_prime[4][3], int start_cutoff, int end_cutoff)
 
void rod::fix_m1_all (float m[4][3], float new_t[4][3])
 
void rod::update_and_fix_m1_all (float old_e[4][3], float new_e[4][3], float m[4][3])
 
void rod::set_cutoff_values (int e_i_node_no, int length, OUT int start_cutoff, int end_cutoff)
 
bool rod::not_simulation_destroying (float x)
 
bool rod::not_simulation_destroying (float x[3])
 
void rod::load_B_all (float B[4][4], float *B_matrix, int offset)
 
void rod::make_diagonal_B_matrix (float B, OUT float B_matrix[4])
 
void rod::set_cutoff_values (int p_i_node_no, int num_nodes, OUT int *start_cutoff, int *end_cutoff)
 
float rod::get_absolute_length_from_array (float *array, int node_no, int length)
 
void rod::get_centroid_generic (float *r, int length, OUT float centroid[3])
 
void rod::get_perturbation_energy (float perturbation_amount, int perturbation_dimension, float B_equil[4], float *material_params, int start_cutoff, int end_cutoff, int p_i_node_no, float *r_all, float *r_all_equil, float *m_all, float *m_all_equil, float energies[3])
 

Variables

static const bool rod::debug_nan = false
 
const double rod::boltzmann_constant = 1.3806503e-23/mesoDimensions::Energy
 
static const int rod::x = 0
 
static const int rod::y = 1
 
static const int rod::z = 2
 
static const int rod::im2 = 0
 index of i-2nd thing More...
 
static const int rod::im1 = 1
 index of i-1st thing More...
 
static const int rod::i = 2
 index of ith thing More...
 
static const int rod::ip1 = 3
 index of i+1th thing More...
 
static const float rod::rod_software_version = 0.3
 

Macro Definition Documentation

◆ _USE_MATH_DEFINES

#define _USE_MATH_DEFINES

This has to come before including cmath.

◆ OMP_SIMD_INTERNAL

#define OMP_SIMD_INTERNAL   _Pragma("omp simd")

◆ OUT

#define OUT

This is used to denote when a function modifies one of its parameters.

Referenced by rod::get_bend_energy_mutual_parallel_transport(), and rod::Rod_blob_interface::position_rod_from_blob().

◆ vec3d