b2api
B2000++ API Reference Manual, VERSION 4.6
 
Loading...
Searching...
No Matches
b2000 Namespace Reference

Contains the base classes for implementing Finite Elements. More...

Namespaces

namespace  cmdline
 
namespace  logging
 
namespace  path
 

Classes

class  AlaNonlinearSolver
 
class  Allocator
 
class  AttributeList
 
class  auto_ptr_array
 
struct  b2Mutex
 A dummy mutex for serial exeuction. More...
 
struct  b2spin_rw_mutex
 A dummy rw mutex for serial exeuction. More...
 
class  BushingMaterial
 
class  Case
 
class  CaseList
 
class  cli
 Class to describe the command line interface for b2000. More...
 
class  ComputeOverlayingSurfaceMeshes
 
class  ContactMechanics
 
class  DataBase
 The object associated with the B2000++ database. More...
 
class  DBSlice
 
class  DegreesOfFreedom
 
class  Dictionary
 
class  Domain
 
class  Element
 Defines the complete interface for Element instances (C++ representations of Finite Elements). More...
 
class  ElementCFD3DField
 
class  ElementCFDHeat2DFieldL2Constant
 
class  ElementProperty
 
struct  EquilibriumSolution
 
class  EssentialBoundaryCondition
 
class  Exception
 
class  Field
 
class  FortranElementProperty
 
class  GenericException
 
class  GradientContainer
 
class  HeatMaterial
 
class  HeatMaterial2D
 
class  HeatMaterial3D
 
class  InitialCondition
 
class  LooseCoupling
 
struct  MemcomTypeName
 
class  Model
 
class  ModelReductionBoundaryCondition
 
class  MultiRegionCoupling
 Implements multi-region fluid-structure coupling. More...
 
class  NaturalBoundaryCondition
 
class  NBC_FSI
 
class  Node
 
class  Object
 
class  ObjectType
 
class  ObjectTypeComplete
 
class  ObjectTypeIncomplete
 
struct  Point
 
class  RData
 
class  ReissnerBeamElasticCProperty
 
class  ReissnerBeamElasticIProperty
 
class  RightStretchTensor_3_3
 
class  RTable
 
class  SetName
 MemCom dataset names according to the B2000++ conventions. More...
 
class  Sha1NonlinearSolver
 
class  Sha2NonlinearSolver
 
class  SolidMechanics
 The base class of the material API for use by stress elements. More...
 
class  SolidMechanics25D
 
class  SolidMechanics2D
 
class  SolidMechanics3D
 
class  SolidMechanicsRod
 The base class of the material API for rod elements. More...
 
class  Solution
 
class  Solver
 A Solver instance executes an FE analysis. It is created and initialized by the Model instance and, using the Model, it obtains the Domain, IntialCondition, BoundaryCondition, etc. objects appropriate for the specified load case. More...
 
class  SolverHints
 
class  StringList
 
class  SuperElement
 
class  SuperElementProperty
 
class  Timing
 
class  Transformation3D
 
class  TypedElement
 
class  TypedEssentialBoundaryCondition
 
class  TypedInitialCondition
 
class  TypedModelReductionBoundaryCondition
 
class  TypedNaturalBoundaryCondition
 
class  VolumeSplineCoupling
 

Typedefs

typedef GenericException< UnimplementedError_name > UnimplementedError
 
typedef GenericException< KeyError_name > KeyError
 
typedef GenericException< TypeError_name > TypeError
 
typedef GenericException< ValueError_name > ValueError
 
typedef GenericException< IOError_name > IOError
 
typedef GenericException< DBError_name > DBError
 
typedef GenericException< SizeError_name > SizeError
 
typedef GenericException< SystemError_name > LoggingError
 
typedef GenericException< PythonError_name > PythonError
 
using timer_map_t = std::map< std::string, Timing >
 A global map of timers to hold all the timings in the application.
 
typedef double coor_type
 

Functions

void make_reduction (b2linalg::Matrix< double, b2linalg::Mcompressed_col > &trans_linear_master_slave, b2linalg::Index &inv_index, b2linalg::Matrix< double, b2linalg::Mcompressed_col > &constant_linear_master_slave)
 
template<typename T = uint64_t>
void find_coinciding_points (const double delta, const bool delta_relative, const size_t n, const double *coor, std::vector< size_t > &coincide)
 
template<typename T = uint64_t>
void find_coinciding_points (const double delta, const bool delta_relative, const size_t n, const double *coor, std::vector< std::pair< size_t, size_t > > &coincide)
 
template<typename TP >
void euler_angles_to_rotation_matrix (const TP e[3], TP rotator[3][3])
 
template<typename TP >
void rotator_to_euler_angle (const TP rotator[3][3], TP e[3])
 
void get_central_coefficient (int l, int z, int p, std::vector< double > &a)
 
void get_forward_coefficient (int l, int z, int p, std::vector< double > &a)
 
template<typename FUNCTION , typename T , typename T1 >
void central_numerical_differentiation (FUNCTION &f, const double x, std::vector< T > &res, int derivative_order=1, int approximation_order=2, int first_nonzero_derivative_order=0, double h=0)
 
template<typename FUNCTION , typename T , typename T1 >
void forward_numerical_differentiation (FUNCTION &f, const double x, std::vector< T > &res, int derivative_order=1, int approximation_order=2, int first_nonzero_derivative_order=0, double h=0)
 
void polar_decomposition (const double F[3][3], double R[3][3], double U[3][3])
 
void svd_3_3 (const double A[3][3], double U[3][3], double S[3], double V[3][3])
 
template<typename T >
determinant_3x3 (const std::array< std::array< T, 3 >, 3 > &mat_a)
 
template<typename T >
determinant_2x2 (const std::array< std::array< T, 2 >, 2 > &mat_a)
 
template<typename T >
invert_3x3 (const std::array< std::array< T, 3 >, 3 > &mat_a, std::array< std::array< T, 3 >, 3 > &mat_b)
 
template<typename T >
invert_2x2 (const std::array< std::array< T, 2 >, 2 > &mat_a, std::array< std::array< T, 2 >, 2 > &mat_b)
 
template<typename T >
std::array< T, 2 > eigenvalues_2 (const std::array< std::array< T, 2 >, 2 > &matrix)
 
template<typename T >
void eigenvector_2 (const std::array< std::array< T, 2 >, 2 > &matrix, std::array< T, 2 > &eigenvalues, std::array< std::array< T, 2 >, 2 > &eigenvector)
 
template<typename T1 >
void set_zero_3 (T1 a[3])
 
template<typename T1 >
void set_zero_2 (T1 a[2])
 
template<typename T1 >
void copy_3 (const T1 a[3], T1 b[3])
 
template<typename T1 , typename T2 >
void copy_3 (const T1 a[3], T2 b[3])
 
template<typename T1 >
void copy_2 (const T1 a[2], T1 b[2])
 
template<typename T1 , typename T2 >
void copy_2 (const T1 a[2], T2 b[2])
 
template<typename T1 , typename T2 , typename T3 >
void sub_3 (const T1 v1[3], const T2 v2[3], T3 dest[3])
 
template<typename T1 , typename T2 , typename T3 >
void sub_2 (const T1 v1[2], const T2 v2[2], T3 dest[2])
 
template<typename T1 , typename T2 , typename T3 >
void add_3 (const T1 v1[3], const T2 v2[3], T3 dest[3])
 
template<typename T1 , typename T2 , typename T3 >
void add_2 (const T1 v1[2], const T2 v2[2], T3 dest[2])
 
template<typename T1 , typename T2 , typename T3 , typename T4 , typename T5 >
void add_scale_3 (const T1 s1, const T2 v1[3], const T3 s2, const T4 v2[3], T5 dest[3])
 
template<typename T1 , typename T2 , typename T3 , typename T4 , typename T5 >
void add_scale_2 (const T1 s1, const T2 v1[2], const T3 s2, const T4 v2[2], T5 dest[2])
 
template<typename T1 , typename T2 >
void scale_3 (T1 v[3], const T2 s)
 
template<typename T1 , typename T2 >
void scale_2 (T1 v[2], const T2 s)
 
template<typename T1 , typename T2 >
void add_3 (T1 a[3], const T2 b[3])
 
template<typename T1 , typename T2 >
void add_2 (T1 a[2], const T2 b[2])
 
template<typename T1 , typename T2 , typename T3 >
void add_scale_3 (T1 a[3], const T2 s, const T3 b[3])
 
template<typename T1 , typename T2 , typename T3 >
void add_scale_2 (T1 a[2], const T2 s, const T3 b[2])
 
template<typename T >
dot_3 (const T a[3], const T b[3])
 
template<typename T >
std::complex< T > dot_3 (const std::complex< T > a[3], const std::complex< T > b[3])
 
template<typename T >
b2000::csda< T > dot_3 (const b2000::csda< T > a[3], const b2000::csda< T > b[3])
 
template<typename T >
dot_2 (const T a[2], const T b[2])
 
template<typename T >
std::complex< T > dot_2 (const std::complex< T > a[2], const std::complex< T > b[2])
 
template<typename T >
b2000::csda< T > dot_2 (const b2000::csda< T > a[2], const b2000::csda< T > b[2])
 
template<typename T >
norm_3 (T a[3])
 
template<typename T >
norm_3 (std::complex< T > a[3])
 
template<typename T >
norm_2 (T a[2])
 
template<typename T >
norm_2 (std::complex< T > a[2])
 
template<typename T1 , typename T2 , typename T3 >
void outer_product_3 (const T1 a[3], const T2 b[3], T3 c[3])
 
template<typename T1 , typename T2 , typename T3 >
void outer_product_add_3 (const T1 a[3], const T2 b[3], T3 c[3])
 
template<typename T >
norm_outer_product_3 (const T a[3], const T b[3])
 
template<typename T >
normalise_3 (T a[3])
 
template<typename T >
normalise_3 (std::complex< T > a[3])
 
template<typename T >
b2000::csda< T > normalise_3 (b2000::csda< T > a[3])
 
template<typename T >
normalise_2 (T a[2])
 
template<typename T >
normalise_2 (std::complex< T > a[2])
 
template<typename T >
b2000::csda< T > normalise_2 (b2000::csda< T > a[2])
 
template<typename T1 >
void set_zero_3_3 (T1 a[3][3])
 
template<typename T1 >
void set_zero_2_2 (T1 a[2][2])
 
template<typename T1 >
void set_identity_3_3 (T1 a[3][3])
 
template<typename T1 >
void set_identity_2_2 (T1 a[2][2])
 
template<typename T1 >
void copy_3_3 (const T1 a[3][3], T1 b[3][3])
 
template<typename T1 , typename T2 >
void copy_3_3 (const T1 a[3][3], T2 b[3][3])
 
template<typename T1 >
void copy_2_2 (const T1 a[2][2], T1 b[2][2])
 
template<typename T1 , typename T2 >
void copy_2_2 (const T1 a[2][2], T2 b[2][2])
 
template<typename T >
void scale_3_3 (const T a, const T b[3][3], T c[3][3])
 
template<typename T >
void scale_2_2 (const T a, const T b[2][2], T c[2][2])
 
template<typename T1 , typename T2 >
void add_3_3 (T1 a[3][3], const T2 b[3][3])
 
template<typename T1 , typename T2 >
void add_2_2 (T1 a[2][2], const T2 b[2][2])
 
template<typename T >
void add_scale_3_3 (const T a, const T b[3][3], T c[3][3])
 
template<typename T >
void add_scale_2_2 (const T a, const T b[2][2], T c[2][2])
 
template<typename T1 >
void transpose_3_3 (T1 a[3][3])
 
template<typename T1 >
void transpose_2_2 (T1 a[2][2])
 
template<typename T1 >
void transpose_3_3 (const T1 a[3][3], T1 b[3][3])
 
template<typename T1 >
void transpose_2_2 (const T1 a[2][2], T1 b[2][2])
 
template<typename T1 >
T1 norm_inf_3_3 (const T1 a[3][3])
 
template<typename T1 >
T1 norm_inf_2_2 (const T1 a[3][3])
 
template<typename T >
determinant_3_3 (const T a[3][3])
 
template<typename T >
determinant_2_2 (const T a[2][2])
 
template<typename T >
invert_3_3 (const T a[3][3], T b[3][3])
 
template<typename T >
invert_2_2 (const T a[2][2], T b[2][2])
 
template<typename T >
invert_x_x (const T a[2][2], T b[2][2])
 
template<typename T >
invert_x_x (const T a[3][3], T b[3][3])
 
template<typename T >
transposed_invert_3_3 (const T a[3][3], T b[3][3])
 
template<typename T >
transposed_invert_2_2 (const T a[2][2], T b[2][2])
 
template<typename T >
void inner_product_3_3_NN (const T a[3][3], const T b[3][3], T c[3][3])
 
template<typename T >
void inner_product_3_3_TN (const T a[3][3], const T b[3][3], T c[3][3])
 
template<typename T >
void inner_product_2_2_NN (const T a[2][2], const T b[2][2], T c[2][2])
 
template<typename T >
void inner_product_3_3_NT (const T a[3][3], const T b[3][3], T c[3][3])
 
template<typename T >
void inner_product_2_2_NT (const T a[2][2], const T b[2][2], T c[2][2])
 
template<typename T >
void inner_product_3_3_TT (const T a[3][3], const T b[3][3], T c[3][3])
 
template<typename T >
void inner_product_2_2_TT (const T a[2][2], const T b[2][2], T c[2][2])
 
template<typename T >
void inner_product_2_1_NN (const T a[2][2], const T b[2], T c[2])
 
template<typename T >
void inner_product_2_1_TN (const T a[2][2], const T b[2], T c[2])
 
template<typename T >
void inner_product_add_3_3_NN (const T a[3][3], const T b[3][3], T c[3][3])
 
template<typename T >
void inner_product_add_2_2_NN (const T a[2][2], const T b[2][2], T c[2][2])
 
template<typename T >
void inner_product_add_3_3_TN (const T a[3][3], const T b[3][3], T c[3][3])
 
template<typename T >
void inner_product_add_2_2_TN (const T a[2][2], const T b[2][2], T c[2][2])
 
template<typename T >
void inner_product_add_3_3_NT (const T a[3][3], const T b[3][3], T c[3][3])
 
template<typename T >
void inner_product_add_2_2_NT (const T a[2][2], const T b[2][2], T c[2][2])
 
template<typename T >
void inner_product_2_2_TN (const T a[2][2], const T b[2][2], T c[2][2])
 
template<typename T >
void inner_product_add_3_3_TT (const T a[3][3], const T b[3][3], T c[3][3])
 
template<typename T >
void inner_product_add_2_2_TT (const T a[2][2], const T b[2][2], T c[2][2])
 
template<typename T >
void inner_product_3_1_NN (const T a[3][3], const T b[3], T c[3])
 
template<typename T >
void inner_product_3_1_TN (const T a[3][3], const T b[3], T c[3])
 
template<typename T >
void inner_product_add_3_1_NN (const T a[3][3], const T b[3], T c[3])
 
template<typename T >
void inner_product_add_3_1_TN (const T a[3][3], const T b[3], T c[3])
 
template<typename T >
bool solve_2_2 (const T a[2][2], const T y[2], T x[2])
 
template<typename T >
void eigenvector_2 (const T m[2][2], T value[2], T vector[2][2]=0)
 
template<typename T >
void stress_invariants (const T t[6], T &i1, T &i2, T &i3)
 
template<typename T >
void stress_principals (const T i1, const T i2, const T i3, T &s1, T &s2, T &s3)
 Calculate the stress principals from the stress invariants.
 
template<typename T >
void get_cartesian_base (const T base[3][3], T cartesian_base[3][3])
 
template<typename Loop , typename... Args>
void b2RunPossiblyParallel (size_t begin, size_t end, Args &&... args)
 Execute given loop, if compiled with TBB this execution is parallel.
 
template<typename Loop , typename Args >
void b2runRecursively (size_t tree_node, size_t sublevel, Args &args, b2Mutex &mutex)
 Recursively run the given tree of recursive tasks, if compiled without TBB it's simply a loop.
 
void print_timers (std::string filename)
 
std::string timing_fn (std::string logdir, int rank)
 Construct a filename for timer output.
 
timer_map_t::iterator obtain_timer (std::string name)
 
template<typename T >
void solve_cubic_equation (const T a, const T b, const T c, const T d, int &nsol, T &x1, T &x2, T &x3)
 
double get_2d_plane_stress_compressible_mooney_rivlin_stress (const double C1, const double C2, const double k, const double green_lagrange_strain[3], double pk2_stress[3], double d_stress_d_strain[6])
 
double get_2d_plane_strain_compressible_mooney_rivlin_stress (const double C1, const double C2, const double k, const double green_lagrange_strain[3], double pk2_stress[3], double d_stress_d_strain[6])
 
void get_3d_compressible_mooney_rivlin_stress (const double C1, const double C2, const double k, const double green_lagrange_strain[6], double pk2_stress[6], double d_stress_d_strain[21])
 
double get_2d_plane_stress_generalised_blatz_ko_stress (const double mu, const double nu, const double f, const double green_lagrange_strain[3], double pk2_stress[3], double d_stress_d_strain[6], double &lambda3_old)
 
double get_2d_plane_strain_generalised_blatz_ko_stress (const double mu, const double nu, const double f, const double green_lagrange_strain[3], double pk2_stress[3], double d_stress_d_strain[6])
 
void get_3d_generalised_blatz_ko_stress (const double mu, const double nu, const double f, const double green_lagrange_strain[6], double pk2_stress[6], double d_stress_d_strain[21])
 

Variables

timer_map_t timers {}
 

Detailed Description

Contains the base classes for implementing Finite Elements.

The B2000++ namespace.

Note
From which class to derive:

Element implementations should derive one of the following classes:

  • b2000::TypedElement<double> for real-valued elements.
  • b2000::TypedElement<b2000::csda<double>> for csda-valued elements.
  • b2000::TypedElement<std::complex<double>> for complex-valued elements.
Note
Which functions to override:

The functions to override are defined in the base class b2000::Element.

Routines for transformation of second-order tensors and fourth-order tensors in computational solid mechanics. Storage format for tensors: Second-order tensors are strain and stress tensors. Strain tensors are 1d-arrays. For 3D analysis the sequence is [E_11, E_22, E_33, 2E_12, 2E_23, 2E_13], and [E_11, E_22, 2E_12] for 2D analysis. Stress tensors are 1d-arrays as well, the sequence is for 3D analysis [S_11, S_22, S_33, S_12, S_23, S_13] and [S_11, S_22, S_12] for 2D analysis. The difference between the transformation routines for strains and stresses is that in a strain tensor the off-diagonal components are multiplied by two. Fourth-order tensors are constitutive tensors and are stored as lower-packed column-major matrices (exploiting the three symmetries), thus an array of size 21 and 6 for 3D and 2D analysis, respectively. Unsymmmetric constitutive tensors are not supported. Basis: Tensors that shall be transformed from one basis to another must be expressed either in a covariant, contravariant, or cartesian basis. Mixed variance is not supported. Storage format for base vectors: The base vectors are 3x3 and 2x2 matrices that must be row-major format (this is different from the routines in b2tensor_calculus.H where 2x2 and 3x3 matrices are assumed to be in column-major format). Naming convention for the transformation routines: transform_strain_from_base_A_to_base_B means that a strain tensor that is expressed in base A is transformed such that it is expressed in base B. If the base with opposite variance ("ov") is available to the caller (e.g. contravariant instead of covariant), then transform_strain_from_base_A_ov_to_base_B can be called with that base instead. For a cartesian base both routines are equivalent but the "ov" routine is slightly faster and less prone to round-off errors. Often, the origin or the destination base is the global (cartesian) reference frame, in this case one can use "I" (for the identity matrix) instead of "A" or "B".

Typedef Documentation

◆ coor_type

typedef double b2000::coor_type

The coordinate type

◆ DBError

typedef GenericException<DBError_name> b2000::DBError

Indicates an error with database I/O.

◆ IOError

typedef GenericException<IOError_name> b2000::IOError

Indicates an error with file I/O.

◆ KeyError

typedef GenericException<KeyError_name> b2000::KeyError

Indicates that a key or unique name or identifier was not found.

◆ LoggingError

typedef GenericException<SystemError_name> b2000::LoggingError

Used by the logging facility.

◆ PythonError

typedef GenericException<PythonError_name> b2000::PythonError

Indicates that execution of Python code has raised a Python exception. Used by specialized implementations of Element, ElementProperty, BoundaryCondition, Solver, etc. that execute Python code.

◆ SizeError

typedef GenericException<SizeError_name> b2000::SizeError

Indicates that an object (e.g. an array or vector) has the wrong size or length.

◆ TypeError

typedef GenericException<TypeError_name> b2000::TypeError

Indicates that an object of the wrong type was given.

◆ UnimplementedError

typedef GenericException<UnimplementedError_name> b2000::UnimplementedError

Indicates that functionality has not been implemented to fulfill the desired function.

◆ ValueError

typedef GenericException<ValueError_name> b2000::ValueError

Indicates that an invalid value was given.

Function Documentation

◆ add_2() [1/2]

template<typename T1 , typename T2 , typename T3 >
void b2000::add_2 ( const T1  v1[2],
const T2  v2[2],
T3  dest[2] 
)
inline

Compute dest = v1 + v2, with dest, v1, and v2 vectors of length 2.

◆ add_2() [2/2]

template<typename T1 , typename T2 >
void b2000::add_2 ( T1  a[2],
const T2  b[2] 
)
inline

Compute a += b, with a and b vectors of length 2.

◆ add_2_2()

template<typename T1 , typename T2 >
void b2000::add_2_2 ( T1  a[2][2],
const T2  b[2][2] 
)
inline

Compute a += b, with a and b 2x2 matrices.

◆ add_3() [1/2]

template<typename T1 , typename T2 , typename T3 >
void b2000::add_3 ( const T1  v1[3],
const T2  v2[3],
T3  dest[3] 
)
inline

Compute dest = v1 + v2, with dest, v1, and v2 vectors of length 3.

◆ add_3() [2/2]

template<typename T1 , typename T2 >
void b2000::add_3 ( T1  a[3],
const T2  b[3] 
)
inline

Compute a += b, with a and b vectors of length 3.

◆ add_3_3()

template<typename T1 , typename T2 >
void b2000::add_3_3 ( T1  a[3][3],
const T2  b[3][3] 
)
inline

Compute a += b, with a and b 3x3 matrices.

◆ add_scale_2() [1/2]

template<typename T1 , typename T2 , typename T3 , typename T4 , typename T5 >
void b2000::add_scale_2 ( const T1  s1,
const T2  v1[2],
const T3  s2,
const T4  v2[2],
T5  dest[2] 
)
inline

Compute dest = s1 * v1 + s2 * v2, with dest, v1, and v2 vectors of length 2.

◆ add_scale_2() [2/2]

template<typename T1 , typename T2 , typename T3 >
void b2000::add_scale_2 ( T1  a[2],
const T2  s,
const T3  b[2] 
)
inline

Compute a += s * b, with a and b vectors of length 3.

◆ add_scale_2_2()

template<typename T >
void b2000::add_scale_2_2 ( const T  a,
const T  b[2][2],
c[2][2] 
)
inline

Compute c += a * b, with a and b 2x2 matrices.

◆ add_scale_3() [1/2]

template<typename T1 , typename T2 , typename T3 , typename T4 , typename T5 >
void b2000::add_scale_3 ( const T1  s1,
const T2  v1[3],
const T3  s2,
const T4  v2[3],
T5  dest[3] 
)
inline

Compute dest = s1 * v1 + s2 * v2, with dest, v1, and v2 vectors of length 3.

◆ add_scale_3() [2/2]

template<typename T1 , typename T2 , typename T3 >
void b2000::add_scale_3 ( T1  a[3],
const T2  s,
const T3  b[3] 
)
inline

Compute a += s * b, with a and b vectors of length 3.

◆ add_scale_3_3()

template<typename T >
void b2000::add_scale_3_3 ( const T  a,
const T  b[3][3],
c[3][3] 
)
inline

Compute c += a * b, with a and b 3x3 matrices.

◆ b2RunPossiblyParallel()

template<typename Loop , typename... Args>
void b2000::b2RunPossiblyParallel ( size_t  begin,
size_t  end,
Args &&...  args 
)

Execute given loop, if compiled with TBB this execution is parallel.

Template Parameters
LoopThe functor b2000::ElementTaskLoop implementing the loop.
...ArgsThis is a struct containing arguments required for the first loop parameter. Additionally, it might contain a b2Mutex so as to make the assembly process thread-safe.
Parameters
beginIndex to first element of the range.
endIndex to last element of the range.
...argsThe parameters associated with the parameter pack.

◆ b2runRecursively()

template<typename Loop , typename Args >
void b2000::b2runRecursively ( size_t  tree_node,
size_t  sublevel,
Args &  args,
b2Mutex mutex 
)

Recursively run the given tree of recursive tasks, if compiled without TBB it's simply a loop.

Template Parameters
LoopThe functor b2000::ElementTaskLoop implementing the loop.
ArgsThis should be struct Args but is implicitly derived by the compiler when b2runRecursively() is called (CTAD).
Parameters
tree_nodeThis is the index representing the root of the tree (e.g. 0 for the root of the tree).
sublevelThis is generally the height of the tree.
argsThis is a struct containing the arguments for the Loop.
mutexA b2Mutex object for thread-safe execution of each task.

◆ central_numerical_differentiation()

template<typename FUNCTION , typename T , typename T1 >
void b2000::central_numerical_differentiation ( FUNCTION &  f,
const double  x,
std::vector< T > &  res,
int  derivative_order = 1,
int  approximation_order = 2,
int  first_nonzero_derivative_order = 0,
double  h = 0 
)

Compute the approximation of the k-tk to l-tk derivatives of a 1d function using central difference schemas.

Parameters
ffunction object of the function to differentiate
xthe value at witch the derivative must be computed
resthe array of derivatives computed
derivative_orderthe k-tk to l-tk derivatives is computed with k=derivative_order and l = k + res.size()
approximation_orderthe required approximation for the k-tk derivative
first_nonzero_derivative_orderof f
hthe step size

◆ copy_2() [1/2]

template<typename T1 >
void b2000::copy_2 ( const T1  a[2],
T1  b[2] 
)
inline

Copy vector a into vector b.

◆ copy_2() [2/2]

template<typename T1 , typename T2 >
void b2000::copy_2 ( const T1  a[2],
T2  b[2] 
)
inline

Copy vector a into vector b of different type.

◆ copy_2_2() [1/2]

template<typename T1 >
void b2000::copy_2_2 ( const T1  a[2][2],
T1  b[2][2] 
)
inline

Copy the contents of matrix a to matrix b.

◆ copy_2_2() [2/2]

template<typename T1 , typename T2 >
void b2000::copy_2_2 ( const T1  a[2][2],
T2  b[2][2] 
)
inline

Copy the contents of matrix a to matrix b of different type.

◆ copy_3() [1/2]

template<typename T1 >
void b2000::copy_3 ( const T1  a[3],
T1  b[3] 
)
inline

Copy vector a into vector b.

◆ copy_3() [2/2]

template<typename T1 , typename T2 >
void b2000::copy_3 ( const T1  a[3],
T2  b[3] 
)
inline

Copy vector a into vector b of different type.

◆ copy_3_3() [1/2]

template<typename T1 >
void b2000::copy_3_3 ( const T1  a[3][3],
T1  b[3][3] 
)
inline

Copy the contents of matrix a to matrix b.

◆ copy_3_3() [2/2]

template<typename T1 , typename T2 >
void b2000::copy_3_3 ( const T1  a[3][3],
T2  b[3][3] 
)
inline

Copy the contents of matrix a to matrix b of different type.

◆ determinant_2_2()

template<typename T >
T b2000::determinant_2_2 ( const T  a[2][2])
inline

Compute the determinant of a 2x2 matrix.

Parameters
aThe matrix arranged in column-major format (input).
Returns
The determinant.

◆ determinant_2x2()

template<typename T >
T b2000::determinant_2x2 ( const std::array< std::array< T, 2 >, 2 > &  mat_a)
inline

Compute the determinant of a 2x2 matrix.

Parameters
[in]mat_aThe matrix arranged in column-major format.
Returns
The determinant of mat_a.

◆ determinant_3_3()

template<typename T >
T b2000::determinant_3_3 ( const T  a[3][3])
inline

Compute the determinant of a 3x3 matrix.

Parameters
aThe matrix arranged in column-major format (input).
Returns
The determinant.

◆ determinant_3x3()

template<typename T >
T b2000::determinant_3x3 ( const std::array< std::array< T, 3 >, 3 > &  mat_a)
inline

Compute the determinant of a 3x3 matrix.

Parameters
[in]mat_aThe matrix arranged in column-major format.
Returns
The determinant of mat_a.

◆ dot_2() [1/3]

template<typename T >
b2000::csda< T > b2000::dot_2 ( const b2000::csda< T >  a[2],
const b2000::csda< T >  b[2] 
)
inline
Returns
The scalar product of two csda vectors of length 2.

◆ dot_2() [2/3]

template<typename T >
std::complex< T > b2000::dot_2 ( const std::complex< T >  a[2],
const std::complex< T >  b[2] 
)
inline
Returns
The scalar product of two complex vectors of length 2.

◆ dot_2() [3/3]

template<typename T >
T b2000::dot_2 ( const T  a[2],
const T  b[2] 
)
inline
Returns
The scalar product of two real vectors of length 2.

◆ dot_3() [1/3]

template<typename T >
b2000::csda< T > b2000::dot_3 ( const b2000::csda< T >  a[3],
const b2000::csda< T >  b[3] 
)
inline
Returns
The scalar product of two csda vectors of length 3.

◆ dot_3() [2/3]

template<typename T >
std::complex< T > b2000::dot_3 ( const std::complex< T >  a[3],
const std::complex< T >  b[3] 
)
inline
Returns
The scalar product of two complex vectors of length 3.

◆ dot_3() [3/3]

template<typename T >
T b2000::dot_3 ( const T  a[3],
const T  b[3] 
)
inline
Returns
The scalar product of two real vectors of length 3.

◆ eigenvalues_2()

template<typename T >
std::array< T, 2 > b2000::eigenvalues_2 ( const std::array< std::array< T, 2 >, 2 > &  matrix)
inline

Compute the eigenvalues of a 2x2 matrix.

Parameters
[in]matrixThe 2x2 input matrix arranged in column-major format.
Returns
The eigenvalues of input matrix.
Exceptions
FE_INVALIDexception if matrix holds double values and the discriminant < -4096 * std::numeric_limits<T>::epsilon().

◆ eigenvector_2() [1/2]

template<typename T >
void b2000::eigenvector_2 ( const std::array< std::array< T, 2 >, 2 > &  matrix,
std::array< T, 2 > &  eigenvalues,
std::array< std::array< T, 2 >, 2 > &  eigenvector 
)
inline

Compute the eigenvalues and eigenvectors of a 2x2 matrix.

Parameters
[in]matrixThe 2x2 input matrix arranged in column-major format (input).
[out]eigenvaluesThe eigenvalues of input matrix.
[out]eigenvectorThe eigenvectors arranged in column-major format.

◆ eigenvector_2() [2/2]

template<typename T >
void b2000::eigenvector_2 ( const T  m[2][2],
value[2],
vector[2][2] = 0 
)
inline

Compute the eigenvalues and eigenvectors of a 2x2 matrix.

Parameters
mThe 2x2 input matrix arranged in column-major format (input).
valueThe eigenvalues (output).
vectorThe eigenvectors arranged in column-major format.

◆ euler_angles_to_rotation_matrix()

template<typename TP >
void b2000::euler_angles_to_rotation_matrix ( const TP  e[3],
TP  rotator[3][3] 
)
inline

Conversion from Euler angles (XYZ) to rotation matrix

Parameters
ethe Euler angles
rotatorthe rotation matrix

◆ find_coinciding_points() [1/2]

template<typename T = uint64_t>
void b2000::find_coinciding_points ( const double  delta,
const bool  delta_relative,
const size_t  n,
const double *  coor,
std::vector< size_t > &  coincide 
)
inline

Detect coinciding or nearly-coinciding points, based on a distance criterion. The computational complexity is O(n * log(n)). On 64bit architectures, (8 + 3 * sizeof(T)) * n bytes are allocated temporarily.

Transitive relations are resolved, i.e. there is no point that is marked as coinciding with another point which in turn as marked as coinciding with yet another point. When m points coincide, the one with the lowest index will not be marked as coinciding, but the remaining m - 1 nodes will be marked as coinciding with that node.

Parameters
deltaMaximum distance between a pair of points that will be marked as coinciding. Must be > 0.
delta_relativeSpecifies whether the maximum distance is relative to the maximum size of the axis-aligned bounding box. In this case, the axis-aligned bounding box is calculated from the supplied coordinates.
nThe number of points.
coorA 3 * n array containing the point coordinates in x/y/z direction.
coincideOn exit, contains n elements with point indices in the half-open interval [0..n). If coincide[i] == i, this means that the point i is not marked as coinciding (but other points may be marked to coincide with point i). If coincide[i] < i, the point i is marked to coincide with the point identified by coincide[i].

◆ find_coinciding_points() [2/2]

template<typename T = uint64_t>
void b2000::find_coinciding_points ( const double  delta,
const bool  delta_relative,
const size_t  n,
const double *  coor,
std::vector< std::pair< size_t, size_t > > &  coincide 
)
inline

Detect coinciding or nearly-coinciding points, based on a distance criterion. The computational complexity is O(n * log(n)). On 64bit architectures, (8 + 3 * sizeof(T)) * n bytes are allocated temporarily.

Transitive relations are resolved, i.e. there is no point that is marked as coinciding with another point which in turn as marked as coinciding with yet another point. When m points coincide, the one with the lowest index will not be marked as coinciding, but the remaining m - 1 nodes will be marked as coinciding with that node.

Parameters
deltaMaximum distance between a pair of points that will be marked as coinciding. Must be > 0.
delta_relativeSpecifies whether the maximum distance is relative to the maximum size of the axis-aligned bounding box. In this case, the axis-aligned bounding box is calculated from the supplied coordinates.
nThe number of points.
A3 * n array containing the point coordinates in x/y/z direction.
coincideOn exit, contains a sorted vector of size n. Each element is a pair of two indices i and j, both indices in the half-open interval [0..n). If i == j, this means that the point j is not marked as coinciding (but other points may be marked to coincide with point i). If i < j, point j is marked to coincide with point i.

◆ forward_numerical_differentiation()

template<typename FUNCTION , typename T , typename T1 >
void b2000::forward_numerical_differentiation ( FUNCTION &  f,
const double  x,
std::vector< T > &  res,
int  derivative_order = 1,
int  approximation_order = 2,
int  first_nonzero_derivative_order = 0,
double  h = 0 
)

Compute the approximation of the k-tk to l-tk derivatives of a 1d function using forward difference schemas.

Parameters
ffunction object of the function to differentiate
xthe value at witch the derivative must be computed
resthe array of derivatives computed
derivative_orderthe k-tk to l-tk derivatives is computed with k=derivative_order and l = k + res.size()
approximation_orderthe required approximation for the k-tk derivative
first_nonzero_derivative_orderof f
hthe step size

◆ get_2d_plane_strain_compressible_mooney_rivlin_stress()

double b2000::get_2d_plane_strain_compressible_mooney_rivlin_stress ( const double  C1,
const double  C2,
const double  k,
const double  green_lagrange_strain[3],
double  pk2_stress[3],
double  d_stress_d_strain[6] 
)

Calculate the 2. Piola-Kirchhoff stresses for the compressible Mooney-Rivlin constitutive model for 2D continuum elements assuming the plane-strain hypothesis. The tangent d_stress_d_strain is only required for solving, while the stresses pk2_stress may also be computed for postprocessing. You may pass nullptr for pk2_stress and/or d_stress_d_strain.

Parameters
[in]C1the first material parameter
[in]C2the second material parameter
[in]kthe third material parameter (bulk modulus)
[in]green_lagrange_strainthe components of the Green-Lagrange strain tensor (2D)
[out]pk2_stressthe components of the 2. PK stress tensor (2D), or nullptr if input pk2_stress is nullptr
[out]d_stress_d_strainthe components of the material tangent (2D), or nullptr if input d_stress_d_strain is nullptr
Returns
the normal stress component S_33 of the 2nd Piola-Kirchhoff stress tensor.

◆ get_2d_plane_strain_generalised_blatz_ko_stress()

double b2000::get_2d_plane_strain_generalised_blatz_ko_stress ( const double  mu,
const double  nu,
const double  f,
const double  green_lagrange_strain[3],
double  pk2_stress[3],
double  d_stress_d_strain[6] 
)

Calculate the 2. Piola-Kirchhoff stresses for the compressible Blatz and Ko constitutive model for 2D continuum elements assuming the plane-strain hypothesis. The tangent d_stress_d_strain is only required for solving, while the stresses pk2_stress may also be computed for postprocessing. You may pass nullptr for pk2_stress and/or d_stress_d_strain.

Parameters
[in]muthe first material parameter (shear modulus)
[in]nuthe second material parameter (Poisson's ratio)
[in]fthe third material parameter (bulk modulus)
[in]green_lagrange_strainthe components of the Green-Lagrange strain tensor (2D)
[out]pk2_stressthe components of the 2. PK stress tensor (2D), or nullptr if input pk2_stress is nullptr
[out]d_stress_d_strainthe components of the material tangent (2D), or nullptr if input d_stress_d_strain is nullptr
Returns
the normal stress component S_33 of the 2nd Piola-Kirchhoff stress tensor.

◆ get_2d_plane_stress_compressible_mooney_rivlin_stress()

double b2000::get_2d_plane_stress_compressible_mooney_rivlin_stress ( const double  C1,
const double  C2,
const double  k,
const double  green_lagrange_strain[3],
double  pk2_stress[3],
double  d_stress_d_strain[6] 
)

Calculate the 2. Piola-Kirchhoff stresses for the compressible Mooney-Rivlin constitutive model for 2D continuum elements assuming the plane-stress hypothesis. The tangent d_stress_d_strain is only required for solving, while the stresses pk2_stress may also be computed for postprocessing. You may pass nullptr for pk2_stress and/or d_stress_d_strain.

Parameters
[in]C1the first material parameter
[in]C2the second material parameter
[in]kthe third material parameter (bulk modulus)
[in]green_lagrange_strainthe components of the Green-Lagrange strain tensor (2D)
[out]pk2_stressthe components of the 2. PK stress tensor (2D), or nullptr if input pk2_stress is nullptr
[out]d_stress_d_strainthe components of the material tangent (2D), or nullptr if input d_stress_d_strain is nullptr
Returns
the transverse component E_33 of the Green-Lagrange strain tensor.

◆ get_2d_plane_stress_generalised_blatz_ko_stress()

double b2000::get_2d_plane_stress_generalised_blatz_ko_stress ( const double  mu,
const double  nu,
const double  f,
const double  green_lagrange_strain[3],
double  pk2_stress[3],
double  d_stress_d_strain[6],
double &  lambda3_old 
)

Calculate the 2. Piola-Kirchhoff stresses for the compressible Blatz and Ko constitutive model for 2D continuum elements assuming the plane-stress hypothesis. The tangent d_stress_d_strain is only required for solving, while the stresses pk2_stress may also be computed for postprocessing. You may pass nullptr for pk2_stress and/or d_stress_d_strain.

Parameters
[in]muthe first material parameter (shear modulues)
[in]nuthe second material parameter (Poisson's ratio)
[in]fthe third material parameter (bulk modulus)
[in]green_lagrange_strainthe components of the Green-Lagrange strain tensor (2D)
[out]pk2_stressthe components of the 2. PK stress tensor (2D), or nullptr if input pk2_stress is nullptr
[out]d_stress_d_strainthe components of the material tangent (2D), or nullptr if input d_stress_d_strain is nullptr
[in,out]lambda3_oldtransverse deformation stored as history data
Returns
the transverse component E_33 of the Green-Lagrange strain tensor.

◆ get_3d_compressible_mooney_rivlin_stress()

void b2000::get_3d_compressible_mooney_rivlin_stress ( const double  C1,
const double  C2,
const double  k,
const double  green_lagrange_strain[6],
double  pk2_stress[6],
double  d_stress_d_strain[21] 
)

Calculate the 2. Piola-Kirchhoff stresses for the compressible Mooney-Rivlin constitutive model for 3D continuum elements. The tangent d_stress_d_strain is only required for solving, while the stresses pk2_stress may also be computed for postprocessing. You may pass nullptr for pk2_stress and/or d_stress_d_strain.

Parameters
[in]C1the first material parameter
[in]C2the second material parameter
[in]kthe third material parameter (bulk modulus)
[in]green_lagrange_strainthe components of the Green-Lagrange strain tensor (3D)
[out]pk2_stressthe components of the 2. PK stress tensor (2D), or nullptr if input pk2_stress is nullptr
[out]d_stress_d_strainthe components of the material tangent (2D), or nullptr if input d_stress_d_strain is nullptr

◆ get_3d_generalised_blatz_ko_stress()

void b2000::get_3d_generalised_blatz_ko_stress ( const double  mu,
const double  nu,
const double  f,
const double  green_lagrange_strain[6],
double  pk2_stress[6],
double  d_stress_d_strain[21] 
)

Calculate the 2. Piola-Kirchhoff stresses for the compressible Blatz and Ko constitutive model for 3D continuum elements. The tangent d_stress_d_strain is only required for solving, while the stresses pk2_stress may also be computed for postprocessing. You may pass nullptr for pk2_stress and/or d_stress_d_strain.

Parameters
[in]muthe first material parameter (shear modulus)
[in]nuthe second material parameter (Poisson's ratio)
[in]fthe third material parameter (bulk modulus)
[in]green_lagrange_strainthe components of the Green-Lagrange strain tensor (3D)
[out]pk2_stressthe components of the 2. PK stress tensor (3D), or nullptr if input pk2_stress is nullptr
[out]d_stress_d_strainthe components of the material tangent (3D), or nullptr if input d_stress_d_strain is nullptr

◆ get_cartesian_base()

template<typename T >
void b2000::get_cartesian_base ( const T  base[3][3],
cartesian_base[3][3] 
)
inline

Calculate a cartesian base whose first vector is aligned with the first covariant base vector.

If r, s and t is the covariant natural base vectors, and x, y and z is the orthogonal aligned base vector, then: z is orthogonal to r and s x is aligned to r y is orthogonal to x and z angle is in degree.

◆ get_central_coefficient()

void b2000::get_central_coefficient ( int  l,
int  z,
int  p,
std::vector< double > &  a 
)

Return the coefficients for a central difference schemas

Parameters
lderivative order
zfirst nonzero derivative
papproximation order
aarray of coefficient

◆ get_forward_coefficient()

void b2000::get_forward_coefficient ( int  l,
int  z,
int  p,
std::vector< double > &  a 
)

Return the coefficients for a forward difference schemas

Parameters
lderivative order
zfirst nonzero derivative
papproximation order
aarray of coefficient

◆ inner_product_2_1_NN()

template<typename T >
void b2000::inner_product_2_1_NN ( const T  a[2][2],
const T  b[2],
c[2] 
)
inline

Compute the inner product c = a * b, with a being a 2x2 matrix arranged in column-major format, and b and c vectors of length

◆ inner_product_2_1_TN()

template<typename T >
void b2000::inner_product_2_1_TN ( const T  a[2][2],
const T  b[2],
c[2] 
)
inline

Compute the inner product c = a^T * b, with a being a 2x2 matrix arranged in column-major format, and b and c vectors of length

◆ inner_product_2_2_NN()

template<typename T >
void b2000::inner_product_2_2_NN ( const T  a[2][2],
const T  b[2][2],
c[2][2] 
)
inline

Compute the inner product c = a * b, with a, b, and c 2x2 matrices arranged in column-major format.

◆ inner_product_2_2_NT()

template<typename T >
void b2000::inner_product_2_2_NT ( const T  a[2][2],
const T  b[2][2],
c[2][2] 
)
inline

Compute the inner product c = a * b^T, with a, b, and c 2x2 matrices arranged in column-major format.

◆ inner_product_2_2_TN()

template<typename T >
void b2000::inner_product_2_2_TN ( const T  a[2][2],
const T  b[2][2],
c[2][2] 
)
inline

Compute the inner product c = a^T * b, with a, b, and c 2x2 matrices arranged in column-major format.

◆ inner_product_2_2_TT()

template<typename T >
void b2000::inner_product_2_2_TT ( const T  a[2][2],
const T  b[2][2],
c[2][2] 
)
inline

Compute the inner product c = a^T * b^T, with a, b, and c 2x2 matrices arranged in column-major format.

◆ inner_product_3_1_NN()

template<typename T >
void b2000::inner_product_3_1_NN ( const T  a[3][3],
const T  b[3],
c[3] 
)
inline

Compute the inner product c = a * b, with a being a 3x3 matrix arranged in column-major format, and b and c vectors of length

◆ inner_product_3_1_TN()

template<typename T >
void b2000::inner_product_3_1_TN ( const T  a[3][3],
const T  b[3],
c[3] 
)
inline

Compute the inner product c = a^T * b, with a being a 3x3 matrix arranged in column-major format, and b and c vectors of length

◆ inner_product_3_3_NN()

template<typename T >
void b2000::inner_product_3_3_NN ( const T  a[3][3],
const T  b[3][3],
c[3][3] 
)
inline

Compute the inner product c = a * b, with a, b, and c 3x3 matrices arranged in column-major format.

◆ inner_product_3_3_NT()

template<typename T >
void b2000::inner_product_3_3_NT ( const T  a[3][3],
const T  b[3][3],
c[3][3] 
)
inline

Compute the inner product c = a * b^T, with a, b, and c 3x3 matrices arranged in column-major format.

◆ inner_product_3_3_TN()

template<typename T >
void b2000::inner_product_3_3_TN ( const T  a[3][3],
const T  b[3][3],
c[3][3] 
)
inline

Compute the inner product c = a^T * b, with a, b, and c 3x3 matrices arranged in column-major format.

◆ inner_product_3_3_TT()

template<typename T >
void b2000::inner_product_3_3_TT ( const T  a[3][3],
const T  b[3][3],
c[3][3] 
)
inline

Compute the inner product c = a^T * b^T, with a, b, and c 3x3 matrices arranged in column-major format.

◆ inner_product_add_2_2_NN()

template<typename T >
void b2000::inner_product_add_2_2_NN ( const T  a[2][2],
const T  b[2][2],
c[2][2] 
)
inline

Add the inner product c += a * b, with a, b, and c 2x2 matrices arranged in column-major format.

◆ inner_product_add_2_2_NT()

template<typename T >
void b2000::inner_product_add_2_2_NT ( const T  a[2][2],
const T  b[2][2],
c[2][2] 
)
inline

Compute the inner product c = a * b^T, with a, b, and c 2x2 matrices arranged in column-major format.

◆ inner_product_add_2_2_TN()

template<typename T >
void b2000::inner_product_add_2_2_TN ( const T  a[2][2],
const T  b[2][2],
c[2][2] 
)
inline

Add the inner product c += a^T * b, with a, b, and c 2x2 matrices arranged in column-major format.

◆ inner_product_add_2_2_TT()

template<typename T >
void b2000::inner_product_add_2_2_TT ( const T  a[2][2],
const T  b[2][2],
c[2][2] 
)
inline

Add the inner product c += a^T * b^T, with a, b, and c 2x2 matrices arranged in column-major format.

◆ inner_product_add_3_1_NN()

template<typename T >
void b2000::inner_product_add_3_1_NN ( const T  a[3][3],
const T  b[3],
c[3] 
)
inline

Add the inner product c += a * b, with a being a 3x3 matrix arranged in column-major format, and b and c vectors of length

◆ inner_product_add_3_1_TN()

template<typename T >
void b2000::inner_product_add_3_1_TN ( const T  a[3][3],
const T  b[3],
c[3] 
)
inline

Add the inner product c += a^T * b, with a being a 3x3 matrix arranged in column-major format, and b and c vector of length 3.

◆ inner_product_add_3_3_NN()

template<typename T >
void b2000::inner_product_add_3_3_NN ( const T  a[3][3],
const T  b[3][3],
c[3][3] 
)
inline

Add the inner product c += a * b, with a, b, and c 3x3 matrices arranged in column-major format.

◆ inner_product_add_3_3_NT()

template<typename T >
void b2000::inner_product_add_3_3_NT ( const T  a[3][3],
const T  b[3][3],
c[3][3] 
)
inline

Add the inner product c += a * b^T, with a, b, and c 3x3 matrices arranged in column-major format.

◆ inner_product_add_3_3_TN()

template<typename T >
void b2000::inner_product_add_3_3_TN ( const T  a[3][3],
const T  b[3][3],
c[3][3] 
)
inline

Add the inner product c += a^T * b, with a, b, and c 3x3 matrices arranged in column-major format.

◆ inner_product_add_3_3_TT()

template<typename T >
void b2000::inner_product_add_3_3_TT ( const T  a[3][3],
const T  b[3][3],
c[3][3] 
)
inline

Add the inner product c += a^T * b^T, with a, b, and c 3x3 matrices arranged in column-major format.

◆ invert_2_2()

template<typename T >
T b2000::invert_2_2 ( const T  a[2][2],
b[2][2] 
)
inline

Invert a 2x2 matrix.

Parameters
aThe input matrix arranged in column-major format (input).
bIf the determinant of the input matrix is non-zero, contains the inverted matrix arranged in column-major format (output).
Returns
The determinant of the input matrix.

◆ invert_2x2()

template<typename T >
T b2000::invert_2x2 ( const std::array< std::array< T, 2 >, 2 > &  mat_a,
std::array< std::array< T, 2 >, 2 > &  mat_b 
)
inline

Invert a 2x2 matrix.

Parameters
[in]mat_aThe input matrix arranged in column-major format.
[out]mat_bIf the determinant of the input matrix is non-zero, contains the inverted matrix arranged in column-major format, otherwise the zero matrix.
Returns
The determinant of the input matrix.

◆ invert_3_3()

template<typename T >
T b2000::invert_3_3 ( const T  a[3][3],
b[3][3] 
)
inline

Invert a 3x3 matrix.

Parameters
aThe input matrix arranged in column-major format (input).
bIf the determinant of the input matrix is non-zero, contains the inverted matrix arranged in column-major format (output).
Returns
The determinant of the input matrix.

◆ invert_3x3()

template<typename T >
T b2000::invert_3x3 ( const std::array< std::array< T, 3 >, 3 > &  mat_a,
std::array< std::array< T, 3 >, 3 > &  mat_b 
)
inline

Invert a 3x3 matrix.

Parameters
[in]mat_aThe input matrix arranged in column-major format.
[out]mat_bIf the determinant of the input matrix is non-zero, contains the inverted matrix arranged in column-major format, otherwise the zero matrix.
Returns
The determinant of mat_a.

◆ invert_x_x() [1/2]

template<typename T >
T b2000::invert_x_x ( const T  a[2][2],
b[2][2] 
)
inline

Invert a matrix.

◆ invert_x_x() [2/2]

template<typename T >
T b2000::invert_x_x ( const T  a[3][3],
b[3][3] 
)
inline

Invert a matrix.

◆ make_reduction()

void b2000::make_reduction ( b2linalg::Matrix< double, b2linalg::Mcompressed_col > &  trans_linear_master_slave,
b2linalg::Index &  inv_index,
b2linalg::Matrix< double, b2linalg::Mcompressed_col > &  constant_linear_master_slave 
)

Calculate the reduction matrix and the right-hand side from linear constraints and their right-hand side.

Parameters
trans_linear_master_slaveOn input: A sparse matrix containing on the coefficients of the constraint equations. Each column represents an equation. The number of rows is equal to the total number of dof. On output: The reduction matrix. The number of rows corresponds to the number of non-eliminated dof and the number of columns equals the total number of dof.
constant_linear_master_slaveOn input: A sparse matrix containing the constant values for each constraint equation. The number of rows equals the number of constraint equations. The number of columns can be arbitrary. On output: The reduced constant values. The number of rows equals the total number of dof, the number of columns is unchanged.

◆ norm_2() [1/2]

template<typename T >
T b2000::norm_2 ( std::complex< T >  a[2])
inline

Euclidean norm of a complex or csda 2 vector.

◆ norm_2() [2/2]

template<typename T >
T b2000::norm_2 ( a[2])
inline

Euclidean norm of a 2 vector.

◆ norm_3() [1/2]

template<typename T >
T b2000::norm_3 ( std::complex< T >  a[3])
inline

Euclidean norm of a complex or csda 3 vector.

◆ norm_3() [2/2]

template<typename T >
T b2000::norm_3 ( a[3])
inline

Euclidean norm of a 3 vector.

◆ norm_inf_2_2()

template<typename T1 >
T1 b2000::norm_inf_2_2 ( const T1  a[3][3])
inline

Infinite norm of a 2x2 matrix.

◆ norm_inf_3_3()

template<typename T1 >
T1 b2000::norm_inf_3_3 ( const T1  a[3][3])
inline

Infinite norm of a 3x3 matrix.

◆ norm_outer_product_3()

template<typename T >
T b2000::norm_outer_product_3 ( const T  a[3],
const T  b[3] 
)
inline
Returns
The norm |a x b| of the outer product of a and b, with a and b vectors of length 3.

◆ normalise_2() [1/3]

template<typename T >
b2000::csda< T > b2000::normalise_2 ( b2000::csda< T >  a[2])
inline

Normalise a csda vector of length 2, using the Euclidean norm. The normalisation is carried out if the norm is non-zero.

◆ normalise_2() [2/3]

template<typename T >
T b2000::normalise_2 ( std::complex< T >  a[2])
inline

Normalise a complex vector of length 2, using the Euclidean norm. The normalisation is carried out if the norm is non-zero.

◆ normalise_2() [3/3]

template<typename T >
T b2000::normalise_2 ( a[2])
inline

Normalise a vector of length 2, using the Euclidean norm. The normalisation is carried out if the norm is non-zero.

◆ normalise_3() [1/3]

template<typename T >
b2000::csda< T > b2000::normalise_3 ( b2000::csda< T >  a[3])
inline

Normalise a csda vector of length 3, using the Euclidean norm. The normalisation is carried out if the norm is non-zero.

◆ normalise_3() [2/3]

template<typename T >
T b2000::normalise_3 ( std::complex< T >  a[3])
inline

Normalise a complex vector of length 3, using the Euclidean norm. The normalisation is carried out if the norm is non-zero.

◆ normalise_3() [3/3]

template<typename T >
T b2000::normalise_3 ( a[3])
inline

Normalise a vector of length 3, using the Euclidean norm. The normalisation is carried out if the norm is non-zero.

◆ obtain_timer()

timer_map_t::iterator b2000::obtain_timer ( std::string  name)
inline

Obtain a (new) timer in the map of global timers with the given name.

If a timer of the same name exists already in the map, the returned iterator will point to that existing one. Otherwise a new timing object is created and the returned iterator points to it.

◆ outer_product_3()

template<typename T1 , typename T2 , typename T3 >
void b2000::outer_product_3 ( const T1  a[3],
const T2  b[3],
T3  c[3] 
)
inline

Compute the outer product c = a x b, with a, b, c vectors of length 3.

◆ outer_product_add_3()

template<typename T1 , typename T2 , typename T3 >
void b2000::outer_product_add_3 ( const T1  a[3],
const T2  b[3],
T3  c[3] 
)
inline

Add the outer product c += a x b, with a, b, c vectors of length 3.

◆ polar_decomposition()

void b2000::polar_decomposition ( const double  F[3][3],
double  R[3][3],
double  U[3][3] 
)
inline

Compute the polar decomposition of the deformation gradient tensor F into the rotation tensor R and the right stretch tensor U, such that F = R * U. All matrices are column-major.

◆ print_timers()

void b2000::print_timers ( std::string  filename)

Print the timer information into filename

Opens the file with the given filename and iterates through all Timings in the set of timers to print their respective information line by line.

◆ rotator_to_euler_angle()

template<typename TP >
void b2000::rotator_to_euler_angle ( const TP  rotator[3][3],
TP  e[3] 
)
inline

Conversion from a rotation matrix to Euler angle (XYZ)

Parameters
rotatorthe rotation matrix
ethe Euler angles

◆ scale_2()

template<typename T1 , typename T2 >
void b2000::scale_2 ( T1  v[2],
const T2  s 
)
inline

Compute v = s * v, v a vector of length 2.

◆ scale_2_2()

template<typename T >
void b2000::scale_2_2 ( const T  a,
const T  b[2][2],
c[2][2] 
)
inline

Scale a matrix by a factor c = b * a.

◆ scale_3()

template<typename T1 , typename T2 >
void b2000::scale_3 ( T1  v[3],
const T2  s 
)
inline

Compute v = s * v, v a vector of length 3.

◆ scale_3_3()

template<typename T >
void b2000::scale_3_3 ( const T  a,
const T  b[3][3],
c[3][3] 
)
inline

Scale a matrix by a factor c = b * a.

◆ set_identity_2_2()

template<typename T1 >
void b2000::set_identity_2_2 ( T1  a[2][2])
inline

Initialize matrix with the identity matrix.

◆ set_identity_3_3()

template<typename T1 >
void b2000::set_identity_3_3 ( T1  a[3][3])
inline

Initialize matrix with the identity matrix.

◆ set_zero_2()

template<typename T1 >
void b2000::set_zero_2 ( T1  a[2])
inline

Initialize vector to zero.

◆ set_zero_2_2()

template<typename T1 >
void b2000::set_zero_2_2 ( T1  a[2][2])
inline

Initialize matrix to zero.

◆ set_zero_3()

template<typename T1 >
void b2000::set_zero_3 ( T1  a[3])
inline

Initialize vector to zero.

◆ set_zero_3_3()

template<typename T1 >
void b2000::set_zero_3_3 ( T1  a[3][3])
inline

Initialize matrix to zero.

◆ solve_2_2()

template<typename T >
bool b2000::solve_2_2 ( const T  a[2][2],
const T  y[2],
x[2] 
)
inline

Solve a system of two equations with two unknowns.

Parameters
aThe 2x2 input matrix arranged in column-major format (input).
yThe right-hand side (input).
xThe unknowns (output). If the determinant of a is zero, x is undefined.
Returns
Whether the determinant is nonzero.

◆ solve_cubic_equation()

template<typename T >
void b2000::solve_cubic_equation ( const T  a,
const T  b,
const T  c,
const T  d,
int &  nsol,
T &  x1,
T &  x2,
T &  x3 
)
inline

Analytically solve a cubic equation ax^3 + bx^2 + cx + d = 0 with real coefficients.

Parameters
aCoefficient of x^3 (input).
bCoefficient of x^2 (input).
cCoefficient of x (input).
dConstant (input).
nsolThe number of distinct and real roots (output).
x1First real root (output). Only defined if nsol > 0.
x2Second real root (output). Only defined if nsol > 1.
x3Third real root (output). Only defined if nsol > 2.

◆ stress_invariants()

template<typename T >
void b2000::stress_invariants ( const T  t[6],
T &  i1,
T &  i2,
T &  i3 
)

Calculate the invariants of a stress tensor in the notation [s11, s22, s33, s12, s23, s13].

◆ sub_2()

template<typename T1 , typename T2 , typename T3 >
void b2000::sub_2 ( const T1  v1[2],
const T2  v2[2],
T3  dest[2] 
)
inline

Compute dest = v1 - v2, with dest, v1, and v2 vectors of length 2.

◆ sub_3()

template<typename T1 , typename T2 , typename T3 >
void b2000::sub_3 ( const T1  v1[3],
const T2  v2[3],
T3  dest[3] 
)
inline

Compute dest = v1 - v2, with dest, v1, and v2 vectors of length 3.

◆ svd_3_3()

void b2000::svd_3_3 ( const double  A[3][3],
double  U[3][3],
double  S[3],
double  V[3][3] 
)
inline

Singular value decomposition of a 3 x 3 matrix A such that A = U * diag(S) * V.

Parameters
A3 x 3 input matrix arranged in column-major format (input).
U3 x 3 column-major matrix (output).
SVector of singular values, sorted in descending order (output).
V3 x 3 column-major matrix (output).

◆ transpose_2_2() [1/2]

template<typename T1 >
void b2000::transpose_2_2 ( const T1  a[2][2],
T1  b[2][2] 
)
inline

Compute b = a^T with a and b 2x2 matrices.

◆ transpose_2_2() [2/2]

template<typename T1 >
void b2000::transpose_2_2 ( T1  a[2][2])
inline

Transpose a 2x2 matrix.

◆ transpose_3_3() [1/2]

template<typename T1 >
void b2000::transpose_3_3 ( const T1  a[3][3],
T1  b[3][3] 
)
inline

Compute b = a^T with a and b 3x3 matrices.

◆ transpose_3_3() [2/2]

template<typename T1 >
void b2000::transpose_3_3 ( T1  a[3][3])
inline

Transpose a 3x3 matrix.

◆ transposed_invert_2_2()

template<typename T >
T b2000::transposed_invert_2_2 ( const T  a[2][2],
b[2][2] 
)
inline

Invert and transpose a 2x2 matrix.

Parameters
aThe input matrix arranged in column-major format (input).
bIf the determinant of the input matrix is non-zero, contains the inverted and transposed matrix arranged in column-major format (output).
Returns
The determinant of the input matrix.

◆ transposed_invert_3_3()

template<typename T >
T b2000::transposed_invert_3_3 ( const T  a[3][3],
b[3][3] 
)
inline

Invert and transpose a 3x3 matrix.

Parameters
aThe input matrix arranged in column-major format (input).
bIf the determinant of the input matrix is non-zero, contains the transposed inverted matrix arranged in column-major format (output).
Returns
The determinant of the input matrix.

Variable Documentation

◆ timers

timer_map_t b2000::timers {}

Map of timers to hold a collection of timers

The Timings are uniquely identified by names provided as keys in the map. Add new timers via obtain_timer, which is simply a wrapper around the map.emplace as it is a little awkward.

Example:

auto mytimer = obtain_timer("me");
(*mytimer).second.start();
myfun(); // some code to measure the time for
(*mytimer).second.stop();
timer_map_t::iterator obtain_timer(std::string name)
Definition b2timing.H:139