BELFEM 0.9.0
Berkeley Lab Finite Element Framework
Loading...
Searching...
No Matches
belfem Namespace Reference

USER GUIDES: More...

Namespaces

namespace  arguments
namespace  arpack
namespace  assert
namespace  banners
namespace  cell
namespace  constant
namespace  database
namespace  electronics
namespace  fem
namespace  gasmodels
namespace  gastables
namespace  graph
namespace  hdf5
namespace  input
namespace  integration
namespace  lapack
namespace  map
namespace  material
namespace  mesh
namespace  ode
namespace  opt
namespace  parpack
namespace  prandtlmeyer
namespace  solver
namespace  sparse
namespace  spline
namespace  tensor
namespace  vtk

Classes

class  Arguments
 Command-line argument parsing. More...
class  Ascii
 Line-based ASCII file interface. More...
class  Bezier
class  Bitset
 Compile-time fixed-size bitset. More...
class  Cell
 Cell is a wrapper around the standard vector. More...
class  Circuit
class  CommunicationObject
class  Communicator
 Global MPI communicator manager. More...
class  CsvFile
 CSV reader for numeric data. More...
class  Database
 Precomputed lookup table on a tensor grid; evaluation, derivatives and HDF5 persistence. More...
class  DynamicBitset
 Runtime-sized bitset; one bit per flag, packed into 64-bit words. More...
class  Gas
 The gas class that provides the fluid model. More...
class  Genome
class  Hash
 Incremental hash computation. More...
class  HDF5
 Hierarchical data format I/O. More...
class  InputFile
 Parser for the input.conf configuration format. More...
struct  is_scalar
struct  is_scalar< Matrix< T > >
struct  is_scalar< Vector< T > >
struct  is_shift_register_safe
 Type trait: may T be stored in a ShiftRegister? More...
struct  is_shift_register_safe< Matrix< T > >
struct  is_shift_register_safe< Vector< T > >
class  Logger
 Hierarchical logging with info levels. More...
class  Map
 Hash map (unordered key-value). More...
class  Material
 Base class for all materials in BELFEM. More...
class  MaterialFactory
 Factory class for creating material objects and associated property functions. More...
class  Matrix
 Dense column-major matrix. More...
class  Mesh
 Top-level container for all mesh entities. More...
class  MeshChecker
class  MeshOptions
struct  opGenomeSort
struct  OpVertexDegree
struct  OpVertexID
struct  OpVertexIndex
struct  OpVertexLevel
struct  OpVertexOwner
class  OrderConverter
class  OrderedMap
 Sorted map (ordered key-value). More...
class  Profiler
 gperftools CPU profiling with Callgrind-format output. More...
class  Progressbar
 Progress display for long-running loops. More...
class  Protoshell
 Thin shell configuration object for electromagnetic simulations. More...
class  Quaternion
 Scalar-first quaternion value type for 3D rotations. More...
class  Queue
 FIFO queue. More...
class  Set
 Hash set with set operations. More...
class  ShiftRegister
 Fixed-capacity FIFO with history, for time-stepping. More...
class  Solver
 Unified interface to the sparse direct solvers. More...
class  SolverParameters
 Configuration for a Solver. More...
class  SourceFunction
class  Spline
 Cubic spline on a uniform grid, C2, with natural, parabolic or clamped boundary conditions. More...
class  SpMatrix
 Sparse matrix in CSR or CSC format. More...
class  StringList
 a help class needed for the Exodus Writer More...
class  Tensor
 Third- or fourth-order tensor container; the constitutive helpers (contraction, rotation, inversion, Voigt conversion) are specialised to 3x3x3x3. More...
class  TensorMeshConfig
class  TensorMeshFactory
class  Timer
 High-resolution wall-clock timing. More...
class  Vector
 Column vector. More...
class  XML
 XML document interface. More...

Typedefs

typedef int comm_t
typedef int proc_t
typedef size_t size_t
typedef std::string string
typedef int sint
typedef long int lsint
typedef unsigned int uint
typedef unsigned char uchar
typedef short unsigned int suint
typedef long unsigned int luint
typedef long long unsigned int lluint
typedef double real
typedef std::complex< realcplx
typedef unsigned int id_t
typedef long long unsigned int key_t
typedef __uint128_t key128_t
typedef int32_t int_t
typedef uint32_t index_t
typedef std::array< real, 7 > unit
typedef std::pair< real, unitvalue
typedef int hid_t
typedef int herr_t
typedef int hsize_t
typedef Cell< graph::Vertex * > Graph
typedef int metis_t
typedef int scotch_t
typedef real UserFunc(const real)
typedef Bitset< static_cast< size_t >(MaterialDependency::UNDEFINED) > MaterialDependencyBitset
 Bitset for tracking material property dependencies.
typedef real MatFunc1(const Material *, const real)
typedef real MatFunc2(const Material *, const real, const real)
typedef real MatFunc3(const Material *, const real, const real, const real)
typedef real DefectFunc(const real, const real, const real, const real)
typedef real HeatFunc(const real, const real, const real, const real)

Enumerations

enum class  InfoLevel {
  Silent = 0 , Minimal = 1 , Default = 2 , Detailed = 3 ,
  Verbose = 4 , Everything = 5
}
enum class  DofMode { AllBlocksEqual = 0 , BlockSpecific = 1 , UNDEFINED = 2 }
enum class  ModelDimensionality {
  TwoD , AxSymmX , AxSymmY , ThreeD ,
  UNDEFINED
}
enum class  Nfunction { Scalar = 0 , Vec2d = 1 , Vec3d = 2 , UNDEFINED = 3 }
enum class  Bfunction { Gradient = 0 , Planestress = 1 , Voigt = 2 , UNDEFINED = 3 }
enum class  IwgType {
  Poisson , StaticHeatConduction , TransientHeatConduction , Gradient2D ,
  Gradient3D , SurfaceGradient , PlaneStress , LinearElasticity ,
  Maxwell , MaxwellThermal , UNDEFINED
}
enum class  IwgMode { Direct =1 , Iterative =2 , UNDEFINED =3 }
enum class  SolverAlgorithm { Direct = 0 , NewtonRaphson = 1 , Picard = 2 , UNDEFINED = 3 }
enum class  DofManagerType { OLD , NEW , UNDEFINED }
enum class  EigenOutcome {
  Ok = 0 , NotConverged = 1 , NotPositiveDefinite = 2 , Complex = 3 ,
  Inconsistent = 4 , Infeasible = 5 , SolverFailed = 6
}
enum class  ArpackWhat {
  LambaMinMagn = 0 , LambaMaxMagn = 1 , LambaMinReal = 2 , LambaMaxReal = 3 ,
  LambaMinImag = 4 , LambaMaxImag = 5
}
enum class  FileMode { NEW , OPEN_RDONLY , OPEN_RDONLY_PARALLEL , OPEN_RDWR }
enum class  DomainType {
  Default = 0 , Air = 1 , Buffer = 2 , Ferro = 3 ,
  Coil = 4 , Conductor = 5 , LeftCoating = 6 , RightCoating = 7 ,
  Cut = 8 , ThinShell = 9 , Symmetry = 10 , AntiSymmetry = 11 ,
  Periodic = 12 , AirSymmetry = 13 , AirAntiSymmetry = 14 , AirPeriodic = 15 ,
  BufferSymmetry = 16 , BufferAntiSymmetry = 17 , BufferPeriodic = 18 , ConductorSymmetry = 19 ,
  ConductorAntiSymmetry = 20 , ConductorPeriodic = 21 , FerroSymmetry = 22 , FerroAntiSymmetry = 23 ,
  FerroPeriodic = 24 , InterfaceCondAir = 25 , InterfaceCondFerro = 26 , InterfaceFerroAir = 27 ,
  InterfaceAirCoil = 28 , InterfaceFerroCoil = 29 , InterfaceTsCond = 30 , InterfaceTsConnector = 31 ,
  BackgroundField = 32 , Terminal = 33 , Curve = 34 , Inactive = 35 ,
  GeometryOnly = 36 , Ghost = 37 , EnrichedInterface = 38 , Dirichlet = 39 ,
  Neumann = 40 , ThermalAlpha = 41 , UNDEFINED = 42
}
enum class  ElementType {
  EMPTY = 0 , LINE2 = 1 , TRI3 = 2 , QUAD4 = 3 ,
  TET4 = 4 , HEX8 = 5 , PENTA6 = 6 , PYRA5 = 7 ,
  LINE3 = 8 , TRI6 = 9 , QUAD9 = 10 , TET10 = 11 ,
  HEX27 = 12 , PENTA18 = 13 , PYRA14 = 14 , VERTEX = 15 ,
  QUAD8 = 16 , HEX20 = 17 , PENTA15 = 18 , PYRA13 = 19 ,
  TRI10 = 21 , TRI15 = 23 , TRI21 = 25 , LINE4 = 26 ,
  LINE5 = 27 , LINE6 = 28 , TET20 = 29 , TET35 = 30 ,
  QUAD16 = 32 , HEX64 = 92 , QUAD4TS = 103 , QUAD9TS = 110 ,
  HEX8TS = 105 , PENTA6TS = 106 , PENTA18TS = 118 , HEX8TB = 125 ,
  UNDEFINED = 127
}
 Element types. More...
enum class  GeometryType {
  VERTEX = 0 , LINE = 1 , TRI = 2 , QUAD = 3 ,
  TET = 4 , HEX = 5 , PENTA = 6 , PYRA = 7 ,
  UNDEFINED = 8
}
enum class  InterpolationOrder {
  CONSTANT , LINEAR , QUADRATIC , SERENDIPITY ,
  CUBIC , QUARTIC , QUINTIC , UNDEFINED
}
enum class  InterpolationType {
  LAGRANGE , HERMITE , BERNSTEIN , BubbleEdge0 ,
  BubbleEdge1 , BubbleEdge2 , BubbleFace0 , BubbleFace1 ,
  BubbleFace2 , BubbleFace3 , UNEFINED
}
enum class  EntityType {
  NODE = 0 , EDGE = 1 , FACE = 2 , CELL = 3 ,
  FACET = 4 , ELEMENT = 5 , CONTROLPOINT = 6 , UNDEFINED = 7
}
enum class  GroupType { BLOCK , SIDESET , UNDEFINED }
enum class  FieldType { SCALAR , UNDEFINED }
enum class  Connectivity {
  Compute = 0 , NodeToVertex = 1 , NodeToNode = 2 , NodeToEdge = 3 ,
  NodeToFace = 4 , NodeToFacet = 5 , NodeToElement = 6 , EdgeToVertex = 7 ,
  EdgeToNode = 8 , EdgeToEdge = 9 , EdgeToFace = 10 , EdgeToFacet = 11 ,
  EdgeToElement = 12 , FaceToVertex = 13 , FaceToNode = 14 , FaceToEdge = 15 ,
  FaceToFace = 16 , FaceToFacet = 17 , FaceToElement = 18 , FacetToVertex = 19 ,
  FacetToNode = 20 , FacetToEdge = 21 , FacetToFace = 22 , FacetToFacet = 23 ,
  FacetToElement = 24 , ElementToVertex = 25 , ElementToNode = 26 , ElementToEdge = 27 ,
  ElementToFace = 28 , ElementToFacet = 29 , ElementToElement = 30 , TsElementToTsElement = 31 ,
  ShellToShell = 32 , ControlPointToControlPoint = 33 , ElementToControlPoint = 34 , ControlPointToElement = 35 ,
  UNDEFINED = 36
}
enum class  BezierType { Horizontal , Vertical }
enum class  IntegrationScheme { GAUSS , GAUSSCLASSIC , LOBATTO , UNDEFINED }
enum class  SourceFunctionType {
  Constant = 0 , Ramp = 1 , Sigmoid = 2 , Sine = 3 ,
  Square = 4 , Triangle = 5 , Sawtooth = 6 , UserDefined = 7 ,
  UNDEFINED = 8
}
enum class  GasModel {
  IDGAS , SRK , PR , HELMHOLTZ ,
  UNDEFINED
}
enum class  HelmholtzModel {
  ParaHydrogen = 0 , NormalHydrogen = 1 , OrthoHydrogen = 2 , Oxygen = 3 ,
  Methane = 4 , Nitrogen = 5 , UNDEFINED
}
enum class  MaterialType {
  UserDefined , Ferro , HTS , PureMetal ,
  LookupAlloy , CompositeAlloy , NonMetal
}
 Material classification based on physical behavior. More...
enum class  MaterialDependency {
  T = 0 , normB = 1 , angleBxJ = 2 , angleNxB = 3 ,
  normH = 4 , normJ = 5 , Jc = 6 , rho = 7 ,
  UNDEFINED = 8
}
 Dependencies that material properties can have. More...
enum class  MaterialProperty {
  density = 0 , E = 1 , nu = 2 , cp = 3 ,
  lambda = 4 , mu = 5 , rho = 6 , alpha = 7 ,
  Rp02 = 8 , debye = 9 , rho_i = 10 , kohler_trans = 11 ,
  kohler_long = 12 , T_crit = 13 , M = 14 , Gamma = 15 ,
  R = 16 , T_max = 17 , ref_density = 18 , T_ref_density = 19 ,
  gamma = 20 , beta = 21 , q = 22 , debye0K = 23 ,
  rho_i_ref = 24 , T_ref_rho_i = 25 , A_bloch_gruen = 26 , n_bloch_gruen = 27 ,
  RRR = 28 , rho_0 = 29 , layer_thickness = 30 , ec = 31 ,
  jc = 32 , n = 33 , Tcurie = 34 , A_electron_magnon = 35 ,
  A_spin_disorder = 36 , grueneisen = 37 , density_correction = 38 , rho0_pure = 39 ,
  UNDEFINED = 40
}
 All material properties that can be defined. More...
enum class  ResistivityLaw { PowerLaw = 0 , Piecewise = 1 , Riva = 2 }
 E-J law used for a superconductor's resistivity. More...
enum class  SpMatrixType { CSC = 0 , CSR = 1 , UNDEFINED = 2 }
enum class  SpMatrixIndexingBase { Cpp = 0 , Fortran = 1 }
enum class  SolverType {
  UMFPACK , SUPERLU , MUMPS , STRUMPACK ,
  PARDISO , PETSc , UNDEFINED
}
enum class  SymmetryMode { Unsymmetric = 0 , PositiveDefiniteSymmetric = 1 , GeneralSymmetric = 2 , UNDEFINED }
enum class  EulerMethod {
  Static , ForwardExplicit , CrankNicolson , Galerkin ,
  BackwardDifference1 , BackwardDifference2 , BackwardDifference3 , BackwardDifference4 ,
  BackwardDifference5 , StiffnessOnly , MassOnly , Derivative ,
  UNDEFINED
}
enum class  DistributedMatrixType { AIJ = 0 , CSR = 1 , CSC = 2 , UNDEFINED = 3 }
enum class  Preconditioner {
  NONE , ASM , GASM , GAMG ,
  JACOBI , BJACOBI , LU , ICC ,
  ILU , HMG , SPAI , UNDEFINED
}
 PETSC only. More...
enum class  KrylovMethod {
  PREONLY , CG , CGS , IBCGS ,
  GMRES , TFQMR , BCGS , AUTO ,
  UNDEFINED
}
 PETSC only. More...
enum class  ReorderingMethod {
  NATURAL = 0 , METIS = 1 , SCOTCH = 2 , AUTOMATIC = 3 ,
  PARMETIS = 4 , PTSCOTCH = 5 , UNDEFINED = 6
}
enum class  CompressionMethod { OFF = 0 , BLR = 1 , AUTOMATIC = 2 , UNDEFINED = 3 }
enum class  MumpsSerialReodrdering {
  AMD = 0 , USERPIVOT = 1 , AMF = 2 , SCOTCH = 3 ,
  PORD = 4 , METIS = 5 , QAMD = 6 , AUTOMATIC = 7 ,
  UNDEFINED
}
 MUMPS only. More...
enum class  MumpsParallelReodrdering { AUTOMATIC = 0 , PTSCOTCH = 1 , PARMETIS = 2 , UNDEFINED }
 MUMPS only. More...
enum class  MumpsBlockLowRanking {
  Off = 0 , Automatic = 1 , FactorizationAndSolution = 2 , FactorizationOnly = 3 ,
  UNDEFINED = 4
}
 MUMPS only. More...
enum class  MumpsErrorAnalysis { None = 0 , Full = 1 , Main = 2 , UNDEFINED = 3 }
 MUMPS only. More...

Functions

void comm_abort (const int aErrorCode=1)
 Kill the whole job.
proc_t comm_size ()
 Returns the number of processes in the communicator.
proc_t comm_rank ()
 Returns the rank of the current process in the communicator.
void comm_check (const int aErrorCode)
 Checks the MPI error code and reports any errors.
void comm_barrier ()
 Synchronizes all processes in the communicator.
int comm_tag (const proc_t aSource, const proc_t aTarget)
 Generates a unique tag for MPI communication between two processes.
void comm_drain_check (const char *aLabel)
 Debug-build tripwire for the two-tags-per-pair ordering contract of the point-to-point fabric ( see comm_tag() in commtools.cpp ).
Cell< int > comm_split (const index_t aLength)
 Splits a message into chunks for MPI communication.
index_t comm_splitcount (const Vector< index_t > &aLengths, const proc_t aRoot)
 Calculates the total number of chunks needed for a set of message lengths.
index_t comm_splitcount (index_t aLength)
void broadcast (Cell< string > &aData, const proc_t aRoot)
void send (const string &aMessage, const proc_t aTarget)
void receive (string &aMessage, const proc_t aSource)
template<typename T>
void broadcast (T &aMessage, const proc_t aRoot=0, typename std::enable_if< is_scalar< T >::value >::type *=nullptr)
 Broadcasts a scalar value to all processes.
template<typename T>
void broadcast (T *aMessage, const proc_t aRoot, const proc_t aLength)
template<typename T>
void allreduce (const T *aSend, T *aRecv, const int aCount)
 Collective MAX-reduction visible on every rank.
template<typename T>
void allreduce_min (const T *aSend, T *aRecv, const int aCount)
 Collective MIN-reduction visible on every rank.
template<typename T>
void send (const T aData, const proc_t aTarget=0, typename std::enable_if< is_scalar< T >::value >::type *=nullptr)
 Sends a scalar value to a specific target process.
template<typename T>
void receive (T &aData, const proc_t aSource=0, typename std::enable_if< is_scalar< T >::value >::type *=nullptr)
 Receives a scalar value from a specific source process.
template<typename T>
void send (T *aData, const index_t aLength, const proc_t aTarget)
 Sends a raw array to a specified target process using MPI.
template<typename T>
void receive (T *aData, index_t &aLength, const proc_t aSource)
 Receives a raw array from a specified source process using MPI.
template<typename T>
void send (Cell< T > &aData, const proc_t aTarget=0)
 Sends a cell to a specific target process.
template<typename T>
void receive (Cell< T > &aData, const proc_t aSource=0)
 Receives a cell from a specific source process.
template<typename T>
void broadcast (Cell< T > &aData, const proc_t aRoot=0)
 Broadcasts a cell to all processes.
template<typename T>
void distribute (Cell< T > &aData)
 Distributes elements of a cell to other processes.
template<typename T>
void collect (Cell< T > &aData, const T aMyValue=0)
 Collects scalar values from all processes into a cell.
template<typename T>
void send (Vector< T > &aData, const proc_t aTarget=0)
 Sends a vector to a specific target process.
template<typename T>
void receive (Vector< T > &aData, const proc_t aSource=0)
 Receives a vector from a specific source process.
template<typename T>
void broadcast (Vector< T > &aData, const proc_t aRoot=0)
 Broadcasts a vector to all processes.
template<typename T>
void distribute (Vector< T > &aData)
 Distributes elements of a vector to other processes.
template<typename T>
void collect (Vector< T > &aData, const T aMyValue=0)
 Collects scalar values from all processes into a vector.
template<typename T>
void distribute (Cell< Vector< T > > &aData)
 Distributes a collection of vectors to other processes.
template<typename T>
void distribute (Cell< Cell< T > > &aData)
 Distributes a collection of cells to other processes.
template<typename T, typename U>
void distribute (const T *aData, const Vector< U > &aOffsets)
 Distributes a raw vector based on lengths and offsets.
template<typename T, typename U>
void collect (T *aData, const Vector< U > &aOffsets)
template<typename T>
void collect (Cell< Vector< T > > &aData, Vector< T > aMyData={})
 Collects vectors from all processes into a cell.
template<typename T>
void share (Vector< T > &aData)
template<typename T>
void share (Cell< T > &aData)
template<typename T>
void broadcast (Matrix< T > &aData, const proc_t aRoot=0)
 Broadcasts a matrix to all processes.
template<typename T>
void send (Matrix< T > &aData, const proc_t aTarget=0)
template<typename T>
void receive (Matrix< T > &aData, const proc_t aSource=0)
 Receives a matrix from a specific source process.
template<typename T>
void distribute (Cell< Matrix< T > > &aData)
 Distributes a collection of matrices to other processes.
template<typename T>
void collect (Cell< Matrix< T > > &aData)
 Collects matrices from all processes into a cell.
template<typename T>
comm_t comm_type ()
 returns the MPI datatype handle for T
template<typename T>
void sort (Cell< T > &aCell)
template<typename T, class C>
void sort (Cell< T > &aCell, C &aComp, const size_t aNumberOfItems=0)
template<typename T>
void unique (Cell< T > &aCell)
template<typename T>
index_t find_index_in_unique_cell (const Cell< T > &aCell, const T &aMember)
 returns the position of a member inside a cell.
template<typename T>
void reverse (Cell< T > &aCell)
template<typename T>
void append (Cell< T > &aA, const Cell< T > &aB)
template<typename T>
void append_move (Cell< T > &aTarget, Cell< T > &aSource)
template<typename T>
void swap (Cell< T > &aA, Cell< T > &aB) noexcept
 Swap specialization for Cell.
std::string exec (const std::string &aCommand)
std::string uname ()
 returns the Unix version ( Linux or Darwin )
std::string cpu_info ()
 grabs the cpu info for the banner
std::string os_string ()
std::string version ()
 returns the BELFEM semantic version as "major.minor.patch" (e.g.
bool is_built_from_git ()
 true if the build was produced from a git checkout (i.e.
std::string git_commit_hash ()
 returns the full git commit hash of the build, or "unknown" if built outside a git repository (e.g.
std::string git_commit_hash_short ()
 returns the abbreviated (short) git commit hash of the build
std::string git_branch ()
 returns the git branch name at build time, or "unknown"
bool git_is_dirty ()
 true if the working tree had uncommitted changes at build time
void print_banner (const std::string aExecName="")
 prints the banner
std::size_t available_memory ()
 Bytes a new allocation by this process can claim without swapping, or 0 when that cannot be established.
bool check_unit (const value &aValue, const string &aUnit)
 check if a value has the correct unit
template<typename ... Args>
std::string sprint (const char *aFormat, const Args ... aArgs)
 A format script similar to write( , ) in fortran.
template<typename T>
void to_enum (const string &aString, T &aEnum)
template<typename T>
void random_seed (T &aSeed)
void random_seed ()
 seed the random generator.
real rand ()
 a random number between 0 and 1 must call seed first
std::string basename (const std::string &aFilePath)
 returns the basename of a file
std::string dirname (const std::string &aFilePath)
 returns the directory name of a file
std::string filetype (const std::string &aFilePath)
 returns the filetype of a file
std::string filename (const std::string &aFilePath)
 returns the name of a file without the path
std::string clean_string (const std::string &aString)
 tidy up the string
string first_word (const std::string &aString, const char aDelimiter=' ')
 return the first word of the string
Cell< stringstring_to_words (const std::string &aString, const char aDelimiter=' ')
 create a cell of words from a string
std::string search_and_replace (const std::string &aString, const std::string &aSearch, const std::string &aReplace)
std::string string_to_lower (const std::string &aString)
 convert the string to lower case
std::string string_to_upper (const std::string &aString)
 convert the string to upper case
bool string_to_bool (const std::string &aString)
 return true if string is either 1, on, true or yes
real to_real (const std::string &aString)
 convert string to real, return NAN if it is not real
value unit_to_si (const string &aString)
string format_with_leading_zeros (const uint aNumber)
bool is_integer (const string &aString)
size_t utf8_character_count (const string &aString)
template<typename T>
std::string datatype_string ()
template<>
std::string datatype_string< bool > ()
template<>
std::string datatype_string< int > ()
template<>
std::string datatype_string< unsigned int > ()
template<>
std::string datatype_string< long unsigned int > ()
template<>
std::string datatype_string< double > ()
template<>
std::string datatype_string< std::string > ()
template<>
std::string datatype_string< std::complex< double > > ()
template<typename T>
void string_to_cell (const string &aString, Cell< T > &aValues)
template<typename T>
void to_pair (const std::string &aString, Cell< std::pair< std::string, T > > &aResult)
bool is_maxwell (const IwgType aType)
std::pair< uint, uintminNonzero (Matrix< int > &aMat, const uint k)
void moveMinNonzero (Matrix< int > &aMat, Matrix< int > &aQ, Matrix< int > &aQ_, Matrix< int > &aR, Matrix< int > &aR_, const uint k)
std::tuple< bool, uint, uint, int > checkForDivisibility (Matrix< int > &aMat, const uint k)
void partSmithForm (Matrix< int > &aMat, Matrix< int > &aQ, Matrix< int > &aQ_, Matrix< int > &aR, Matrix< int > &aR_, const uint k)
std::tuple< Matrix< int >, Matrix< int >, Matrix< int >, Matrix< int >, uint, uintsmithForm (Matrix< int > &aMat)
Matrix< int > SolveInt (Matrix< int > aMat, Matrix< int > &aVec)
template<typename T>
void rowExchange (Matrix< T > &aMat, const uint i, const uint j)
template<typename T>
void columnExchange (Matrix< T > &aMat, const uint i, const uint j)
template<typename T>
void rowMultiply (Matrix< T > &aMat, const uint i)
template<typename T>
void columnMultiply (Matrix< T > &aMat, const uint i)
template<typename T>
void rowAdd (Matrix< T > &aMat, const uint i, const uint j, const int q)
template<typename T>
void columnAdd (Matrix< T > &aMat, const uint i, const uint j, const int q)
template<typename T>
void rowExchangeOperation (Matrix< T > &aMat, Matrix< T > &aQ, Matrix< T > &aQ_, const uint i, const uint j)
template<typename T>
void rowMultiplyOperation (Matrix< T > &aMat, Matrix< T > &aQ, Matrix< T > &aQ_, const uint i)
template<typename T>
void rowAddOperation (Matrix< T > &aMat, Matrix< T > &aQ, Matrix< T > &aQ_, const uint i, const uint j, const int q)
template<typename T>
void columnExchangeOperation (Matrix< T > &aMat, Matrix< T > &aR, Matrix< T > &aR_, const uint i, const uint j)
template<typename T>
void columnMultiplyOperation (Matrix< T > &aMat, Matrix< T > &aR, Matrix< T > &aR_, const uint i)
template<typename T>
void columnAddOperation (Matrix< T > &aMat, Matrix< T > &aR, Matrix< T > &aR_, const uint i, const uint j, const int q)
template<typename T>
void partRowReduce (Matrix< T > &aMat, Matrix< T > &aQ, Matrix< T > &aQ_, const uint k, const uint l)
template<typename T>
void partColumnReduce (Matrix< T > &aMat, Matrix< T > &aR, Matrix< T > &aR_, const uint k, const uint l)
template<typename T>
std::pair< uint, uintsmallestNonzero (Vector< T > &v, uint k)
template<typename T>
void rowPrepare (Matrix< T > &aMat, Matrix< T > &aQ, Matrix< T > &aQ_, const uint k, const uint l)
template<typename T>
void rowReduce (Matrix< T > &aMat, Matrix< T > &aQ, Matrix< T > &aQ_, const uint k, const uint l)
template<typename T>
std::tuple< Matrix< T >, Matrix< T >, uintrowEchelon (Matrix< T > &aMat)
template<typename T>
std::tuple< Matrix< T >, Matrix< T > > kernelImage (Matrix< T > &aMat)
bool file_exists (const std::string &aPath)
 this function tests if a file exists
std::string search_data_file (const std::string &aFile, const std::string &aSubDirectory)
 Resolve a data file named in an input file, looking below aSubDirectory of the shared data directory.
std::string make_path_parallel (const std::string &aPath)
 this function takes a path and makes it parallel
template<typename ET>
auto cross (const ET &aA, const ET &aB) -> decltype(arma::cross(aA, aB))
template<typename T, typename ET>
auto cross (Vector< T > &aA, const ET &aB) -> decltype(arma::cross(aA.vector_data(), aB))
template<typename ET, typename T>
auto cross (const ET &aA, const Vector< T > &aB) -> decltype(arma::cross(aA, aB.vector_data()))
template<typename T>
auto det (const T &A) -> decltype(arma::det(A))
template<typename T>
auto det (T &A) -> decltype(arma::det(A))
template<typename T>
auto dot (const Vector< T > &aA, const Vector< T > &aB) -> decltype(arma::dot(aA.vector_data(), aB.vector_data()))
 Scalar product of two vectors.
template<typename T>
auto dot (const Matrix< T > &aA, const Vector< T > &aB) -> decltype(arma::dot(aA.matrix_data(), aB.vector_data()))
 Scalar product of a matrix and a vector, both read as flat sequences.
template<typename T>
auto dot (const Vector< T > &aA, const Matrix< T > &aB) -> decltype(arma::dot(aA.vector_data(), aB.matrix_data()))
 Scalar product of a vector and a matrix, both read as flat sequences.
template<typename ET>
auto dot (const ET &aA, const ET &aB) -> decltype(arma::dot(aA, aB))
template<typename T, typename ET>
auto dot (Vector< T > &aA, const ET &aB) -> decltype(arma::dot(aA.vector_data(), aB))
template<typename ET, typename T>
auto dot (const ET &aA, const Vector< T > &aB) -> decltype(arma::dot(aA, aB.vector_data()))
int_t eigen (const Matrix< real > &aMatrix, Vector< real > &aValues, const bool aAbortOnComplex=true)
 Eigenvalues of a general (not necessarily symmetric) square matrix.
void eigen_sym (const Matrix< real > &aMatrix, Vector< real > &aValues)
 Eigenvalues of a symmetric matrix.
template<typename T>
auto inv (const T &aExpression) -> decltype(arma::inv(aExpression))
template<typename T>
void linspace (const T &aStart, const T &aEnd, const belfem::size_t &aN, Vector< T > &aValues)
template<typename T>
auto linspace (const T &aStart, const T &aEnd, const belfem::size_t &aN) -> decltype(arma::linspace< arma::Mat< T > >(aStart, aEnd, aN))
template<typename T>
max (const Vector< T > &aVector)
template<typename T>
max (const Matrix< T > &aMatrix)
template<typename T>
max (const arma::Mat< T > &aMatrix)
template<typename T>
min (const Vector< T > &aVector)
template<typename T>
min (const Matrix< T > &aMatrix)
template<typename T>
min (const arma::Mat< T > &aMatrix)
template<typename T>
void polyfit (const Vector< T > &aX, const Vector< T > &aY, const uint &aN, Vector< T > &aCoeffs)
template<typename T>
bool operator== (const Matrix< T > &aA, const Matrix< T > &aB)
template<typename T>
bool operator== (const T &aA, const Matrix< T > &aB)
template<typename T>
bool operator== (const Matrix< T > &aA, const T &aB)
template<typename T>
auto operator% (const Vector< T > &aA, const Vector< T > &aB) -> decltype(aA.vector_data() % aB.vector_data())
template<typename T>
auto operator% (const arma::Mat< T > &aA, const arma::Mat< T > &aB) -> decltype(aA.data() % aB.data())
template<typename T, typename ET>
auto operator% (const Vector< T > &aA, const ET &aB) -> decltype(aA.vector_data() % aB)
template<typename ET, typename T>
auto operator% (const ET &aA, const Vector< T > &aB) -> decltype(aA % aB.vector_data())
template<typename T>
bool operator== (const Vector< T > &aA, const Vector< T > &aB)
template<typename T>
bool operator== (const T &aA, const Vector< T > &aB)
template<typename T>
bool operator== (const Vector< T > &aA, const T &aB)
template<typename ET>
auto cross (const ET &aA, const ET &aB) -> decltype(blaze::cross(aA, aB))
template<typename T, typename ET>
auto cross (Vector< T > &aA, const ET &aB) -> decltype(blaze::cross(aA.vector_data(), aB))
template<typename ET, typename T>
auto cross (const ET &aA, const Vector< T > &aB) -> decltype(blaze::cross(aA, aB.vector_data()))
template<typename T>
auto det (const T &A) -> decltype(blaze::det(A))
template<typename T>
auto det (T &A) -> decltype(blaze::det(A))
template<typename T>
auto dot (const Vector< T > &aA, const Vector< T > &aB) -> decltype(blaze::dot(aA.vector_data(), aB.vector_data()))
template<typename T>
auto dot (const Matrix< T > &aA, const Vector< T > &aB) -> decltype(blaze::dot(aA.matrix_data(), aB.vector_data()))
template<typename T>
auto dot (const Vector< T > &aA, const Matrix< T > &aB) -> decltype(blaze::dot(aA.vector_data(), aB.matrix_data()))
template<typename ET1, typename ET2>
auto dot (const ET1 &aA, const ET2 &aB) -> decltype(blaze::dot(aA, aB))
template<typename MT, bool SO, bool SF, bool DF, typename ET>
auto dot (const blaze::Rows< MT, SO, SF, DF > &aA, const ET &aB) -> decltype(blaze::dot(blaze::row(aA, 0UL), aB))
template<typename ET, typename MT, bool SO, bool SF, bool DF>
auto dot (const ET &aA, const blaze::Rows< MT, SO, SF, DF > &aB) -> decltype(blaze::dot(aA, blaze::row(aB, 0UL)))
template<typename MT1, bool SO1, bool SF1, bool DF1, typename MT2, bool SO2, bool SF2, bool DF2>
auto dot (const blaze::Rows< MT1, SO1, SF1, DF1 > &aA, const blaze::Rows< MT2, SO2, SF2, DF2 > &aB) -> decltype(blaze::dot(blaze::row(aA, 0UL), blaze::row(aB, 0UL)))
template<typename MT, bool SO, bool SF, bool DF, typename T>
dot (const blaze::Rows< MT, SO, SF, DF > &aA, const Vector< T > &aB)
template<typename T, typename MT, bool SO, bool SF, bool DF>
dot (const Vector< T > &aA, const blaze::Rows< MT, SO, SF, DF > &aB)
template<typename MT, bool SO, bool SF, bool DF, typename ET>
auto dot (const blaze::Columns< MT, SO, SF, DF > &aA, const ET &aB) -> decltype(blaze::dot(blaze::column(aA, 0UL), aB))
template<typename ET, typename MT, bool SO, bool SF, bool DF>
auto dot (const ET &aA, const blaze::Columns< MT, SO, SF, DF > &aB) -> decltype(blaze::dot(aA, blaze::column(aB, 0UL)))
template<typename MT1, bool SO1, bool SF1, bool DF1, typename MT2, bool SO2, bool SF2, bool DF2>
auto dot (const blaze::Columns< MT1, SO1, SF1, DF1 > &aA, const blaze::Columns< MT2, SO2, SF2, DF2 > &aB) -> decltype(blaze::dot(blaze::column(aA, 0UL), blaze::column(aB, 0UL)))
template<typename MT, bool SO, bool SF, bool DF, typename T>
dot (const blaze::Columns< MT, SO, SF, DF > &aA, const Vector< T > &aB)
template<typename T, typename MT, bool SO, bool SF, bool DF>
dot (const Vector< T > &aA, const blaze::Columns< MT, SO, SF, DF > &aB)
template<typename MT1, bool SO1, bool SF1, bool DF1, typename MT2, bool SO2, bool SF2, bool DF2>
auto dot (const blaze::Rows< MT1, SO1, SF1, DF1 > &aA, const blaze::Columns< MT2, SO2, SF2, DF2 > &aB) -> decltype(blaze::dot(blaze::row(aA, 0UL), blaze::column(aB, 0UL)))
template<typename MT1, bool SO1, bool SF1, bool DF1, typename MT2, bool SO2, bool SF2, bool DF2>
auto dot (const blaze::Columns< MT1, SO1, SF1, DF1 > &aA, const blaze::Rows< MT2, SO2, SF2, DF2 > &aB) -> decltype(blaze::dot(blaze::column(aA, 0UL), blaze::row(aB, 0UL)))
template<typename T, typename ET>
auto dot (const Vector< T > &aA, const ET &aB) -> decltype(blaze::dot(aA.vector_data(), aB))
template<typename ET, typename T>
auto dot (const ET &aA, const Vector< T > &aB) -> decltype(blaze::dot(aA, aB.vector_data()))
template<typename T, typename = blaze::EnableIf_t< blaze::IsMatrix_v< T > >>
blaze::DynamicMatrix< blaze::ElementType_t< T >, BLAZE_DEFAULT_STORAGE_ORDERinv (const T &aExpression)
template<typename T>
Vector< T > linspace (const T &aStart, const T &aEnd, const belfem::size_t &aN)
template<typename T>
max (const blaze::Columns< blaze::DynamicMatrix< T, BLAZE_DEFAULT_STORAGE_ORDER >, true, true, false > &aColumn)
template<typename T>
max (const blaze::Rows< blaze::DynamicMatrix< T, BLAZE_DEFAULT_STORAGE_ORDER >, false, true, false > &aColumn)
template<typename T>
min (const blaze::Columns< blaze::DynamicMatrix< T, BLAZE_DEFAULT_STORAGE_ORDER >, true, true, false > &aColumn)
template<typename T>
min (const blaze::Rows< blaze::DynamicMatrix< T, BLAZE_DEFAULT_STORAGE_ORDER >, false, true, false > &aColumn)
template<typename T>
blaze::DynamicVector< T, blaze::columnVector > operator% (const Vector< T > &aA, const Vector< T > &aB)
template<typename T>
void append (Vector< T > &aA, Vector< T > &aB)
 Appends one vector onto the end of another, in place.
template<typename T>
void append (Vector< T > &aA, const Vector< T > &aB)
template<typename T>
void combine (const Vector< T > &aA, const Vector< T > &aB, Vector< T > &aC)
template<typename T>
void combine (const Vector< T > &aA, const Vector< T > &aB, const Vector< T > &aC, Vector< T > &aD)
template<typename T>
void combine (const Vector< T > &aA, const Vector< T > &aB, const Vector< T > &aC, const Vector< T > &aD, Vector< T > &aE)
template<typename T>
auto cross (const Vector< T > &aA, const Vector< T > &aB) -> decltype(cross(aA.vector_data(), aB.vector_data()))
 Cross product of two length-3 vectors.
void crossmat (const Vector< real > &aN, const Matrix< real > &aA, Vector< real > &aNxA)
 Crosses a normal vector with every column of a matrix, 2D.
void crossmat (const Vector< real > &aN, const Matrix< real > &aA, const real aScale, Vector< real > &aNxA)
 Crosses a normal vector with every column of a matrix, 2D, scaled.
void crossmat (const Vector< real > &aN, const Matrix< real > &aA, Matrix< real > &aNxA)
 Crosses a normal vector with every column of a matrix, 3D.
void crossmat (const Vector< real > &aN, const Matrix< real > &aA, const real aScale, Matrix< real > &aNxA)
 Crosses a normal vector with every column of a matrix, 3D, scaled.
template<typename T>
ddpolyval (const Vector< T > &aCoeffs, const T aX)
 Evaluates the second derivative of a polynomial at one point.
template<typename T>
auto det (const Matrix< T > &aA) -> decltype(det(aA.matrix_data())) const
 Determinant of a square matrix.
template<typename T>
auto det (Matrix< T > &aA) -> decltype(det(aA.matrix_data()))
template<typename T>
dpolyval (const Vector< T > &aCoeffs, const T aX)
 Evaluates the first derivative of a polynomial at one point.
template<typename T>
auto inv (const Matrix< T > &aA) -> decltype(inv(aA.matrix_data())) const
 Inverse of a square matrix.
template<typename T>
auto inv (Matrix< T > &aA) -> decltype(inv(aA.matrix_data()))
real inv2 (const Matrix< real > &aA, Matrix< real > &aB)
 Inverse of a 2x2 matrix from the closed-form adjugate.
real inv3 (const Matrix< real > &aA, Matrix< real > &aB)
 Inverse of a 3x3 matrix from the closed-form adjugate.
template<typename T>
auto norm (const Vector< T > &aA) -> decltype(norm(aA.vector_data()))
 Euclidean (L2) norm of a vector.
template<typename T>
polyval (const Vector< T > &aCoeffs, const T aX)
 Evaluates a polynomial at one point, by Horner's scheme.
template<typename T>
void polyval (const Vector< T > &aCoeffs, const Vector< T > &aX, Vector< T > &aY)
real r2 (const Vector< real > &aApproximated, const Vector< real > &aExact)
 calculates the R2 coefficient of determination from values of an evaluated function with respect to given samples.
real r2 (const Matrix< real > &aApproximated, const Matrix< real > &aExact)
template<typename T>
auto reverse (const Vector< T > &aA) -> decltype(reverse(aA.vector_data()))
template<typename T>
void sort (Vector< T > &aVector)
 Sorts a vector in place, in ascending order.
template<typename T>
auto sum (const Vector< T > &aA) -> decltype(sum(aA.vector_data()))
template<typename T>
Cell< T > to_cell (const Vector< T > &aVector)
 convert a Vector< T > into a Cell< T >
template<typename T>
Vector< T > to_vector (const Cell< T > &aCell)
 convert a Cell< T > into a Vector< T >
template<typename T>
auto trans (Matrix< T > &aMatrix) -> decltype(trans(aMatrix.matrix_data()))
template<typename T>
auto trans (const Matrix< T > &aMatrix) -> decltype(trans(aMatrix.matrix_data()))
template<typename T>
void unique (Vector< T > &aVector)
 Sorts a vector in place and drops duplicate entries.
template<typename T>
int_t gees (Matrix< T > &A, Vector< lapack::cplx_t< T > > &W, Matrix< T > &VS, Vector< lapack::real_t< T > > &Work, Vector< int_t > &BWork, lapack::gees_select_t< T > select=nullptr, const char jobvs='V', const char sort='N', int_t *aSdim=nullptr, const bool AbortOnError=true)
 Schur decomposition of a general square matrix via LAPACK ?gees: A = Z * T * Z^T for the real flavors, A = Z * T * Z^H for the complex ones.
template<typename T>
int_t geev (Matrix< T > &A, Vector< lapack::cplx_t< T > > &W, Matrix< T > &VL, Matrix< T > &VR, Vector< lapack::real_t< T > > &Work, const char jobvl='V', const char jobvr='V', const bool AbortOnError=true)
 eigenvalues and eigenvectors of a general square matrix, A * v = lambda * v, via LAPACK ?geev
template<typename T>
int_t geev (Matrix< T > &A, Vector< lapack::cplx_t< T > > &W, Vector< lapack::real_t< T > > &Work, const bool AbortOnError=true)
 eigenvalues only of a general square matrix, see the full version above
template<typename T>
int_t gels (Matrix< T > &A, Vector< T > &B, Vector< T > &Work, const bool AbortOnError=true)
 solve the least squares problem min || A * x - b || via LAPACK ?gels ( QR or LQ factorization, A must have full rank )
template<typename T>
int_t gels (Matrix< T > &A, Matrix< T > &B, Vector< T > &Work, const bool AbortOnError=true)
 solve min || A * X - B || for multiple right hand sides, see the single right hand side version above
template<typename T>
void gemm (const Matrix< T > &A, const Matrix< T > &B, Matrix< T > &C, const T alpha=1.0, const T beta=0.0, const char transa='N', const char transb='N')
 matrix-matrix product C := alpha * op(A) * op(B) + beta * C via BLAS ?gemm, where op is the identity ( trans = 'N' ) or the ( conjugate ) transpose ( 'T' / 'C' )
template<typename T>
int_t gesv (Matrix< T > &A, Vector< T > &B, Vector< int_t > &Pivot, const bool AbortOnError=true)
 solve the square linear system A * x = b via LAPACK ?gesv ( LU factorization with partial pivoting )
template<typename T>
int_t gesv (Matrix< T > &A, Matrix< T > &B, Vector< int_t > &Pivot, const bool AbortOnError=true)
 solve A * X = B for multiple right hand sides via LAPACK ?gesv, see the vector version above
template<typename T>
int_t gesvd (Matrix< T > &A, Vector< lapack::real_t< T > > &S, Matrix< T > &U, Matrix< T > &VT, Vector< lapack::real_t< T > > &Work, const char jobu='A', const char jobvt='A', const bool AbortOnError=true)
 singular value decomposition A = U * diag( S ) * VT via LAPACK ?gesvd
template<typename T>
int_t getrf (Matrix< T > &A, Vector< int_t > &Pivot, const bool AbortOnError=true)
 LU factorization with partial pivoting via LAPACK ?getrf, A = P * L * U; use together with getri() to invert a matrix.
template<typename T>
int_t getri (Matrix< T > &A, Vector< int_t > &Pivot, Vector< T > &Work, const bool AbortOnError=true)
 invert a square matrix in place via LAPACK ?getri, using the LU factorization computed by getrf()
template<typename T>
int_t posv (Matrix< T > &A, Vector< T > &B, const bool AbortOnError=true)
 solve A * x = b for a symmetric ( real ) or Hermitian ( complex ) positive definite matrix via LAPACK ?posv ( Cholesky factorization, no pivoting )
template<typename T>
int_t posv (Matrix< T > &A, Matrix< T > &B, const bool AbortOnError=true)
 solve A * X = B for multiple right hand sides of a symmetric ( real ) or Hermitian ( complex ) positive definite matrix, see the vector version above
template<typename T>
auto operator- (const Matrix< T > &aA, const Matrix< T > &aB) -> decltype(aA.matrix_data() - aB.matrix_data())
template<typename A, typename B>
auto operator- (const Matrix< A > &aA, const B &aB) -> decltype(aA.matrix_data() - aB)
template<typename A, typename B>
auto operator- (const A &aA, const Matrix< B > &aB) -> decltype(aA - aB.matrix_data())
template<typename T>
auto operator+ (const Matrix< T > &aA, const Matrix< T > &aB) -> decltype(aA.matrix_data()+aB.matrix_data())
template<typename A, typename B>
auto operator+ (const Matrix< A > &aA, const B &aB) -> decltype(aA.matrix_data()+aB)
template<typename A, typename B>
auto operator+ (const A &aA, const Matrix< B > &aB) -> decltype(aA+aB.matrix_data())
template<typename T>
auto operator* (const Matrix< T > &aA, const Matrix< T > &aB) -> decltype(aA.matrix_data() *aB.matrix_data())
template<typename T>
auto operator* (const Matrix< T > &aA, const Vector< T > &aB) -> decltype(aA.matrix_data() *aB.vector_data())
template<typename A, typename B>
auto operator* (const Matrix< A > &aA, const B &aB) -> decltype(aA.matrix_data() *aB)
template<typename A, typename B>
auto operator* (const A &aA, const Matrix< B > &aB) -> decltype(aA *aB.matrix_data())
template<typename T>
auto operator/ (const Vector< T > &aA, const T &aB) -> decltype(aA.vector_data()/aB)
template<typename T>
auto operator- (const Vector< T > &aA, const Vector< T > &aB) -> decltype(aA.vector_data() - aB.vector_data())
template<typename A, typename B>
auto operator- (const Vector< A > &aA, const B &aB) -> decltype(aA.vector_data() - aB)
template<typename A, typename B>
auto operator- (const A &aA, const Vector< B > &aB) -> decltype(aA - aB.vector_data())
template<typename T>
auto operator+ (const Vector< T > &aA, const Vector< T > &aB) -> decltype(aA.vector_data()+aB.vector_data())
template<typename A, typename B>
auto operator+ (const Vector< A > &aA, const B &aB) -> decltype(aA.vector_data()+aB)
template<typename A, typename B>
auto operator+ (const A &aA, const Vector< B > &aB) -> decltype(aA+aB.vector_data())
template<typename A, typename B>
auto operator* (const Vector< A > &aA, const B &aB) -> decltype(aA.vector_data() *aB)
template<typename A, typename B>
auto operator* (const A &aA, const Vector< B > &aB) -> decltype(aA *aB.vector_data())
template<typename T>
Quaternion< T > operator+ (const Quaternion< T > &aLHS, const Quaternion< T > &aRHS)
template<typename T>
Quaternion< T > operator- (const Quaternion< T > &aLHS, const Quaternion< T > &aRHS)
template<typename T>
Quaternion< T > operator* (const Quaternion< T > &aLHS, T aScalar)
template<typename T>
Quaternion< T > operator* (T aScalar, const Quaternion< T > &aRHS)
template<typename T>
Quaternion< T > operator/ (const Quaternion< T > &aLHS, T aScalar)
template<typename T>
Quaternion< T > operator* (const Quaternion< T > &aLHS, const Quaternion< T > &aRHS)
template<typename T>
bool operator== (const Quaternion< T > &aLHS, const Quaternion< T > &aRHS)
template<typename T>
bool operator!= (const Quaternion< T > &aLHS, const Quaternion< T > &aRHS)
template<typename T>
dot (const Quaternion< T > &aLHS, const Quaternion< T > &aRHS)
template<typename T>
Quaternion< T > cross (const Quaternion< T > &aLHS, const Quaternion< T > &aRHS)
template<typename T>
Quaternion< T > slerp (const Quaternion< T > &aQ1, const Quaternion< T > &aQ2, T aT)
 Spherical linear interpolation between two quaternions.
template<typename T>
Quaternion< T > quaternion_from_rotation_matrix (const Matrix< T > &aMatrix)
 Extract a unit quaternion from a 3x3 rotation matrix.
template<typename T>
void quaternion_rotate_vector (const Quaternion< T > &aQ, const Vector< T > &aVector, Vector< T > &aResult)
 Rotate a 3D vector by a unit quaternion (optimized, in-place).
template<typename T>
void quaternion_to_rotation_matrix (const Quaternion< T > &aQ, Matrix< T > &aMatrix)
 Convert a unit quaternion to a 3x3 rotation matrix.
template<typename T>
Tensor< T > operator+ (const Tensor< T > &aB, const Tensor< T > &aC)
template<typename T>
Tensor< T > operator- (const Tensor< T > &aB, const Tensor< T > &aC)
template<typename T>
Tensor< T > operator% (const Tensor< T > &aA, const Tensor< T > &aB)
template<typename T>
Matrix< T > operator% (const Tensor< T > &aA, const Matrix< T > &aB)
template<typename T>
bool operator== (const Tensor< T > &aA, const Tensor< T > &aB)
template<typename T>
void compliance_matrix (const T &aE1, const T &aE2, const T &aE3, const T &aNu23, const T &aNu13, const T &aNu12, const T &aG23, const T &aG31, const T &aG12, Matrix< T > &aS)
template<typename T>
void ddot (const Tensor< T > &aA, const Tensor< T > &aB, Tensor< T > &aC)
template<typename T>
void ddot (const Tensor< T > &aA, const Matrix< T > &aB, Matrix< T > &aC)
template<typename T>
void fiber_polarization (const Matrix< T > &aC, Tensor< T > &aP)
 create the Hill polarization tensor P for a unidirectional fiber (transversely isotropic host); the Eshelby tensor follows as S = P : C.
template<typename T>
void kelvin_christoffel (const Tensor< T > &aA, const Vector< T > &aB, Matrix< T > &aC)
template<typename T>
void rotate (const Tensor< T > &aB, const Matrix< T > &aR, Tensor< T > &aA)
template<typename T>
void cardano (const T a, const T b, const T c, const T d, Vector< T > &X)
 solve a cubic equation a*x^3 + b*x^2 + c*x + d = 0 for its real roots (Cardano / trigonometric method).
template<typename T>
void cardano (const Vector< T > &A, Vector< T > &X)
void circle_from_points (const Vector< real > &aX, const Vector< real > &aY, Vector< real > &aCircle)
void create_beam_poly (const real aX1, const real aF1, const real adF1dX, const real aX2, const real aF2, const real adF2dX, Vector< real > &aCoefficients, Matrix< real > &aWork, Vector< int_t > &aPivot)
void create_beam_poly (const real aX1, const real aF1, const real adF1dX, const real aX2, const real aF2, const real adF2dX, Vector< real > &aCoefficients)
void create_fifth_order_beam_poly (const real aX1, const real aF1, const real adF1dX, const real ad2F1dX, const real aX2, const real aF2, const real adF2dX, const real ad2F2dX, Vector< real > &aCoefficients, Matrix< real > &aWork, Vector< int_t > &aPivot)
void create_fifth_order_beam_poly (const real aX1, const real aF1, const real adF1dX, const real ad2F1dX, const real aX2, const real aF2, const real adF2dX, const real ad2F2dX, Vector< real > &aCoefficients)
template<typename T>
void cubic_bezier (const Matrix< T > &aPoints, Vector< T > &aWork, const T &aXi, Vector< T > &aPoint)
template<typename T>
void cubic_bezier_derivative (const Matrix< T > &aPoints, Vector< T > &aWork, const T &aXi, Vector< T > &aPoint)
template<typename T>
void ferrari (const Vector< T > &A, Vector< T > &X)
 solve a quartic equation A(0)*x^4 + A(1)*x^3 + A(2)*x^2 + A(3)*x + A(4) = 0 for its real roots using Ferrari's method.
void find_interval (const Vector< real > &aData, const real aValue, index_t &aIndex, real &aXi)
template<typename T>
void hessian (const Matrix< T > &J, const Matrix< T > &K, Matrix< T > &H)
 Assemble the 9x9 chain-rule matrix H that maps physical first and second shape-function derivatives onto reference-space first and second derivatives for a 3D isoparametric element:
template<typename T>
quadratic_gradient (const Vector< T > &aF, const Vector< T > &aX, const index_t aIndex=1)
 compute the derivative of F to X at index
template<typename T>
void rotation_matrix (const Vector< T > &aAxis, const T &aAngle, Matrix< real > &aMatrix)
 rotate around an axis with an angle
template<typename T>
void rotation_matrix_strip (const Vector< T > &aAxis, const T &aAngle, Matrix< real > &aMatrix)
template<typename T>
void rotation_matrix (const T &aYaw, const T &aPitch, const T &aRoll, Matrix< real > &aMatrix)
 rotate using euler angles project from body to global according to DIN 9300
template<typename T>
sign (const T aX)
template<typename T>
void symratiospace (const T &aXmin, const T &aXmax, const T &aRatio, const index_t aN, Vector< T > &aX)
string to_string (const DomainType aDomainType)
DomainType domain_type (const string &aString)
EntityType entity_type (const string &aFieldLabel)
 guesses the type of the entity based on the passed field
string to_string (const EntityType aEntityType)
void ratio_ar2 (const real &aDeltaX0, const real &aLength, const index_t &aNumCells, Vector< real > &aX)
void ratio_adx2 (const real &aRatio, const real &aLength, const index_t &aNumCells, Vector< real > &aX)
real _check_ratio (const real &aDeltaX0, const real &aLength, const index_t &aNumCells, const real &aRatio)
std::string to_string (const GeometryType aGeometryType)
std::string to_string (const ElementType aElementType)
ElementType element_type (const std::string &aStr)
string to_string (const IntegrationScheme &aIntegrationScheme)
IntegrationScheme string_to_integration_scheme (const string &aString)
void intpoints (const enum IntegrationScheme aIntegrationScheme, const enum GeometryType aGeometryType, const uint aOrder, Vector< real > &aWeights, Matrix< real > &aPoints)
uint auto_integration_order (const ElementType aType)
 tries to automatically detect the appropriate integration order
SourceFunctionType boundary_condition_function_type (const string &aString)
void create_glue_poly (const real &aX, const real &aDeltaX, const Vector< real > &aF, Vector< real > &aC)
 consider an element such as
template<typename T>
void create_truss_poly (const Vector< T > &aX, const Vector< T > &aF, Vector< T > &aC)
 create a polynomial so that f = a*x^3 + b*x^2 + c*x + d
string to_string (const MaterialProperty aProperty)
 Convert material property enum to string.
unit get_unit (const MaterialProperty aProperty)
 Get the SI unit for a material property.
Meshcreate_database_mesh (const uint aOrder=2)
bool rho_database_is_current (const string &aPath)
 Test whether a cached rho database was written by the current format.
Vector< realoperator* (SpMatrix &aA, const Vector< real > &aX)
 multiply operator
string to_string (const SolverType aSolverType)
SolverType solver_type (const string &aString)
string to_string (const DistributedMatrixType aDistributedMatrixType)
DistributedMatrixType distributed_matrix_type (const string &aString)
DistributedMatrixType distributed_matrix_format (const string &aString)
string to_string (const EulerMethod aEulerMethod)
EulerMethod euler_method (const string &aString)
string to_string (const Preconditioner aPreconditioner)
Preconditioner preconditioner (const string &aString)
string to_string (const KrylovMethod aKrylovMethod)
KrylovMethod krylov_method (const string &aString)
string to_string (const ReorderingMethod aReorderingMethod)
ReorderingMethod reordering_method (const string &aString)
string to_string (const CompressionMethod aCompressionMethod)
CompressionMethod compression_method (const string &aString)
string to_string (const MumpsSerialReodrdering aSerialReodrdering)
MumpsSerialReodrdering serial_reordering (const string &aString)
std::string to_string (const MumpsParallelReodrdering aParallelReodrdering)
MumpsParallelReodrdering parallel_reordering (const string &aString)
string to_string (const MumpsBlockLowRanking aBLR)
MumpsBlockLowRanking block_low_ranking (const string &aString)
SpMatrixType matrix_type (const SolverType aType)
SpMatrixType preferred_matrix_format (SolverType aSolver)
real rcond (SpMatrix &aMatrix)
string petsctools_error_message (const PetscErrorCode aStatus)
PetscErrorCode petsctools_allocate_vector (MPI_Comm aComm, Vec &aVec, const PetscInt aGlobalLength, const PetscInt aLocalLength)
PetscErrorCode petsctools_set_vector (const Vector< PetscReal > &aVector, const Vector< PetscInt > &aIndices, Vec &aVec)
 convert a BELFEM vector to a PETSC vector aVac must have been initialized.
PetscErrorCode petsctools_get_vector (Vec &aVec, const Vector< PetscInt > &aIndices, Vector< PetscReal > &aVector)
 convert a PETSC vector to a BELFEM vector
PetscErrorCode petsctools_get_local_vector (Vec &aVec, Vector< PetscReal > &aVector)
 Extract the local portion of a distributed PETSC vector to a BELFEM vector.
PetscErrorCode petsctools_set_local_vector (const Vector< PetscReal > &aVector, Vec &aVec)
 Set the local portion of a distributed PETSC vector from a BELFEM vector.
PetscErrorCode petsctools_create_matrix (sparse::PETScAIJ *aDistMatrix, Mat &aMat)
PetscErrorCode petsctools_update_matrix (sparse::PETScAIJ *aDistMatrix, Mat &aMat)
PetscErrorCode petsctools_link_matrix (COMM_TYPE aComm, SpMatrix &aMatrix, Mat &aMat)
PetscErrorCode petsctools_notify_matrix_update (Mat &aMat)

Variables

constexpr int gMaxCommChunkLength = 64 * 1024
const std::string gLongName = "BELFEM -- The Berkeley Lab Finite Element Framework"
const std::string gURL = "http://belfem.lbl.gov"
greal gTbulk
greal gRhoMin
 minimim resistrivity in Ohm*m, default: 0
greal gRhoMax
 maximim resistrivity in Ohm*m, default: 1e10
gstring gBelfemDataPath
 path to belfem data files, set by environment variable $BELFEM_DATA
constexpr index_t gNoIndex = std::numeric_limits<index_t>::max()
constexpr id_t gNoID = std::numeric_limits<id_t>::max()
constexpr proc_t gNoOwner = std::numeric_limits<proc_t>::max()
constexpr real gTfreeze = 273.15
constexpr real gTref = 288.15
constexpr real gTroom = 293.15
constexpr real gTmin = 1.0
constexpr real gFinDiffDeltaT = 0.001
constexpr real gFinDiffDeltaB = 0.001
constexpr real gFinDiffDeltaAngle = 1.74532925199433e-3
constexpr real BELFEM_EPSILON = 10 * std::numeric_limits<real>::epsilon()
constexpr real BELFEM_EPS = std::numeric_limits<real>::epsilon()
constexpr real BELFEM_MESH_EPSILON = 1e-9
struct belfem::OpVertexDegree opVertexDegree
struct belfem::OpVertexID opVertexID
struct belfem::OpVertexIndex opVertexIndex
struct belfem::OpVertexLevel opVertexLevel
struct belfem::OpVertexOwner opVertexOwner
constexpr real gTAlphaSwitchMax = 273.15
 Upper bound for the thermal expansion split temperature [K].
constexpr size_t gNumNonConstantMaterialProperties = static_cast< size_t >( MaterialProperty::T_crit )
 Number of non-constant material properties.
constexpr size_t gNumMaterialProperties = static_cast< size_t >( MaterialProperty::UNDEFINED )
 Total number of material properties.
const SolverType gDefaultSolver = SolverType::UNDEFINED

Detailed Description

USER GUIDES:

look at : o src/fem/maxwell/matrices/mt_maxwell_phi.cpp o cl_IWG_StaticHeatConduction.cpp

  • if one adds new parameters, they must also be initialized in Communicator::set_globals()

    recommendation: use BELFEM_QUIET_NAN if there is no clear default value

  • if the value is not set on all procs, set value on master (aka root proc ) and synchronize using

    broadcast( T & value );

Typedef Documentation

◆ comm_t

typedef int belfem::comm_t

◆ cplx

typedef std::complex<real> belfem::cplx

◆ DefectFunc

typedef real belfem::DefectFunc(const real, const real, const real, const real)

◆ Graph

◆ HeatFunc

typedef real belfem::HeatFunc(const real, const real, const real, const real)

◆ herr_t

typedef int belfem::herr_t

◆ hid_t

typedef int belfem::hid_t

◆ hsize_t

typedef int belfem::hsize_t

◆ id_t

typedef unsigned int belfem::id_t

◆ index_t

typedef uint32_t belfem::index_t

◆ int_t

typedef int32_t belfem::int_t

◆ key128_t

typedef __uint128_t belfem::key128_t

◆ key_t

typedef long long unsigned int belfem::key_t

◆ lluint

typedef long long unsigned int belfem::lluint

◆ lsint

typedef long int belfem::lsint

◆ luint

typedef long unsigned int belfem::luint

◆ MaterialDependencyBitset

Bitset for tracking material property dependencies.

◆ MatFunc1

typedef real belfem::MatFunc1(const Material *, const real)

◆ MatFunc2

typedef real belfem::MatFunc2(const Material *, const real, const real)

◆ MatFunc3

typedef real belfem::MatFunc3(const Material *, const real, const real, const real)

◆ metis_t

typedef int belfem::metis_t

◆ proc_t

typedef int belfem::proc_t

◆ real

typedef double belfem::real

◆ scotch_t

typedef int belfem::scotch_t

◆ sint

typedef int belfem::sint

◆ size_t

◆ string

typedef std::string belfem::string

◆ suint

typedef short unsigned int belfem::suint

◆ uchar

typedef unsigned char belfem::uchar

◆ uint

typedef unsigned int belfem::uint

◆ unit

typedef std::array< real, 7 > belfem::unit

◆ UserFunc

typedef real belfem::UserFunc(const real)

◆ value

typedef std::pair< real, unit > belfem::value

Enumeration Type Documentation

◆ ArpackWhat

enum class belfem::ArpackWhat
strong
Enumerator
LambaMinMagn 
LambaMaxMagn 
LambaMinReal 
LambaMaxReal 
LambaMinImag 
LambaMaxImag 

◆ BezierType

enum class belfem::BezierType
strong
Enumerator
Horizontal 
Vertical 

◆ Bfunction

enum class belfem::Bfunction
strong
Enumerator
Gradient 
Planestress 
Voigt 
UNDEFINED 

◆ CompressionMethod

enum class belfem::CompressionMethod
strong
Enumerator
OFF 
BLR 
AUTOMATIC 
UNDEFINED 

◆ Connectivity

enum class belfem::Connectivity
strong
Enumerator
Compute 
NodeToVertex 
NodeToNode 
NodeToEdge 
NodeToFace 
NodeToFacet 
NodeToElement 
EdgeToVertex 
EdgeToNode 
EdgeToEdge 
EdgeToFace 
EdgeToFacet 
EdgeToElement 
FaceToVertex 
FaceToNode 
FaceToEdge 
FaceToFace 
FaceToFacet 
FaceToElement 
FacetToVertex 
FacetToNode 
FacetToEdge 
FacetToFace 
FacetToFacet 
FacetToElement 
ElementToVertex 
ElementToNode 
ElementToEdge 
ElementToFace 
ElementToFacet 
ElementToElement 
TsElementToTsElement 
ShellToShell 
ControlPointToControlPoint 
ElementToControlPoint 
ControlPointToElement 
UNDEFINED 

◆ DistributedMatrixType

enum class belfem::DistributedMatrixType
strong
Enumerator
AIJ 
CSR 
CSC 
UNDEFINED 

◆ DofManagerType

enum class belfem::DofManagerType
strong
Enumerator
OLD 
NEW 
UNDEFINED 

◆ DofMode

enum class belfem::DofMode
strong
Enumerator
AllBlocksEqual 
BlockSpecific 
UNDEFINED 

◆ DomainType

enum class belfem::DomainType
strong
Enumerator
Default 
Air 
Buffer 
Ferro 
Coil 
Conductor 
LeftCoating 
RightCoating 
Cut 
ThinShell 
Symmetry 
AntiSymmetry 
Periodic 
AirSymmetry 
AirAntiSymmetry 
AirPeriodic 
BufferSymmetry 
BufferAntiSymmetry 
BufferPeriodic 
ConductorSymmetry 
ConductorAntiSymmetry 
ConductorPeriodic 
FerroSymmetry 
FerroAntiSymmetry 
FerroPeriodic 
InterfaceCondAir 
InterfaceCondFerro 
InterfaceFerroAir 
InterfaceAirCoil 
InterfaceFerroCoil 
InterfaceTsCond 
InterfaceTsConnector 
BackgroundField 
Terminal 
Curve 
Inactive 
GeometryOnly 
Ghost 
EnrichedInterface 
Dirichlet 
Neumann 
ThermalAlpha 
UNDEFINED 

◆ EigenOutcome

enum class belfem::EigenOutcome
strong

how an eigenvalue diagnostic ended. The MASTER decides this and BROADCASTS it: every branch that may call run() again has to be taken from the same value on every rank, or the ranks part company inside a collective. Deriving it rank-locally from Ritz data is NOT safe – in a multi-rank build without PARPACK the workers' Ritz buffers are stale by construction ( see lambda_real() below )

Enumerator
Ok 

a usable value came back

NotConverged 

ARPACK ran out of restarts.

NotPositiveDefinite 

shift-invert returned lambda_min <= 0: the ratio is not a condition number

Complex 

the winning Ritz value is not real

Inconsistent 

shift-invert returned lambda_min > rho, which cannot be

Infeasible 

no legal ncv fits the basis budget, or no usable solver

SolverFailed 

the factorization or a frozen solve failed. NOT NotConverged ( that is ARPACK's ) and NOT Infeasible ( that is size/build ) – conflating them would send the reader after the wrong cause

◆ ElementType

enum class belfem::ElementType
strong

Element types.

Numeric values follow gmsh where a gmsh type exists ( QUAD16 = 32 deviates from gmsh's 36; element_type_from_gmsh() in meshtools.cpp bridges that; the *TS and HEX8TB values are BELFEM extensions ). must not be bigger than 255

Enumerator
EMPTY 
LINE2 
TRI3 
QUAD4 
TET4 
HEX8 
PENTA6 
PYRA5 
LINE3 
TRI6 
QUAD9 
TET10 
HEX27 
PENTA18 
PYRA14 
VERTEX 
QUAD8 
HEX20 
PENTA15 
PYRA13 
TRI10 
TRI15 
TRI21 
LINE4 
LINE5 
LINE6 
TET20 
TET35 
QUAD16 
HEX64 
QUAD4TS 
QUAD9TS 
HEX8TS 
PENTA6TS 
PENTA18TS 
HEX8TB 
UNDEFINED 

◆ EntityType

enum class belfem::EntityType
strong
Enumerator
NODE 
EDGE 
FACE 
CELL 
FACET 
ELEMENT 
CONTROLPOINT 
UNDEFINED 

◆ EulerMethod

enum class belfem::EulerMethod
strong
Enumerator
Static 
ForwardExplicit 
CrankNicolson 
Galerkin 
BackwardDifference1 
BackwardDifference2 
BackwardDifference3 
BackwardDifference4 
BackwardDifference5 
StiffnessOnly 
MassOnly 
Derivative 
UNDEFINED 

◆ FieldType

enum class belfem::FieldType
strong
Enumerator
SCALAR 
UNDEFINED 

◆ FileMode

enum class belfem::FileMode
strong
Enumerator
NEW 
OPEN_RDONLY 
OPEN_RDONLY_PARALLEL 
OPEN_RDWR 

◆ GasModel

enum class belfem::GasModel
strong
Enumerator
IDGAS 
SRK 
PR 
HELMHOLTZ 
UNDEFINED 

◆ GeometryType

enum class belfem::GeometryType
strong
Enumerator
VERTEX 
LINE 
TRI 
QUAD 
TET 
HEX 
PENTA 
PYRA 
UNDEFINED 

◆ GroupType

enum class belfem::GroupType
strong
Enumerator
BLOCK 
SIDESET 
UNDEFINED 

◆ HelmholtzModel

enum class belfem::HelmholtzModel
strong
Enumerator
ParaHydrogen 
NormalHydrogen 
OrthoHydrogen 
Oxygen 
Methane 
Nitrogen 
UNDEFINED 

◆ InfoLevel

enum class belfem::InfoLevel
strong
Enumerator
Silent 
Minimal 
Default 
Detailed 
Verbose 
Everything 

◆ IntegrationScheme

enum class belfem::IntegrationScheme
strong
Enumerator
GAUSS 
GAUSSCLASSIC 
LOBATTO 
UNDEFINED 

◆ InterpolationOrder

enum class belfem::InterpolationOrder
strong
Enumerator
CONSTANT 
LINEAR 
QUADRATIC 
SERENDIPITY 
CUBIC 
QUARTIC 
QUINTIC 
UNDEFINED 

◆ InterpolationType

enum class belfem::InterpolationType
strong
Enumerator
LAGRANGE 
HERMITE 
BERNSTEIN 
BubbleEdge0 
BubbleEdge1 
BubbleEdge2 
BubbleFace0 
BubbleFace1 
BubbleFace2 
BubbleFace3 
UNEFINED 

◆ IwgMode

enum class belfem::IwgMode
strong
Enumerator
Direct 
Iterative 
UNDEFINED 

◆ IwgType

enum class belfem::IwgType
strong
Enumerator
Poisson 
StaticHeatConduction 
TransientHeatConduction 
Gradient2D 
Gradient3D 
SurfaceGradient 
PlaneStress 
LinearElasticity 
Maxwell 
MaxwellThermal 
UNDEFINED 

◆ KrylovMethod

enum class belfem::KrylovMethod
strong

PETSC only.

Enumerator
PREONLY 
CG 
CGS 
IBCGS 
GMRES 
TFQMR 
BCGS 
AUTO 
UNDEFINED 

◆ MaterialDependency

enum class belfem::MaterialDependency
strong

Dependencies that material properties can have.

Enumerator
normB 
angleBxJ 
angleNxB 
normH 
normJ 
Jc 
rho 
UNDEFINED 

◆ MaterialProperty

enum class belfem::MaterialProperty
strong

All material properties that can be defined.

Properties are organized by category:

  • Physical: density, M (molar mass), q (atoms per molecule)
  • Mechanical: E, nu, alpha, Rp02
  • Thermal: cp, lambda, debye, gamma, beta
  • Electric: rho, rho_i, rho_0, kohler_trans, kohler_long, RRR
  • Magnetic: mu
  • Superconductor: jc, n, ec, T_crit, layer_thickness
  • Reference values: ref_density, T_ref_density, rho_i_ref, T_ref_rho_i, debye0K
  • Gas: R (specific gas constant), Gamma (impurity parameter)
  • Limits: T_max
Enumerator
density 
nu 
cp 
lambda 
mu 
rho 
alpha 
Rp02 
debye 
rho_i 
kohler_trans 
kohler_long 
T_crit 
Gamma 
T_max 
ref_density 
T_ref_density 
gamma 
beta 
debye0K 
rho_i_ref 
T_ref_rho_i 
A_bloch_gruen 
n_bloch_gruen 
RRR 
rho_0 
layer_thickness 
ec 
jc 
Tcurie 
A_electron_magnon 
A_spin_disorder 
grueneisen 
density_correction 
rho0_pure 
UNDEFINED 

◆ MaterialType

enum class belfem::MaterialType
strong

Material classification based on physical behavior.

Material types determine which properties are available and their dependencies:

  • UserDefined: Custom material with user-specified properties
  • Ferro: Ferromagnetic materials where permeability depends on H (T dependence planned)
  • HTS: High-temperature superconductors where rho and lambda depend on j, T, n×B and n·B
  • PureMetal: Noble metals where rho and lambda depend on j, T, and B
  • LookupAlloy: Metallic alloys where rho and lambda depend only on T (tabulated)
  • CompositeAlloy: Composite materials with orthotropic rho and lambda that depend on T
  • NonMetal: Non-metallic materials (e.g. Magnesia)
Enumerator
UserDefined 
Ferro 
HTS 
PureMetal 
LookupAlloy 
CompositeAlloy 
NonMetal 

◆ ModelDimensionality

enum class belfem::ModelDimensionality
strong
Enumerator
TwoD 
AxSymmX 
AxSymmY 
ThreeD 
UNDEFINED 

◆ MumpsBlockLowRanking

enum class belfem::MumpsBlockLowRanking
strong

MUMPS only.

Enumerator
Off 
Automatic 
FactorizationAndSolution 
FactorizationOnly 
UNDEFINED 

◆ MumpsErrorAnalysis

enum class belfem::MumpsErrorAnalysis
strong

MUMPS only.

Enumerator
None 
Full 
Main 
UNDEFINED 

◆ MumpsParallelReodrdering

MUMPS only.

Enumerator
AUTOMATIC 
PTSCOTCH 
PARMETIS 
UNDEFINED 

◆ MumpsSerialReodrdering

enum class belfem::MumpsSerialReodrdering
strong

MUMPS only.

Enumerator
AMD 
USERPIVOT 
AMF 
SCOTCH 
PORD 
METIS 
QAMD 
AUTOMATIC 
UNDEFINED 

◆ Nfunction

enum class belfem::Nfunction
strong
Enumerator
Scalar 
Vec2d 
Vec3d 
UNDEFINED 

◆ Preconditioner

enum class belfem::Preconditioner
strong

PETSC only.

Enumerator
NONE 
ASM 
GASM 
GAMG 
JACOBI 
BJACOBI 
LU 
ICC 
ILU 
HMG 
SPAI 
UNDEFINED 

◆ ReorderingMethod

enum class belfem::ReorderingMethod
strong
Enumerator
NATURAL 
METIS 
SCOTCH 
AUTOMATIC 
PARMETIS 
PTSCOTCH 
UNDEFINED 

◆ ResistivityLaw

enum class belfem::ResistivityLaw
strong

E-J law used for a superconductor's resistivity.

PowerLaw — power-law channel parallel to the normal-state channel ( Duron et al. 2004 ); the historical default. Piecewise — three-regime law: raw power law, Bézier flux-flow blend, normal state ( Rhyner 1993 exponent, log-log blend ). Riva — same parallel model as PowerLaw, but total over the full jc/n table range ( Riva 2021, EPFL thesis 8754 ): guarded against dead defects, under-/overflow and n → 1.

Enumerator
PowerLaw 
Piecewise 
Riva 

◆ SolverAlgorithm

enum class belfem::SolverAlgorithm
strong
Enumerator
Direct 
NewtonRaphson 
Picard 
UNDEFINED 

◆ SolverType

enum class belfem::SolverType
strong
Enumerator
UMFPACK 
SUPERLU 
MUMPS 
STRUMPACK 
PARDISO 
PETSc 
UNDEFINED 

◆ SourceFunctionType

enum class belfem::SourceFunctionType
strong
Enumerator
Constant 
Ramp 
Sigmoid 
Sine 
Square 
Triangle 
Sawtooth 
UserDefined 
UNDEFINED 

◆ SpMatrixIndexingBase

enum class belfem::SpMatrixIndexingBase
strong
Enumerator
Cpp 
Fortran 

◆ SpMatrixType

enum class belfem::SpMatrixType
strong
Enumerator
CSC 
CSR 
UNDEFINED 

◆ SymmetryMode

enum class belfem::SymmetryMode
strong
Enumerator
Unsymmetric 
PositiveDefiniteSymmetric 
GeneralSymmetric 
UNDEFINED 

Function Documentation

◆ _check_ratio()

real belfem::_check_ratio ( const real & aDeltaX0,
const real & aLength,
const index_t & aNumCells,
const real & aRatio )

◆ allreduce()

template<typename T>
void belfem::allreduce ( const T * aSend,
T * aRecv,
const int aCount )

Collective MAX-reduction visible on every rank.

The reduction operation is MPI_MAX and deliberately not a parameter: the wrapper exists to keep vendor tokens out of the solver files, and the sites it serves ( solver verdicts, test exit codes ) all fold "worst rank wins". A SUM consumer extends this file rather than passing an MPI_Op through it; the MIN sibling is allreduce_min() below.

The count is MPI's own int, not int_t: the MPI-3 C binding takes int, and under BELFEM_INT64 an int_t count would narrow silently above 2^31-1. Payloads here are a few elements - bulk data goes through the chunked share / receive pair, as everywhere else.

Collective over gComm.world(); every rank must call it, after gComm.init() like every other collective in this file.

◆ allreduce_min()

template<typename T>
void belfem::allreduce_min ( const T * aSend,
T * aRecv,
const int aCount )

Collective MIN-reduction visible on every rank.

The MIN sibling of allreduce(), for the sites that fold "the most constrained rank decides" – a per-process memory budget, where a rank that could not measure ( 0 ) must pull every rank to 0 rather than be outvoted. Same contract as allreduce(): arithmetic types, MPI's own int for the count, collective over gComm.world().

◆ append() [1/2]

template<typename T>
void belfem::append ( Cell< T > & aA,
const Cell< T > & aB )

◆ append() [2/2]

template<typename T>
void belfem::append ( Vector< T > & aA,
const Vector< T > & aB )

◆ append_move()

template<typename T>
void belfem::append_move ( Cell< T > & aTarget,
Cell< T > & aSource )

◆ auto_integration_order()

uint belfem::auto_integration_order ( const ElementType aType)

tries to automatically detect the appropriate integration order

Parameters
aType
Returns

◆ available_memory()

std::size_t belfem::available_memory ( )

Bytes a new allocation by this process can claim without swapping, or 0 when that cannot be established.

Linux: the kernel's MemAvailable estimate ( /proc/meminfo, kB ), NOT sysinfo().freeram – "free" excludes the reclaimable page cache, and on a workstation with a warm cache the two differ by an order of magnitude. Capped by the tightest cgroup memory limit above this process ( v2 memory.max / memory.current, v1 memory.limit_in_bytes / memory.usage_in_bytes ), because a batch scheduler enforces that limit and the host figure would overstate what the job may take. Darwin: Mach host statistics, free plus inactive pages. Other platforms: 0.

Setup-path code: the file reads are the one-off allocation doc/coding_philosophy.md allows there. Never aborts – a consumer treats 0 as "unknown" and falls back to whatever it did before.

◆ basename()

std::string belfem::basename ( const std::string & aFilePath)

returns the basename of a file

◆ block_low_ranking()

MumpsBlockLowRanking belfem::block_low_ranking ( const string & aString)

◆ boundary_condition_function_type()

SourceFunctionType belfem::boundary_condition_function_type ( const string & aString)

◆ broadcast() [1/6]

void belfem::broadcast ( Cell< string > & aData,
const proc_t aRoot )

◆ broadcast() [2/6]

template<typename T>
void belfem::broadcast ( Cell< T > & aData,
const proc_t aRoot = 0 )

Broadcasts a cell to all processes.

Template Parameters
TThe type of the cell elements.
Parameters
aDataThe cell to broadcast.
aRootThe root process rank (default is 0).

◆ broadcast() [3/6]

template<typename T>
void belfem::broadcast ( Matrix< T > & aData,
const proc_t aRoot = 0 )

Broadcasts a matrix to all processes.

Template Parameters
TThe type of the matrix elements.
Parameters
aDataThe matrix to broadcast.
aRootThe root process rank (default is 0).

◆ broadcast() [4/6]

template<typename T>
void belfem::broadcast ( T & aMessage,
const proc_t aRoot = 0,
typename std::enable_if< is_scalar< T >::value >::type * = nullptr )

Broadcasts a scalar value to all processes.

Template Parameters
TThe type of the scalar.
Parameters
aMessageThe scalar to broadcast.
aRootThe root process rank (default is 0).

◆ broadcast() [5/6]

template<typename T>
void belfem::broadcast ( T * aMessage,
const proc_t aRoot,
const proc_t aLength )

◆ broadcast() [6/6]

template<typename T>
void belfem::broadcast ( Vector< T > & aData,
const proc_t aRoot = 0 )

Broadcasts a vector to all processes.

Template Parameters
TThe type of the vector elements.
Parameters
aDataThe vector to broadcast.
aRootThe root process rank (default is 0).

◆ cardano() [1/2]

template<typename T>
void belfem::cardano ( const T a,
const T b,
const T c,
const T d,
Vector< T > & X )

solve a cubic equation a*x^3 + b*x^2 + c*x + d = 0 for its real roots (Cardano / trigonometric method).

Returns the distinct real roots in X, sorted ascending: 1 root for positive discriminant, 3 for the casus irreducibilis, 1 or 2 for repeated roots, and 0-2 via the quadratic/linear cascade when the leading coefficients vanish. Complex roots are never returned.

Caveats (audited 2026-07-23, Claude Fable + Codex, all live branches verified correct in exact arithmetic):

  • the epsilon tests on the coefficients and the discriminant are ABSOLUTE; callers should scale the polynomial to O(1) coefficients (the EoS and material solvers do).
  • the exact D == 0.0 repeated-root test only fires for exactly representable cases; NEAR-multiple roots take the D > 0 or D < 0 branch and lose roughly half the working digits to cancellation — inherent to closed-form solvers. In the D < 0 branch a near-double root can push the acos argument marginally outside [-1, 1] through roundoff; callers needing guaranteed behavior at multiple roots should prefer a companion-matrix eigensolve.
  • the quadratic fallback uses the naive formula and loses precision on the small root when c^2 >> |4*b*d|.

◆ cardano() [2/2]

template<typename T>
void belfem::cardano ( const Vector< T > & A,
Vector< T > & X )

◆ check_unit()

bool belfem::check_unit ( const value & aValue,
const string & aUnit )
inline

check if a value has the correct unit

◆ checkForDivisibility()

std::tuple< bool, uint, uint, int > belfem::checkForDivisibility ( Matrix< int > & aMat,
const uint k )

◆ circle_from_points()

void belfem::circle_from_points ( const Vector< real > & aX,
const Vector< real > & aY,
Vector< real > & aCircle )
inline

◆ clean_string()

std::string belfem::clean_string ( const std::string & aString)

tidy up the string

◆ collect() [1/5]

template<typename T>
void belfem::collect ( Cell< Matrix< T > > & aData)

Collects matrices from all processes into a cell.

Template Parameters
TThe type of the matrix elements.
Parameters
aDataThe cell to store collected matrices.

◆ collect() [2/5]

template<typename T>
void belfem::collect ( Cell< T > & aData,
const T aMyValue = 0 )

Collects scalar values from all processes into a cell.

Template Parameters
TThe type of the scalar.
Parameters
aDataThe cell to store collected values.
aMyValueThe value from the current process (default is 0).

◆ collect() [3/5]

template<typename T>
void belfem::collect ( Cell< Vector< T > > & aData,
Vector< T > aMyData = {} )

Collects vectors from all processes into a cell.

Template Parameters
TThe type of the vector elements.
Parameters
aDataThe cell to store collected vectors.
aMyDataThe vector contributed by this process.

◆ collect() [4/5]

template<typename T, typename U>
void belfem::collect ( T * aData,
const Vector< U > & aOffsets )

◆ collect() [5/5]

template<typename T>
void belfem::collect ( Vector< T > & aData,
const T aMyValue = 0 )

Collects scalar values from all processes into a vector.

Template Parameters
TThe type of the scalar.
Parameters
aDataThe vector to store collected values.
aMyValueThe value from the current process (default is 0).

◆ columnAdd()

template<typename T>
void belfem::columnAdd ( Matrix< T > & aMat,
const uint i,
const uint j,
const int q )

◆ columnAddOperation()

template<typename T>
void belfem::columnAddOperation ( Matrix< T > & aMat,
Matrix< T > & aR,
Matrix< T > & aR_,
const uint i,
const uint j,
const int q )

◆ columnExchange()

template<typename T>
void belfem::columnExchange ( Matrix< T > & aMat,
const uint i,
const uint j )

◆ columnExchangeOperation()

template<typename T>
void belfem::columnExchangeOperation ( Matrix< T > & aMat,
Matrix< T > & aR,
Matrix< T > & aR_,
const uint i,
const uint j )

◆ columnMultiply()

template<typename T>
void belfem::columnMultiply ( Matrix< T > & aMat,
const uint i )

◆ columnMultiplyOperation()

template<typename T>
void belfem::columnMultiplyOperation ( Matrix< T > & aMat,
Matrix< T > & aR,
Matrix< T > & aR_,
const uint i )

◆ combine() [1/3]

template<typename T>
void belfem::combine ( const Vector< T > & aA,
const Vector< T > & aB,
const Vector< T > & aC,
const Vector< T > & aD,
Vector< T > & aE )

◆ combine() [2/3]

template<typename T>
void belfem::combine ( const Vector< T > & aA,
const Vector< T > & aB,
const Vector< T > & aC,
Vector< T > & aD )

◆ combine() [3/3]

template<typename T>
void belfem::combine ( const Vector< T > & aA,
const Vector< T > & aB,
Vector< T > & aC )

◆ comm_abort()

void belfem::comm_abort ( const int aErrorCode = 1)

Kill the whole job.

Never returns.

This is the error-path twin of the collectives in commtools.hpp, and it obeys a stricter contract than they do ( see error_abort in assert.cpp, whose body this wrapper absorbed on 2026-08-30 ):

  • MPI_COMM_WORLD, never gComm.world(): world() indexes mComms( 0 ), which is EMPTY between MPI_Init and the push in Communicator::init. On an error path that indexing is a nested assert in debug and UB in release - and the nested assert would re-enter this function.
  • guarded by MPI_Initialized / MPI_Finalized, because MPI_Abort is erroneous before init and after finalize.
  • falls through to std::abort() unconditionally: MPI_Abort is a "best attempt" and is not required to return, and in a serial build the caller ( assert::error ) relies on this function not returning - returning would resume execution after a failed check.
  • never routed through comm_check or BELFEM_ERROR: both can land back here, which is recursion on the error path.

Defined in commtools.cpp, like comm_barrier.

◆ comm_barrier()

void belfem::comm_barrier ( )

Synchronizes all processes in the communicator.

◆ comm_check()

void belfem::comm_check ( const int aErrorCode)

Checks the MPI error code and reports any errors.

Parameters
aErrorCodeThe MPI error code to check.

◆ comm_drain_check()

void belfem::comm_drain_check ( const char * aLabel)

Debug-build tripwire for the two-tags-per-pair ordering contract of the point-to-point fabric ( see comm_tag() in commtools.cpp ).

Call at an exchange boundary: a point every rank passes with no exchange in flight. The check synchronizes, probes both fabric tags of every rank pair this rank belongs to ( comm_tag( rank, p ) and +1, never MPI_ANY_TAG – solver libraries share MPI_COMM_WORLD ), folds the verdict through allreduce, and on a hit raises BELFEM_ERROR on EVERY rank – detecting ranks name boundary/source/tag/bytes, the others point at the peer's error box. The collective verdict keeps the debug throw policy intact ( assert.cpp: debug throws, on every rank alike ) without stranding peers in a barrier, and doubles as the fence that stops a fast rank from sending the next exchange's first message into a peer's still-running sweep. So a stray dies loudly at the boundary where it was born instead of poisoning an innocent recv an arbitrary distance later.

aLabel names the boundary in the diagnostic and must not be null.

Collective wherever assertions are active; a call site reachable by a subset of ranks is itself a deadlock, same contract as comm_barrier. Compiles to a no-op in release builds and does nothing in serial runs. Best-effort by nature: a barrier does not flush unmatched messages, so a stray still in flight when the sweep runs can escape it – absence of an abort is not proof of a clean fabric – and a stray carrying a tag outside the pair's two fabric tags is invisible to it.

◆ comm_rank()

proc_t belfem::comm_rank ( )

Returns the rank of the current process in the communicator.

Returns
The rank of the current process.

◆ comm_size()

proc_t belfem::comm_size ( )

Returns the number of processes in the communicator.

Returns
The number of processes.

◆ comm_split()

Cell< int > belfem::comm_split ( const index_t aLength)

Splits a message into chunks for MPI communication.

Parameters
aLengthThe length of the message to split.
Returns
A cell containing the sizes of each chunk.

◆ comm_splitcount() [1/2]

index_t belfem::comm_splitcount ( const Vector< index_t > & aLengths,
const proc_t aRoot )

Calculates the total number of chunks needed for a set of message lengths.

Parameters
aLengthsVector of message lengths.
aRootThe root process rank.
Returns
The total number of chunks.

◆ comm_splitcount() [2/2]

index_t belfem::comm_splitcount ( index_t aLength)

◆ comm_tag()

int belfem::comm_tag ( const proc_t aSource,
const proc_t aTarget )

Generates a unique tag for MPI communication between two processes.

Parameters
aSourceThe source process rank.
aTargetThe target process rank.
Returns
A unique tag for communication.

◆ comm_type()

template<typename T>
comm_t belfem::comm_type ( )

returns the MPI datatype handle for T

◆ compliance_matrix()

template<typename T>
void belfem::compliance_matrix ( const T & aE1,
const T & aE2,
const T & aE3,
const T & aNu23,
const T & aNu13,
const T & aNu12,
const T & aG23,
const T & aG31,
const T & aG12,
Matrix< T > & aS )
inline

◆ compression_method()

CompressionMethod belfem::compression_method ( const string & aString)

◆ cpu_info()

std::string belfem::cpu_info ( )

grabs the cpu info for the banner

◆ create_beam_poly() [1/2]

void belfem::create_beam_poly ( const real aX1,
const real aF1,
const real adF1dX,
const real aX2,
const real aF2,
const real adF2dX,
Vector< real > & aCoefficients )
inline

◆ create_beam_poly() [2/2]

void belfem::create_beam_poly ( const real aX1,
const real aF1,
const real adF1dX,
const real aX2,
const real aF2,
const real adF2dX,
Vector< real > & aCoefficients,
Matrix< real > & aWork,
Vector< int_t > & aPivot )
inline

◆ create_database_mesh()

Mesh * belfem::create_database_mesh ( const uint aOrder = 2)
inline

◆ create_fifth_order_beam_poly() [1/2]

void belfem::create_fifth_order_beam_poly ( const real aX1,
const real aF1,
const real adF1dX,
const real ad2F1dX,
const real aX2,
const real aF2,
const real adF2dX,
const real ad2F2dX,
Vector< real > & aCoefficients )
inline

◆ create_fifth_order_beam_poly() [2/2]

void belfem::create_fifth_order_beam_poly ( const real aX1,
const real aF1,
const real adF1dX,
const real ad2F1dX,
const real aX2,
const real aF2,
const real adF2dX,
const real ad2F2dX,
Vector< real > & aCoefficients,
Matrix< real > & aWork,
Vector< int_t > & aPivot )
inline

◆ create_glue_poly()

void belfem::create_glue_poly ( const real & aX,
const real & aDeltaX,
const Vector< real > & aF,
Vector< real > & aC )

consider an element such as

f(x) ^ | (X-dX) (X) (X+dX) . o -— o -— o --> X 0 1 2

This function creates a polynomial of the shape

f = a*x^4 + b*x^3 + c*x^2 + d*x + e

Parameters
aX
aDeltaX
aF= { f0, dfdx0, f1, f2, dfdx2 }
aC= { a, b, c, d, e }

◆ create_truss_poly()

template<typename T>
void belfem::create_truss_poly ( const Vector< T > & aX,
const Vector< T > & aF,
Vector< T > & aC )

create a polynomial so that f = a*x^3 + b*x^2 + c*x + d

Template Parameters
T
Parameters
aX= { x0, x1 }
aF= { f0, dfdx0, f1, dfdx1 }
aC= { a, b, c, d }

◆ cross() [1/7]

template<typename ET>
auto belfem::cross ( const ET & aA,
const ET & aB ) -> decltype(arma::cross(aA, aB))

◆ cross() [2/7]

template<typename ET>
auto belfem::cross ( const ET & aA,
const ET & aB ) -> decltype(blaze::cross(aA, aB))

◆ cross() [3/7]

template<typename ET, typename T>
auto belfem::cross ( const ET & aA,
const Vector< T > & aB ) -> decltype(arma::cross(aA, aB.vector_data()))

◆ cross() [4/7]

template<typename ET, typename T>
auto belfem::cross ( const ET & aA,
const Vector< T > & aB ) -> decltype(blaze::cross(aA, aB.vector_data()))

◆ cross() [5/7]

template<typename T>
Quaternion< T > belfem::cross ( const Quaternion< T > & aLHS,
const Quaternion< T > & aRHS )

◆ cross() [6/7]

template<typename T, typename ET>
auto belfem::cross ( Vector< T > & aA,
const ET & aB ) -> decltype(arma::cross(aA.vector_data(), aB))

◆ cross() [7/7]

template<typename T, typename ET>
auto belfem::cross ( Vector< T > & aA,
const ET & aB ) -> decltype(blaze::cross(aA.vector_data(), aB))

◆ cubic_bezier()

template<typename T>
void belfem::cubic_bezier ( const Matrix< T > & aPoints,
Vector< T > & aWork,
const T & aXi,
Vector< T > & aPoint )

◆ cubic_bezier_derivative()

template<typename T>
void belfem::cubic_bezier_derivative ( const Matrix< T > & aPoints,
Vector< T > & aWork,
const T & aXi,
Vector< T > & aPoint )

◆ datatype_string()

template<typename T>
std::string belfem::datatype_string ( )
inline

◆ datatype_string< bool >()

template<>
std::string belfem::datatype_string< bool > ( )
inline

◆ datatype_string< double >()

template<>
std::string belfem::datatype_string< double > ( )
inline

◆ datatype_string< int >()

template<>
std::string belfem::datatype_string< int > ( )
inline

◆ datatype_string< long unsigned int >()

template<>
std::string belfem::datatype_string< long unsigned int > ( )
inline

◆ datatype_string< std::complex< double > >()

template<>
std::string belfem::datatype_string< std::complex< double > > ( )
inline

◆ datatype_string< std::string >()

template<>
std::string belfem::datatype_string< std::string > ( )
inline

◆ datatype_string< unsigned int >()

template<>
std::string belfem::datatype_string< unsigned int > ( )
inline

◆ ddot() [1/2]

template<typename T>
void belfem::ddot ( const Tensor< T > & aA,
const Matrix< T > & aB,
Matrix< T > & aC )
inline

◆ ddot() [2/2]

template<typename T>
void belfem::ddot ( const Tensor< T > & aA,
const Tensor< T > & aB,
Tensor< T > & aC )
inline

◆ det() [1/5]

template<typename T>
auto belfem::det ( const T & A) -> decltype(arma::det(A))

◆ det() [2/5]

template<typename T>
auto belfem::det ( const T & A) -> decltype(blaze::det(A))

◆ det() [3/5]

template<typename T>
auto belfem::det ( Matrix< T > & aA) -> decltype(det(aA.matrix_data()))

◆ det() [4/5]

template<typename T>
auto belfem::det ( T & A) -> decltype(arma::det(A))

◆ det() [5/5]

template<typename T>
auto belfem::det ( T & A) -> decltype(blaze::det(A))

◆ dirname()

std::string belfem::dirname ( const std::string & aFilePath)

returns the directory name of a file

◆ distribute() [1/6]

template<typename T>
void belfem::distribute ( Cell< Cell< T > > & aData)

Distributes a collection of cells to other processes.

Template Parameters
TThe type of the cell elements.
Parameters
aDataThe collection of cells to distribute.

◆ distribute() [2/6]

template<typename T>
void belfem::distribute ( Cell< Matrix< T > > & aData)

Distributes a collection of matrices to other processes.

Template Parameters
TThe type of the matrix elements.
Parameters
aDataThe collection of matrices to distribute.

◆ distribute() [3/6]

template<typename T>
void belfem::distribute ( Cell< T > & aData)

Distributes elements of a cell to other processes.

Template Parameters
TThe type of the cell elements.
Parameters
aDataThe cell to distribute.

◆ distribute() [4/6]

template<typename T>
void belfem::distribute ( Cell< Vector< T > > & aData)

Distributes a collection of vectors to other processes.

Template Parameters
TThe type of the vector elements.
Parameters
aDataThe collection of vectors to distribute.

◆ distribute() [5/6]

template<typename T, typename U>
void belfem::distribute ( const T * aData,
const Vector< U > & aOffsets )

Distributes a raw vector based on lengths and offsets.

Template Parameters
TThe type of the array elements.
Parameters
aDataPointer to the contiguous array to distribute.
aOffsetsoffsets per proc

◆ distribute() [6/6]

template<typename T>
void belfem::distribute ( Vector< T > & aData)

Distributes elements of a vector to other processes.

Template Parameters
TThe type of the vector elements.
Parameters
aDataThe vector to distribute.

◆ distributed_matrix_format()

DistributedMatrixType belfem::distributed_matrix_format ( const string & aString)

◆ distributed_matrix_type()

DistributedMatrixType belfem::distributed_matrix_type ( const string & aString)

◆ domain_type()

DomainType belfem::domain_type ( const string & aString)

◆ dot() [1/22]

template<typename MT, bool SO, bool SF, bool DF, typename ET>
auto belfem::dot ( const blaze::Columns< MT, SO, SF, DF > & aA,
const ET & aB ) -> decltype(blaze::dot(blaze::column(aA, 0UL), aB))

◆ dot() [2/22]

template<typename MT, bool SO, bool SF, bool DF, typename T>
T belfem::dot ( const blaze::Columns< MT, SO, SF, DF > & aA,
const Vector< T > & aB )

◆ dot() [3/22]

template<typename MT1, bool SO1, bool SF1, bool DF1, typename MT2, bool SO2, bool SF2, bool DF2>
auto belfem::dot ( const blaze::Columns< MT1, SO1, SF1, DF1 > & aA,
const blaze::Columns< MT2, SO2, SF2, DF2 > & aB ) -> decltype(blaze::dot(blaze::column(aA, 0UL), blaze::column(aB, 0UL)))

◆ dot() [4/22]

template<typename MT1, bool SO1, bool SF1, bool DF1, typename MT2, bool SO2, bool SF2, bool DF2>
auto belfem::dot ( const blaze::Columns< MT1, SO1, SF1, DF1 > & aA,
const blaze::Rows< MT2, SO2, SF2, DF2 > & aB ) -> decltype(blaze::dot(blaze::column(aA, 0UL), blaze::row(aB, 0UL)))

◆ dot() [5/22]

template<typename MT, bool SO, bool SF, bool DF, typename ET>
auto belfem::dot ( const blaze::Rows< MT, SO, SF, DF > & aA,
const ET & aB ) -> decltype(blaze::dot(blaze::row(aA, 0UL), aB))

◆ dot() [6/22]

template<typename MT, bool SO, bool SF, bool DF, typename T>
T belfem::dot ( const blaze::Rows< MT, SO, SF, DF > & aA,
const Vector< T > & aB )

◆ dot() [7/22]

template<typename MT1, bool SO1, bool SF1, bool DF1, typename MT2, bool SO2, bool SF2, bool DF2>
auto belfem::dot ( const blaze::Rows< MT1, SO1, SF1, DF1 > & aA,
const blaze::Columns< MT2, SO2, SF2, DF2 > & aB ) -> decltype(blaze::dot(blaze::row(aA, 0UL), blaze::column(aB, 0UL)))

◆ dot() [8/22]

template<typename MT1, bool SO1, bool SF1, bool DF1, typename MT2, bool SO2, bool SF2, bool DF2>
auto belfem::dot ( const blaze::Rows< MT1, SO1, SF1, DF1 > & aA,
const blaze::Rows< MT2, SO2, SF2, DF2 > & aB ) -> decltype(blaze::dot(blaze::row(aA, 0UL), blaze::row(aB, 0UL)))

◆ dot() [9/22]

template<typename ET, typename MT, bool SO, bool SF, bool DF>
auto belfem::dot ( const ET & aA,
const blaze::Columns< MT, SO, SF, DF > & aB ) -> decltype(blaze::dot(aA, blaze::column(aB, 0UL)))

◆ dot() [10/22]

template<typename ET, typename MT, bool SO, bool SF, bool DF>
auto belfem::dot ( const ET & aA,
const blaze::Rows< MT, SO, SF, DF > & aB ) -> decltype(blaze::dot(aA, blaze::row(aB, 0UL)))

◆ dot() [11/22]

template<typename ET>
auto belfem::dot ( const ET & aA,
const ET & aB ) -> decltype(arma::dot(aA, aB))

◆ dot() [12/22]

template<typename ET, typename T>
auto belfem::dot ( const ET & aA,
const Vector< T > & aB ) -> decltype(arma::dot(aA, aB.vector_data()))

◆ dot() [13/22]

template<typename ET, typename T>
auto belfem::dot ( const ET & aA,
const Vector< T > & aB ) -> decltype(blaze::dot(aA, aB.vector_data()))

◆ dot() [14/22]

template<typename ET1, typename ET2>
auto belfem::dot ( const ET1 & aA,
const ET2 & aB ) -> decltype(blaze::dot(aA, aB))

◆ dot() [15/22]

template<typename T>
auto belfem::dot ( const Matrix< T > & aA,
const Vector< T > & aB ) -> decltype(blaze::dot(aA.matrix_data(), aB.vector_data()))

◆ dot() [16/22]

template<typename T>
T belfem::dot ( const Quaternion< T > & aLHS,
const Quaternion< T > & aRHS )

◆ dot() [17/22]

template<typename T, typename MT, bool SO, bool SF, bool DF>
T belfem::dot ( const Vector< T > & aA,
const blaze::Columns< MT, SO, SF, DF > & aB )

◆ dot() [18/22]

template<typename T, typename MT, bool SO, bool SF, bool DF>
T belfem::dot ( const Vector< T > & aA,
const blaze::Rows< MT, SO, SF, DF > & aB )

◆ dot() [19/22]

template<typename T, typename ET>
auto belfem::dot ( const Vector< T > & aA,
const ET & aB ) -> decltype(blaze::dot(aA.vector_data(), aB))

◆ dot() [20/22]

template<typename T>
auto belfem::dot ( const Vector< T > & aA,
const Matrix< T > & aB ) -> decltype(blaze::dot(aA.vector_data(), aB.matrix_data()))

◆ dot() [21/22]

template<typename T>
auto belfem::dot ( const Vector< T > & aA,
const Vector< T > & aB ) -> decltype(blaze::dot(aA.vector_data(), aB.vector_data()))

◆ dot() [22/22]

template<typename T, typename ET>
auto belfem::dot ( Vector< T > & aA,
const ET & aB ) -> decltype(arma::dot(aA.vector_data(), aB))

◆ element_type()

ElementType belfem::element_type ( const std::string & aStr)
inline

◆ entity_type()

EntityType belfem::entity_type ( const string & aFieldLabel)

guesses the type of the entity based on the passed field

◆ euler_method()

EulerMethod belfem::euler_method ( const string & aString)

◆ exec()

std::string belfem::exec ( const std::string & aCommand)

◆ ferrari()

template<typename T>
void belfem::ferrari ( const Vector< T > & A,
Vector< T > & X )

solve a quartic equation A(0)*x^4 + A(1)*x^3 + A(2)*x^2 + A(3)*x + A(4) = 0 for its real roots using Ferrari's method.

Returns the distinct real roots in X, sorted ascending (0 to 4 entries; multiple roots are reported once, matching the cardano() convention). Degenerates to cardano() when A(0) ~ 0.

Method: depress with x = y - a/4 to y^4 + P y^2 + Q y + R = 0, solve the resolvent cubic z^3 + 2P z^2 + (P^2 - 4R) z - Q^2 = 0, take its largest root z = s^2 (which is >= 0 because the cubic is negative at z = 0), and split into the two quadratic factors ( y^2 + s*y + (P + z - Q/s)/2 ) * ( y^2 - s*y + (P + z + Q/s)/2 ). The Q ~ 0 case is handled separately as a biquadratic (this also covers s -> 0, which cannot occur on the general path since the resolvent's root product is Q^2).

Caveats (same class as cardano):

  • epsilon tests are absolute; scale the coefficients to O(1) first.
  • near multiple roots, closed-form solvers lose about half the working digits; slightly negative discriminants at double roots are clamped to zero within BELFEM_EPSILON. Where guaranteed robustness at double roots matters (e.g. grazing-eclipse detection), prefer a 4x4 companion-matrix eigensolve instead.

(Implementation completed + three-way verified 2026-07-23: the resolvent/factorization formulas were derived independently by Claude and Codex and agree; validated numerically against known quartics and random-coefficient sweeps.)

◆ fiber_polarization()

template<typename T>
void belfem::fiber_polarization ( const Matrix< T > & aC,
Tensor< T > & aP )
inline

create the Hill polarization tensor P for a unidirectional fiber (transversely isotropic host); the Eshelby tensor follows as S = P : C.

see doi: 10.1016/S0020-7683(02)00369-4.

◆ file_exists()

bool belfem::file_exists ( const std::string & aPath)

this function tests if a file exists

Parameters
aPath
Returns

◆ filename()

std::string belfem::filename ( const std::string & aFilePath)

returns the name of a file without the path

◆ filetype()

std::string belfem::filetype ( const std::string & aFilePath)

returns the filetype of a file

◆ find_index_in_unique_cell()

template<typename T>
index_t belfem::find_index_in_unique_cell ( const Cell< T > & aCell,
const T & aMember )

returns the position of a member inside a cell.

The cell must be unique and sorted for this function to work.

◆ find_interval()

void belfem::find_interval ( const Vector< real > & aData,
const real aValue,
index_t & aIndex,
real & aXi )
inline

◆ first_word()

string belfem::first_word ( const std::string & aString,
char aDelimiter )

return the first word of the string

◆ format_with_leading_zeros()

string belfem::format_with_leading_zeros ( const uint aNumber)

◆ gees()

template<typename T>
int_t belfem::gees ( Matrix< T > & A,
Vector< lapack::cplx_t< T > > & W,
Matrix< T > & VS,
Vector< lapack::real_t< T > > & Work,
Vector< int_t > & BWork,
lapack::gees_select_t< T > select = nullptr,
const char jobvs = 'V',
const char sort = 'N',
int_t * aSdim = nullptr,
const bool AbortOnError = true )

Schur decomposition of a general square matrix via LAPACK ?gees: A = Z * T * Z^T for the real flavors, A = Z * T * Z^H for the complex ones.

Parameters
[in,out]Asquare input matrix; overwritten with the Schur form T — upper triangular for complex T, quasi upper triangular with 2x2 blocks for the complex conjugate eigenvalue pairs of the real flavors
[out]Wthe n eigenvalues — always complex valued
[out]VSSchur vectors Z, resized to n x n for jobvs = 'V'; untouched for 'N'
[in,out]Worksingle real-valued scratch, grown to the optimal size on first use: LAPACK's work array in its head ( for complex T reinterpreted in place ), the real scratch in its tail — wr/wi ( 2*n ) for real T, rwork ( n ) for complex T. No internal allocation.
[in,out]BWorkLOGICAL scratch, referenced only when sorting; grown to n entries for sort = 'S'
[in]selectmoves the selected eigenvalues to the top left of the Schur form when sort = 'S'; pass nullptr with sort = 'N'. NOTE for real T: a complex conjugate pair is selected as a whole if select is true for EITHER member, and it counts as TWO towards sdim — so sdim can differ from the number of true returns, and can come out odd when reals and pairs mix
[in]jobvs'V' or 'N'
[in]sort'S' or 'N'
[out]aSdimif given, receives the number of selected eigenvalues
[in]AbortOnErrorabort on info != 0, or return info
Returns
info 0 on success; > 0: <= n the QR iteration failed, n+1 reordering failed because some eigenvalues are too close to separate, n+2 roundoff changed the leading eigenvalues after reordering

◆ geev() [1/2]

template<typename T>
int_t belfem::geev ( Matrix< T > & A,
Vector< lapack::cplx_t< T > > & W,
Matrix< T > & VL,
Matrix< T > & VR,
Vector< lapack::real_t< T > > & Work,
const char jobvl = 'V',
const char jobvr = 'V',
const bool AbortOnError = true )

eigenvalues and eigenvectors of a general square matrix, A * v = lambda * v, via LAPACK ?geev

Parameters
[in,out]Asquare input matrix; destroyed by the call
[out]Wthe n eigenvalues — always complex valued
[out]VLleft eigenvectors, resized to n x n for jobvl = 'V'; untouched for 'N'
[out]VRright eigenvectors, likewise for jobvr. For real T, a complex conjugate eigenvalue pair ( W(j), W(j+1) ) stores its eigenvectors LAPACK-packed across two consecutive columns: v_j = VR(:,j) + i * VR(:,j+1) and v_{j+1} = conj( v_j )
[in,out]Worksingle real-valued scratch, grown to the optimal size on first use: LAPACK's work array in its head ( for complex T reinterpreted in place, two reals per entry ), the 2*n real scratch ( wr/wi for real T, rwork for complex T ) in its tail — no internal allocation
[in]jobvl'V' or 'N'
[in]jobvr'V' or 'N'
[in]AbortOnErrorabort on info != 0, or return info
Returns
info 0 on success; > 0: the QR iteration failed — eigenvalues info+1 .. n have converged, no eigenvectors were computed

◆ geev() [2/2]

template<typename T>
int_t belfem::geev ( Matrix< T > & A,
Vector< lapack::cplx_t< T > > & W,
Vector< lapack::real_t< T > > & Work,
const bool AbortOnError = true )

eigenvalues only of a general square matrix, see the full version above

Parameters
[in,out]Asquare input matrix; destroyed by the call
[out]Wthe n eigenvalues — always complex valued
[in,out]Worksingle real-valued scratch as in the full version; no internal allocation
[in]AbortOnErrorabort on info != 0, or return info
Returns
info 0 on success; > 0: the QR iteration failed

◆ gels() [1/2]

template<typename T>
int_t belfem::gels ( Matrix< T > & A,
Matrix< T > & B,
Vector< T > & Work,
const bool AbortOnError = true )

solve min || A * X - B || for multiple right hand sides, see the single right hand side version above

Parameters
[in,out]Am x n system matrix; overwritten with the QR or LQ factorization
[in,out]Bright hand sides in columns; must have at least max( m, n ) rows
[in,out]Workscratch, grown to the optimal size on first use
[in]AbortOnErrorabort on info != 0, or return info
Returns
info 0 on success; > 0: A is rank deficient

◆ gels() [2/2]

template<typename T>
int_t belfem::gels ( Matrix< T > & A,
Vector< T > & B,
Vector< T > & Work,
const bool AbortOnError = true )

solve the least squares problem min || A * x - b || via LAPACK ?gels ( QR or LQ factorization, A must have full rank )

Parameters
[in,out]Am x n system matrix; overwritten with the QR ( m >= n ) or LQ ( m < n ) factorization
[in,out]Bright hand side on input ( first m entries ), solution on output ( first n entries ); must be allocated with at least max( m, n ) entries
[in,out]Workscratch, grown to the optimal size on first use
[in]AbortOnErrorabort on info != 0, or return info
Returns
info 0 on success; > 0: a diagonal entry of the triangular factor is zero, A is rank deficient and no solution was computed

◆ gemm()

template<typename T>
void belfem::gemm ( const Matrix< T > & A,
const Matrix< T > & B,
Matrix< T > & C,
const T alpha = 1.0,
const T beta = 0.0,
const char transa = 'N',
const char transb = 'N' )

matrix-matrix product C := alpha * op(A) * op(B) + beta * C via BLAS ?gemm, where op is the identity ( trans = 'N' ) or the ( conjugate ) transpose ( 'T' / 'C' )

Parameters
[in]Aleft operand, stored form
[in]Bright operand, stored form
[in,out]Cresult; resized to op(A) * op(B) when beta is zero, otherwise it must already have that shape
[in]alphascaling of the product ( default 1 )
[in]betascaling of the accumulator ( default 0 )
[in]transa'N', 'T' or 'C' for op(A)
[in]transb'N', 'T' or 'C' for op(B)

◆ gesv() [1/2]

template<typename T>
int_t belfem::gesv ( Matrix< T > & A,
Matrix< T > & B,
Vector< int_t > & Pivot,
const bool AbortOnError = true )

solve A * X = B for multiple right hand sides via LAPACK ?gesv, see the vector version above

Parameters
[in,out]Asquare system matrix; overwritten with the LU factors
[in,out]Bright hand sides in columns on input, solutions on output
[out]Pivotpivot indices, at least n entries
[in]AbortOnErrorabort on info != 0, or return info
Returns
info 0 on success; > 0: U(info,info) is exactly zero

◆ gesv() [2/2]

template<typename T>
int_t belfem::gesv ( Matrix< T > & A,
Vector< T > & B,
Vector< int_t > & Pivot,
const bool AbortOnError = true )

solve the square linear system A * x = b via LAPACK ?gesv ( LU factorization with partial pivoting )

Parameters
[in,out]Asquare system matrix; overwritten with the LU factors
[in,out]Bright hand side on input, solution on output
[out]Pivotpivot indices, at least n entries
[in]AbortOnErrorabort on info != 0 ( default ); pass false to receive info instead, e.g. inside iterative schemes that recover from a singular matrix
Returns
info 0 on success; > 0: U(info,info) is exactly zero

◆ gesvd()

template<typename T>
int_t belfem::gesvd ( Matrix< T > & A,
Vector< lapack::real_t< T > > & S,
Matrix< T > & U,
Matrix< T > & VT,
Vector< lapack::real_t< T > > & Work,
const char jobu = 'A',
const char jobvt = 'A',
const bool AbortOnError = true )

singular value decomposition A = U * diag( S ) * VT via LAPACK ?gesvd

Parameters
[in,out]Am x n input matrix; destroyed by the call
[out]Sthe min( m, n ) singular values, descending — always real valued, also for complex A
[out]Uleft singular vectors; resized to m x m for jobu = 'A', m x min( m, n ) for 'S', untouched for 'N'
[out]VTtransposed right singular vectors; resized to n x n for jobvt = 'A', min( m, n ) x n for 'S', untouched for 'N'
[in,out]Worksingle real-valued scratch, grown to the optimal size on first use: LAPACK's work array in its head ( for complex T reinterpreted in place, two reals per entry ), the complex-only 5*min( m, n ) real scratch rwork in its tail — no internal allocation
[in]jobu'A', 'S' or 'N' ( 'O' is not supported )
[in]jobvt'A', 'S' or 'N' ( 'O' is not supported )
[in]AbortOnErrorabort on info != 0, or return info
Returns
info 0 on success; > 0: the QR iteration did not converge

◆ get_unit()

unit belfem::get_unit ( const MaterialProperty aProperty)

Get the SI unit for a material property.

◆ getrf()

template<typename T>
int_t belfem::getrf ( Matrix< T > & A,
Vector< int_t > & Pivot,
const bool AbortOnError = true )

LU factorization with partial pivoting via LAPACK ?getrf, A = P * L * U; use together with getri() to invert a matrix.

Parameters
[in,out]Amatrix to factorize; overwritten with L and U
[in,out]Pivotpivot indices; grown to min( m, n ) if too short. Feed the result unchanged into getri()
[in]AbortOnErrorabort on info != 0, or return info
Returns
info 0 on success; > 0: U(info,info) is exactly zero, the factorization is complete but U is singular

◆ getri()

template<typename T>
int_t belfem::getri ( Matrix< T > & A,
Vector< int_t > & Pivot,
Vector< T > & Work,
const bool AbortOnError = true )

invert a square matrix in place via LAPACK ?getri, using the LU factorization computed by getrf()

Parameters
[in,out]Amust hold the getrf() factorization on entry; overwritten with the inverse
[in]Pivotpivot indices exactly as produced by getrf()
[in,out]Workscratch, grown to the optimal size on first use; reused unchanged when already large enough
[in]AbortOnErrorabort on info != 0, or return info
Returns
info 0 on success; > 0: U(info,info) is exactly zero, the matrix is singular and no inverse was computed

◆ git_branch()

std::string belfem::git_branch ( )

returns the git branch name at build time, or "unknown"

◆ git_commit_hash()

std::string belfem::git_commit_hash ( )

returns the full git commit hash of the build, or "unknown" if built outside a git repository (e.g.

a source tarball)

◆ git_commit_hash_short()

std::string belfem::git_commit_hash_short ( )

returns the abbreviated (short) git commit hash of the build

◆ git_is_dirty()

bool belfem::git_is_dirty ( )

true if the working tree had uncommitted changes at build time

◆ hessian()

template<typename T>
void belfem::hessian ( const Matrix< T > & J,
const Matrix< T > & K,
Matrix< T > & H )

Assemble the 9x9 chain-rule matrix H that maps physical first and second shape-function derivatives onto reference-space first and second derivatives for a 3D isoparametric element:

| dN/dxi   |       | dN/dx   |
| d2N/dxi2 |  =  H | d2N/dx2 |

Row ordering of H (reference space):

  • rows 0..2 : dN/dxi, dN/deta, dN/dzeta
  • rows 3..5 : d2N/dxi2, d2N/deta2, d2N/dzeta2
  • rows 6..8 : d2N/(deta dzeta), d2N/(dxi dzeta), d2N/(dxi deta)

Column ordering of H (physical space):

  • cols 0..2 : dN/dx, dN/dy, dN/dz
  • cols 3..5 : d2N/dx2, d2N/dy2, d2N/dz2
  • cols 6..8 : d2N/(dy dz), d2N/(dx dz), d2N/(dx dy)

Block structure:

  • upper-left 3x3 block : J
  • lower-left 6x3 block : K
  • upper-right 3x6 block : 0
  • lower-right 6x6 block : quadratic-in-J operator built from products of Jacobian entries (chain rule)

Physical derivatives are obtained from reference derivatives by solving the corresponding 9x9 linear system with H (e.g. via H \ rhs).

Parameters
[in]J3x3 Jacobian with layout J(i,j) = dx_j / dxi_i, where xi_0, xi_1, xi_2 = (xi, eta, zeta) and x_0, x_1, x_2 = (x, y, z).
[in]K6x3 matrix of second derivatives of the geometry mapping, K(i,j) = d2 x_j / d(xi-pair)_i, with row pairing (xi2, eta2, zeta2, eta*zeta, xi*zeta, xi*eta).
[out]H9x9 assembled transformation matrix (resized internally).

◆ intpoints()

void belfem::intpoints ( const enum IntegrationScheme aIntegrationScheme,
const enum GeometryType aGeometryType,
const uint aOrder,
Vector< real > & aWeights,
Matrix< real > & aPoints )

◆ inv() [1/3]

template<typename T, typename = blaze::EnableIf_t< blaze::IsMatrix_v< T > >>
blaze::DynamicMatrix< blaze::ElementType_t< T >, BLAZE_DEFAULT_STORAGE_ORDER > belfem::inv ( const T & aExpression)

◆ inv() [2/3]

template<typename T>
auto belfem::inv ( const T & aExpression) -> decltype(arma::inv(aExpression))

◆ inv() [3/3]

template<typename T>
auto belfem::inv ( Matrix< T > & aA) -> decltype(inv(aA.matrix_data()))

◆ is_built_from_git()

bool belfem::is_built_from_git ( )

true if the build was produced from a git checkout (i.e.

git commit metadata is available); false when built from a source tarball with no .git directory, in which case the git_* accessors return "unknown"

◆ is_integer()

bool belfem::is_integer ( const string & aString)

◆ is_maxwell()

bool belfem::is_maxwell ( const IwgType aType)
inline

◆ kelvin_christoffel()

template<typename T>
void belfem::kelvin_christoffel ( const Tensor< T > & aA,
const Vector< T > & aB,
Matrix< T > & aC )
inline

◆ kernelImage()

template<typename T>
std::tuple< Matrix< T >, Matrix< T > > belfem::kernelImage ( Matrix< T > & aMat)

◆ krylov_method()

KrylovMethod belfem::krylov_method ( const string & aString)

◆ linspace() [1/3]

template<typename T>
Vector< T > belfem::linspace ( const T & aStart,
const T & aEnd,
const belfem::size_t & aN )

◆ linspace() [2/3]

template<typename T>
auto belfem::linspace ( const T & aStart,
const T & aEnd,
const belfem::size_t & aN ) -> decltype(arma::linspace< arma::Mat< T > >(aStart, aEnd, aN))

◆ linspace() [3/3]

template<typename T>
void belfem::linspace ( const T & aStart,
const T & aEnd,
const belfem::size_t & aN,
Vector< T > & aValues )

◆ make_path_parallel()

std::string belfem::make_path_parallel ( const std::string & aPath)

this function takes a path and makes it parallel

this function takes a path and makes it parrallel

◆ matrix_type()

SpMatrixType belfem::matrix_type ( const SolverType aType)
inline

◆ max() [1/5]

template<typename T>
T belfem::max ( const arma::Mat< T > & aMatrix)

◆ max() [2/5]

template<typename T>
T belfem::max ( const blaze::Columns< blaze::DynamicMatrix< T, BLAZE_DEFAULT_STORAGE_ORDER >, true, true, false > & aColumn)
inline

◆ max() [3/5]

template<typename T>
T belfem::max ( const blaze::Rows< blaze::DynamicMatrix< T, BLAZE_DEFAULT_STORAGE_ORDER >, false, true, false > & aColumn)
inline

◆ max() [4/5]

template<typename T>
T belfem::max ( const Matrix< T > & aMatrix)
inline

◆ max() [5/5]

template<typename T>
T belfem::max ( const Vector< T > & aVector)
inline

◆ min() [1/5]

template<typename T>
T belfem::min ( const arma::Mat< T > & aMatrix)

◆ min() [2/5]

template<typename T>
T belfem::min ( const blaze::Columns< blaze::DynamicMatrix< T, BLAZE_DEFAULT_STORAGE_ORDER >, true, true, false > & aColumn)
inline

◆ min() [3/5]

template<typename T>
T belfem::min ( const blaze::Rows< blaze::DynamicMatrix< T, BLAZE_DEFAULT_STORAGE_ORDER >, false, true, false > & aColumn)
inline

◆ min() [4/5]

template<typename T>
T belfem::min ( const Matrix< T > & aMatrix)
inline

◆ min() [5/5]

template<typename T>
T belfem::min ( const Vector< T > & aVector)
inline

◆ minNonzero()

std::pair< uint, uint > belfem::minNonzero ( Matrix< int > & aMat,
const uint k )

◆ moveMinNonzero()

void belfem::moveMinNonzero ( Matrix< int > & aMat,
Matrix< int > & aQ,
Matrix< int > & aQ_,
Matrix< int > & aR,
Matrix< int > & aR_,
const uint k )

◆ operator!=()

template<typename T>
bool belfem::operator!= ( const Quaternion< T > & aLHS,
const Quaternion< T > & aRHS )

◆ operator%() [1/7]

template<typename T>
auto belfem::operator% ( const arma::Mat< T > & aA,
const arma::Mat< T > & aB ) -> decltype(aA.data() % aB.data())

◆ operator%() [2/7]

template<typename ET, typename T>
auto belfem::operator% ( const ET & aA,
const Vector< T > & aB ) -> decltype(aA % aB.vector_data())

◆ operator%() [3/7]

template<typename T>
Matrix< T > belfem::operator% ( const Tensor< T > & aA,
const Matrix< T > & aB )

◆ operator%() [4/7]

template<typename T>
Tensor< T > belfem::operator% ( const Tensor< T > & aA,
const Tensor< T > & aB )

◆ operator%() [5/7]

template<typename T, typename ET>
auto belfem::operator% ( const Vector< T > & aA,
const ET & aB ) -> decltype(aA.vector_data() % aB)

◆ operator%() [6/7]

template<typename T>
blaze::DynamicVector< T, blaze::columnVector > belfem::operator% ( const Vector< T > & aA,
const Vector< T > & aB )

◆ operator%() [7/7]

template<typename T>
auto belfem::operator% ( const Vector< T > & aA,
const Vector< T > & aB ) -> decltype(aA.vector_data() % aB.vector_data())

◆ operator*() [1/10]

template<typename A, typename B>
auto belfem::operator* ( const A & aA,
const Matrix< B > & aB ) -> decltype(aA *aB.matrix_data())
inline

◆ operator*() [2/10]

template<typename A, typename B>
auto belfem::operator* ( const A & aA,
const Vector< B > & aB ) -> decltype(aA *aB.vector_data())
inline

◆ operator*() [3/10]

template<typename A, typename B>
auto belfem::operator* ( const Matrix< A > & aA,
const B & aB ) -> decltype(aA.matrix_data() *aB)
inline

◆ operator*() [4/10]

template<typename T>
auto belfem::operator* ( const Matrix< T > & aA,
const Matrix< T > & aB ) -> decltype(aA.matrix_data() *aB.matrix_data())
inline

◆ operator*() [5/10]

template<typename T>
auto belfem::operator* ( const Matrix< T > & aA,
const Vector< T > & aB ) -> decltype(aA.matrix_data() *aB.vector_data())
inline

◆ operator*() [6/10]

template<typename T>
Quaternion< T > belfem::operator* ( const Quaternion< T > & aLHS,
const Quaternion< T > & aRHS )

◆ operator*() [7/10]

template<typename T>
Quaternion< T > belfem::operator* ( const Quaternion< T > & aLHS,
T aScalar )

◆ operator*() [8/10]

template<typename A, typename B>
auto belfem::operator* ( const Vector< A > & aA,
const B & aB ) -> decltype(aA.vector_data() *aB)
inline

◆ operator*() [9/10]

Vector< real > belfem::operator* ( SpMatrix & aA,
const Vector< real > & aX )
inline

multiply operator

◆ operator*() [10/10]

template<typename T>
Quaternion< T > belfem::operator* ( T aScalar,
const Quaternion< T > & aRHS )

◆ operator+() [1/8]

template<typename A, typename B>
auto belfem::operator+ ( const A & aA,
const Matrix< B > & aB ) -> decltype(aA+aB.matrix_data())
inline

◆ operator+() [2/8]

template<typename A, typename B>
auto belfem::operator+ ( const A & aA,
const Vector< B > & aB ) -> decltype(aA+aB.vector_data())
inline

◆ operator+() [3/8]

template<typename A, typename B>
auto belfem::operator+ ( const Matrix< A > & aA,
const B & aB ) -> decltype(aA.matrix_data()+aB)
inline

◆ operator+() [4/8]

template<typename T>
auto belfem::operator+ ( const Matrix< T > & aA,
const Matrix< T > & aB ) -> decltype(aA.matrix_data()+aB.matrix_data())
inline

◆ operator+() [5/8]

template<typename T>
Quaternion< T > belfem::operator+ ( const Quaternion< T > & aLHS,
const Quaternion< T > & aRHS )

◆ operator+() [6/8]

template<typename T>
Tensor< T > belfem::operator+ ( const Tensor< T > & aB,
const Tensor< T > & aC )

◆ operator+() [7/8]

template<typename A, typename B>
auto belfem::operator+ ( const Vector< A > & aA,
const B & aB ) -> decltype(aA.vector_data()+aB)
inline

◆ operator+() [8/8]

template<typename T>
auto belfem::operator+ ( const Vector< T > & aA,
const Vector< T > & aB ) -> decltype(aA.vector_data()+aB.vector_data())
inline

◆ operator-() [1/8]

template<typename A, typename B>
auto belfem::operator- ( const A & aA,
const Matrix< B > & aB ) -> decltype(aA - aB.matrix_data())
inline

◆ operator-() [2/8]

template<typename A, typename B>
auto belfem::operator- ( const A & aA,
const Vector< B > & aB ) -> decltype(aA - aB.vector_data())
inline

◆ operator-() [3/8]

template<typename A, typename B>
auto belfem::operator- ( const Matrix< A > & aA,
const B & aB ) -> decltype(aA.matrix_data() - aB)
inline

◆ operator-() [4/8]

template<typename T>
auto belfem::operator- ( const Matrix< T > & aA,
const Matrix< T > & aB ) -> decltype(aA.matrix_data() - aB.matrix_data())
inline

◆ operator-() [5/8]

template<typename T>
Quaternion< T > belfem::operator- ( const Quaternion< T > & aLHS,
const Quaternion< T > & aRHS )

◆ operator-() [6/8]

template<typename T>
Tensor< T > belfem::operator- ( const Tensor< T > & aB,
const Tensor< T > & aC )

◆ operator-() [7/8]

template<typename A, typename B>
auto belfem::operator- ( const Vector< A > & aA,
const B & aB ) -> decltype(aA.vector_data() - aB)
inline

◆ operator-() [8/8]

template<typename T>
auto belfem::operator- ( const Vector< T > & aA,
const Vector< T > & aB ) -> decltype(aA.vector_data() - aB.vector_data())
inline

◆ operator/() [1/2]

template<typename T>
Quaternion< T > belfem::operator/ ( const Quaternion< T > & aLHS,
T aScalar )

◆ operator/() [2/2]

template<typename T>
auto belfem::operator/ ( const Vector< T > & aA,
const T & aB ) -> decltype(aA.vector_data()/aB)
inline

◆ operator==() [1/8]

template<typename T>
bool belfem::operator== ( const Matrix< T > & aA,
const Matrix< T > & aB )

◆ operator==() [2/8]

template<typename T>
bool belfem::operator== ( const Matrix< T > & aA,
const T & aB )

◆ operator==() [3/8]

template<typename T>
bool belfem::operator== ( const Quaternion< T > & aLHS,
const Quaternion< T > & aRHS )

◆ operator==() [4/8]

template<typename T>
bool belfem::operator== ( const T & aA,
const Matrix< T > & aB )

◆ operator==() [5/8]

template<typename T>
bool belfem::operator== ( const T & aA,
const Vector< T > & aB )

◆ operator==() [6/8]

template<typename T>
bool belfem::operator== ( const Tensor< T > & aA,
const Tensor< T > & aB )

◆ operator==() [7/8]

template<typename T>
bool belfem::operator== ( const Vector< T > & aA,
const T & aB )

◆ operator==() [8/8]

template<typename T>
bool belfem::operator== ( const Vector< T > & aA,
const Vector< T > & aB )

◆ os_string()

std::string belfem::os_string ( )

◆ parallel_reordering()

MumpsParallelReodrdering belfem::parallel_reordering ( const string & aString)

◆ partColumnReduce()

template<typename T>
void belfem::partColumnReduce ( Matrix< T > & aMat,
Matrix< T > & aR,
Matrix< T > & aR_,
const uint k,
const uint l )

◆ partRowReduce()

template<typename T>
void belfem::partRowReduce ( Matrix< T > & aMat,
Matrix< T > & aQ,
Matrix< T > & aQ_,
const uint k,
const uint l )

◆ partSmithForm()

void belfem::partSmithForm ( Matrix< int > & aMat,
Matrix< int > & aQ,
Matrix< int > & aQ_,
Matrix< int > & aR,
Matrix< int > & aR_,
const uint k )

◆ petsctools_allocate_vector()

PetscErrorCode belfem::petsctools_allocate_vector ( MPI_Comm aComm,
Vec & aVec,
const PetscInt aGlobalLength,
const PetscInt aLocalLength )

◆ petsctools_create_matrix()

PetscErrorCode belfem::petsctools_create_matrix ( sparse::PETScAIJ * aDistMatrix,
Mat & aMat )

◆ petsctools_error_message()

string belfem::petsctools_error_message ( const PetscErrorCode aStatus)

◆ petsctools_get_local_vector()

PetscErrorCode belfem::petsctools_get_local_vector ( Vec & aVec,
Vector< PetscReal > & aVector )

Extract the local portion of a distributed PETSC vector to a BELFEM vector.

aVector must have been initialized with the correct local size

Parameters
aVec
aVector

◆ petsctools_get_vector()

PetscErrorCode belfem::petsctools_get_vector ( Vec & aVec,
const Vector< PetscInt > & aIndices,
Vector< PetscReal > & aVector )

convert a PETSC vector to a BELFEM vector

aVector must have been initialized

Parameters
aVec
aIndices
aVector

◆ petsctools_link_matrix()

PetscErrorCode belfem::petsctools_link_matrix ( COMM_TYPE aComm,
SpMatrix & aMatrix,
Mat & aMat )

◆ petsctools_notify_matrix_update()

PetscErrorCode belfem::petsctools_notify_matrix_update ( Mat & aMat)

◆ petsctools_set_local_vector()

PetscErrorCode belfem::petsctools_set_local_vector ( const Vector< PetscReal > & aVector,
Vec & aVec )

Set the local portion of a distributed PETSC vector from a BELFEM vector.

aVector must contain the local values to set

Parameters
aVector
aVec

◆ petsctools_set_vector()

PetscErrorCode belfem::petsctools_set_vector ( const Vector< PetscReal > & aVector,
const Vector< PetscInt > & aIndices,
Vec & aVec )

convert a BELFEM vector to a PETSC vector aVac must have been initialized.

Parameters
aVector
aIndices
aVec

◆ petsctools_update_matrix()

PetscErrorCode belfem::petsctools_update_matrix ( sparse::PETScAIJ * aDistMatrix,
Mat & aMat )

◆ polyfit()

template<typename T>
void belfem::polyfit ( const Vector< T > & aX,
const Vector< T > & aY,
const uint & aN,
Vector< T > & aCoeffs )

◆ polyval()

template<typename T>
void belfem::polyval ( const Vector< T > & aCoeffs,
const Vector< T > & aX,
Vector< T > & aY )

◆ posv() [1/2]

template<typename T>
int_t belfem::posv ( Matrix< T > & A,
Matrix< T > & B,
const bool AbortOnError = true )

solve A * X = B for multiple right hand sides of a symmetric ( real ) or Hermitian ( complex ) positive definite matrix, see the vector version above

Parameters
[in,out]Apositive definite matrix; overwritten with the Cholesky factor
[in,out]Bright hand sides in columns on input, solutions on output
[in]AbortOnErrorabort on info != 0, or return info
Returns
info 0 on success; > 0: the leading minor of order info is not positive definite

◆ posv() [2/2]

template<typename T>
int_t belfem::posv ( Matrix< T > & A,
Vector< T > & B,
const bool AbortOnError = true )

solve A * x = b for a symmetric ( real ) or Hermitian ( complex ) positive definite matrix via LAPACK ?posv ( Cholesky factorization, no pivoting )

Parameters
[in,out]Apositive definite matrix; overwritten with the Cholesky factor
[in,out]Bright hand side on input, solution on output
[in]AbortOnErrorabort on info != 0, or return info
Returns
info 0 on success; > 0: the leading minor of order info is not positive definite

◆ preconditioner()

Preconditioner belfem::preconditioner ( const string & aString)

◆ preferred_matrix_format()

SpMatrixType belfem::preferred_matrix_format ( SolverType aSolver)
inline

◆ print_banner()

void belfem::print_banner ( const std::string aExecName)

prints the banner

◆ quadratic_gradient()

template<typename T>
T belfem::quadratic_gradient ( const Vector< T > & aF,
const Vector< T > & aX,
const index_t aIndex = 1 )

compute the derivative of F to X at index

Template Parameters
T
Parameters
aF
aX
aIndex
Returns

◆ quaternion_from_rotation_matrix()

template<typename T>
Quaternion< T > belfem::quaternion_from_rotation_matrix ( const Matrix< T > & aMatrix)

Extract a unit quaternion from a 3x3 rotation matrix.

Uses the trace-first variant of Shepperd's method: when the trace is positive, w is recovered from the trace (bounded away from zero); otherwise the largest diagonal entry selects which vector component is extracted first.

Parameters
aMatrixA proper rotation matrix (det = +1, orthogonal)
Returns
Unit quaternion representing the same rotation

◆ quaternion_rotate_vector()

template<typename T>
void belfem::quaternion_rotate_vector ( const Quaternion< T > & aQ,
const Vector< T > & aVector,
Vector< T > & aResult )

Rotate a 3D vector by a unit quaternion (optimized, in-place).

Uses the formula: v' = v + 2w (u x v) + 2 (u x (u x v))

where q = (w, u) with u = (x, y, z). This avoids constructing intermediate quaternions and is equivalent to q * v * q*.

Parameters
aQUnit quaternion defining the rotation
aVectorInput vector (length 3)
aResultOutput vector (length 3, pre-allocated)

◆ quaternion_to_rotation_matrix()

template<typename T>
void belfem::quaternion_to_rotation_matrix ( const Quaternion< T > & aQ,
Matrix< T > & aMatrix )

Convert a unit quaternion to a 3x3 rotation matrix.

Given q = (w, x, y, z), the rotation matrix is:

| 1 - 2(y^2+z^2)    2(xy - wz)      2(xz + wy)   |

R = | 2(xy + wz) 1 - 2(x^2+z^2) 2(yz - wx) | | 2(xz - wy) 2(yz + wx) 1 - 2(x^2+y^2) |

Parameters
aQUnit quaternion
aMatrixPre-allocated 3x3 output matrix

◆ r2() [1/2]

real belfem::r2 ( const Matrix< real > & aApproximated,
const Matrix< real > & aExact )
inline

◆ r2() [2/2]

real belfem::r2 ( const Vector< real > & aApproximated,
const Vector< real > & aExact )
inline

calculates the R2 coefficient of determination from values of an evaluated function with respect to given samples.

See also

https://en.wikipedia.org/wiki/Coefficient_of_determination

Parameters
[in]aApproximatedvalues of evaluated function
[in]aExactdata samples or exact solution

◆ rand()

real belfem::rand ( )
inline

a random number between 0 and 1 must call seed first

◆ random_seed() [1/2]

void belfem::random_seed ( )
inline

seed the random generator.

MPI builds seed the communicator's engine, the serial branch seeds std::rand(), which rand() uses in that build.

◆ random_seed() [2/2]

template<typename T>
void belfem::random_seed ( T & aSeed)

◆ ratio_adx2()

void belfem::ratio_adx2 ( const real & aRatio,
const real & aLength,
const index_t & aNumCells,
Vector< real > & aX )

◆ ratio_ar2()

void belfem::ratio_ar2 ( const real & aDeltaX0,
const real & aLength,
const index_t & aNumCells,
Vector< real > & aX )

◆ rcond()

real belfem::rcond ( SpMatrix & aMatrix)

◆ receive() [1/6]

template<typename T>
void belfem::receive ( Cell< T > & aData,
const proc_t aSource = 0 )

Receives a cell from a specific source process.

Template Parameters
TThe type of the cell elements.
Parameters
aDataThe cell to receive.
aSourceThe source process rank (default is 0).

◆ receive() [2/6]

template<typename T>
void belfem::receive ( Matrix< T > & aData,
const proc_t aSource = 0 )

Receives a matrix from a specific source process.

Template Parameters
TThe type of the matrix elements.
Parameters
aDataThe matrix to receive.
aSourceThe source process rank (default is 0).

◆ receive() [3/6]

void belfem::receive ( string & aMessage,
const proc_t aSource )

◆ receive() [4/6]

template<typename T>
void belfem::receive ( T & aData,
const proc_t aSource = 0,
typename std::enable_if< is_scalar< T >::value >::type * = nullptr )

Receives a scalar value from a specific source process.

Template Parameters
TThe type of the scalar.
Parameters
aDataThe scalar to receive.
aSourceThe source process rank (default is 0).

◆ receive() [5/6]

template<typename T>
void belfem::receive ( T * aData,
index_t & aLength,
const proc_t aSource )

Receives a raw array from a specified source process using MPI.

This function receives a raw array into aData from the process with rank aSource using non-blocking MPI operations. The received length is stored in aLength, and the array is processed in chunks. The array must be pre-allocated with sufficient space.

Template Parameters
TThe type of the array elements.
Parameters
aDataPointer to the pre-allocated array to receive data into.
aLengthReference to the variable that will be updated with the received length.
aSourceThe rank of the source process in the MPI communicator.
Note
Requires aData to be allocated with at least the initial aLength elements.
Warning
Raises BELFEM_ERROR ( active in release too ) if the received length exceeds the allocated space.

◆ receive() [6/6]

template<typename T>
void belfem::receive ( Vector< T > & aData,
const proc_t aSource = 0 )

Receives a vector from a specific source process.

Template Parameters
TThe type of the vector elements.
Parameters
aDataThe vector to receive.
aSourceThe source process rank (default is 0).

◆ reordering_method()

ReorderingMethod belfem::reordering_method ( const string & aString)

◆ reverse() [1/2]

template<typename T>
void belfem::reverse ( Cell< T > & aCell)

◆ reverse() [2/2]

template<typename T>
auto belfem::reverse ( const Vector< T > & aA) -> decltype(reverse(aA.vector_data()))

◆ rho_database_is_current()

bool belfem::rho_database_is_current ( const string & aPath)
inline

Test whether a cached rho database was written by the current format.

The file name encodes only the material label and the RRR value, so a file left over from an older BELFEM is indistinguishable by name and would be loaded rather than rebuilt. Older files store the ratio as a lowercase "rrr" ( alongside a "lambda" dataset ); the current writer stores "RRR". The presence of that marker is therefore the format test.

Returns true when the file may be loaded, false when it must be rebuilt. An unreadable file counts as "must rebuild" rather than an error — the caller regenerates, which is the recoverable outcome.

◆ rotate()

template<typename T>
void belfem::rotate ( const Tensor< T > & aB,
const Matrix< T > & aR,
Tensor< T > & aA )

◆ rotation_matrix() [1/2]

template<typename T>
void belfem::rotation_matrix ( const T & aYaw,
const T & aPitch,
const T & aRoll,
Matrix< real > & aMatrix )

rotate using euler angles project from body to global according to DIN 9300

Parameters
aYaw
aPitch
aRoll
aMatrix

◆ rotation_matrix() [2/2]

template<typename T>
void belfem::rotation_matrix ( const Vector< T > & aAxis,
const T & aAngle,
Matrix< real > & aMatrix )

rotate around an axis with an angle

Template Parameters
T
Parameters
aAxis
aAngle
aMatrix

◆ rotation_matrix_strip()

template<typename T>
void belfem::rotation_matrix_strip ( const Vector< T > & aAxis,
const T & aAngle,
Matrix< real > & aMatrix )

◆ rowAdd()

template<typename T>
void belfem::rowAdd ( Matrix< T > & aMat,
const uint i,
const uint j,
const int q )

◆ rowAddOperation()

template<typename T>
void belfem::rowAddOperation ( Matrix< T > & aMat,
Matrix< T > & aQ,
Matrix< T > & aQ_,
const uint i,
const uint j,
const int q )

◆ rowEchelon()

template<typename T>
std::tuple< Matrix< T >, Matrix< T >, uint > belfem::rowEchelon ( Matrix< T > & aMat)

◆ rowExchange()

template<typename T>
void belfem::rowExchange ( Matrix< T > & aMat,
const uint i,
const uint j )

◆ rowExchangeOperation()

template<typename T>
void belfem::rowExchangeOperation ( Matrix< T > & aMat,
Matrix< T > & aQ,
Matrix< T > & aQ_,
const uint i,
const uint j )

◆ rowMultiply()

template<typename T>
void belfem::rowMultiply ( Matrix< T > & aMat,
const uint i )

◆ rowMultiplyOperation()

template<typename T>
void belfem::rowMultiplyOperation ( Matrix< T > & aMat,
Matrix< T > & aQ,
Matrix< T > & aQ_,
const uint i )

◆ rowPrepare()

template<typename T>
void belfem::rowPrepare ( Matrix< T > & aMat,
Matrix< T > & aQ,
Matrix< T > & aQ_,
const uint k,
const uint l )

◆ rowReduce()

template<typename T>
void belfem::rowReduce ( Matrix< T > & aMat,
Matrix< T > & aQ,
Matrix< T > & aQ_,
const uint k,
const uint l )

◆ search_and_replace()

std::string belfem::search_and_replace ( const std::string & aString,
const std::string & aSearch,
const std::string & aReplace )

◆ search_data_file()

std::string belfem::search_data_file ( const std::string & aFile,
const std::string & aSubDirectory )

Resolve a data file named in an input file, looking below aSubDirectory of the shared data directory.

The run directory always wins, so a local copy overrides the shared database. Failing that the file is looked up below the data directory, first under the same relative path and then by name alone, so that "MatData/bhdata.hdf5" also resolves for a run that has no MatData directory of its own.

If nothing is found, aFile is returned UNCHANGED. That is load-bearing in two ways: whoever opens the file reports the name the user wrote, and the dlopen search path stays intact for plugin libraries, which resolve through the loader and need not exist as a file at all. Note that dlopen only consults the platform loader path ( $LD_LIBRARY_PATH on Linux, $DYLD_LIBRARY_PATH on macOS ) for a name carrying no slash – for a slashed name the two fallbacks below are the only lookups beyond the run directory.

The root is gBelfemDataPath, NOT $BELFEM_DATA directly. It is filled by Communicator::set_globals() from the environment, and on an installed tree from BELFEM_INSTALL_DATADIR when the environment is silent, so an unset $BELFEM_DATA does not imply an empty root. A code may also set it itself. An empty root skips both fallbacks; an empty aSubDirectory searches the data directory itself.

gastables::data_path() deliberately does NOT use this. It is a directory resolver with marker-file validation and a relative-path ladder, and it intentionally skips validation when the root is set (fn_GT_data_path.cpp:51-55). That is not duplication to be collapsed.

◆ send() [1/6]

template<typename T>
void belfem::send ( Cell< T > & aData,
const proc_t aTarget = 0 )

Sends a cell to a specific target process.

Template Parameters
TThe type of the cell elements.
Parameters
aDataThe cell to send.
aTargetThe target process rank.

◆ send() [2/6]

void belfem::send ( const string & aMessage,
const proc_t aTarget )

◆ send() [3/6]

template<typename T>
void belfem::send ( const T aData,
const proc_t aTarget = 0,
typename std::enable_if< is_scalar< T >::value >::type * = nullptr )

Sends a scalar value to a specific target process.

Template Parameters
TThe type of the scalar.
Parameters
aDataThe scalar to send.
aTargetThe target process rank.

◆ send() [4/6]

template<typename T>
void belfem::send ( Matrix< T > & aData,
const proc_t aTarget = 0 )

◆ send() [5/6]

template<typename T>
void belfem::send ( T * aData,
const index_t aLength,
const proc_t aTarget )

Sends a raw array to a specified target process using MPI.

This function sends a pre-allocated raw array aData of length aLength to the process with rank aTarget using non-blocking MPI operations. The array is split into chunks for efficient transmission.

Template Parameters
TThe type of the array elements.
Parameters
aDataPointer to the pre-allocated array to send.
aLengthThe number of elements in the array.
aTargetThe rank of the target process in the MPI communicator.
Note
Requires aData to be allocated with at least aLength elements.

◆ send() [6/6]

template<typename T>
void belfem::send ( Vector< T > & aData,
const proc_t aTarget = 0 )

Sends a vector to a specific target process.

Template Parameters
TThe type of the vector elements.
Parameters
aDataThe vector to send.
aTargetThe target process rank.

◆ serial_reordering()

MumpsSerialReodrdering belfem::serial_reordering ( const string & aString)

◆ share() [1/2]

template<typename T>
void belfem::share ( Cell< T > & aData)

◆ share() [2/2]

template<typename T>
void belfem::share ( Vector< T > & aData)

◆ sign()

template<typename T>
T belfem::sign ( const T aX)
inline

◆ slerp()

template<typename T>
Quaternion< T > belfem::slerp ( const Quaternion< T > & aQ1,
const Quaternion< T > & aQ2,
T aT )

Spherical linear interpolation between two quaternions.

Parameters
aQ1The starting quaternion (t=0)
aQ2The ending quaternion (t=1)
aTInterpolation parameter in [0, 1]
Returns
Interpolated quaternion

Interpolates along the shortest arc on the 4D unit sphere. Both input quaternions should be unit quaternions for meaningful results.

◆ smallestNonzero()

template<typename T>
std::pair< uint, uint > belfem::smallestNonzero ( Vector< T > & v,
uint k )

◆ smithForm()

std::tuple< Matrix< int >, Matrix< int >, Matrix< int >, Matrix< int >, uint, uint > belfem::smithForm ( Matrix< int > & aMat)

◆ SolveInt()

Matrix< int > belfem::SolveInt ( Matrix< int > aMat,
Matrix< int > & aVec )

◆ solver_type()

SolverType belfem::solver_type ( const string & aString)

◆ sort() [1/2]

template<typename T>
void belfem::sort ( Cell< T > & aCell)

◆ sort() [2/2]

template<typename T, class C>
void belfem::sort ( Cell< T > & aCell,
C & aComp,
const size_t aNumberOfItems = 0 )

◆ sprint()

template<typename ... Args>
std::string belfem::sprint ( const char * aFormat,
const Args ... aArgs )

A format script similar to write( , ) in fortran.

Template Parameters
Argstype of arguments to be passed
Parameters
aFormatformat string
aArgsarguments
Returns

◆ string_to_bool()

bool belfem::string_to_bool ( const std::string & aString)

return true if string is either 1, on, true or yes

◆ string_to_cell()

template<typename T>
void belfem::string_to_cell ( const string & aString,
Cell< T > & aValues )

◆ string_to_integration_scheme()

IntegrationScheme belfem::string_to_integration_scheme ( const string & aString)

◆ string_to_lower()

std::string belfem::string_to_lower ( const std::string & aString)

convert the string to lower case

◆ string_to_upper()

std::string belfem::string_to_upper ( const std::string & aString)

convert the string to upper case

◆ string_to_words()

Cell< string > belfem::string_to_words ( const std::string & aString,
char aDelimiter )

create a cell of words from a string

◆ sum()

template<typename T>
auto belfem::sum ( const Vector< T > & aA) -> decltype(sum(aA.vector_data()))

◆ swap()

template<typename T>
void belfem::swap ( Cell< T > & aA,
Cell< T > & aB )
noexcept

Swap specialization for Cell.

◆ symratiospace()

template<typename T>
void belfem::symratiospace ( const T & aXmin,
const T & aXmax,
const T & aRatio,
const index_t aN,
Vector< T > & aX )

◆ to_cell()

template<typename T>
Cell< T > belfem::to_cell ( const Vector< T > & aVector)

convert a Vector< T > into a Cell< T >

◆ to_enum()

template<typename T>
void belfem::to_enum ( const string & aString,
T & aEnum )

◆ to_pair()

template<typename T>
void belfem::to_pair ( const std::string & aString,
Cell< std::pair< std::string, T > > & aResult )

◆ to_real()

real belfem::to_real ( const std::string & aString)

convert string to real, return NAN if it is not real

◆ to_string() [1/16]

string belfem::to_string ( const CompressionMethod aCompressionMethod)

◆ to_string() [2/16]

string belfem::to_string ( const DistributedMatrixType aDistributedMatrixType)

◆ to_string() [3/16]

string belfem::to_string ( const DomainType aDomainType)

◆ to_string() [4/16]

std::string belfem::to_string ( const ElementType aElementType)
inline

◆ to_string() [5/16]

string belfem::to_string ( const EntityType aEntityType)

◆ to_string() [6/16]

string belfem::to_string ( const EulerMethod aEulerMethod)

◆ to_string() [7/16]

std::string belfem::to_string ( const GeometryType aGeometryType)
inline

◆ to_string() [8/16]

string belfem::to_string ( const IntegrationScheme & aIntegrationScheme)

◆ to_string() [9/16]

string belfem::to_string ( const KrylovMethod aKrylovMethod)

◆ to_string() [10/16]

string belfem::to_string ( const MaterialProperty aProperty)

Convert material property enum to string.

◆ to_string() [11/16]

string belfem::to_string ( const MumpsBlockLowRanking aBLR)

◆ to_string() [12/16]

string belfem::to_string ( const MumpsParallelReodrdering aParallelReodrdering)

◆ to_string() [13/16]

string belfem::to_string ( const MumpsSerialReodrdering aSerialReodrdering)

◆ to_string() [14/16]

string belfem::to_string ( const Preconditioner aPreconditioner)

◆ to_string() [15/16]

string belfem::to_string ( const ReorderingMethod aReorderingMethod)

◆ to_string() [16/16]

string belfem::to_string ( const SolverType aSolverType)

◆ to_vector()

template<typename T>
Vector< T > belfem::to_vector ( const Cell< T > & aCell)

convert a Cell< T > into a Vector< T >

◆ trans() [1/2]

template<typename T>
auto belfem::trans ( const Matrix< T > & aMatrix) -> decltype(trans(aMatrix.matrix_data()))

◆ trans() [2/2]

template<typename T>
auto belfem::trans ( Matrix< T > & aMatrix) -> decltype(trans(aMatrix.matrix_data()))

◆ uname()

std::string belfem::uname ( )

returns the Unix version ( Linux or Darwin )

◆ unique()

template<typename T>
void belfem::unique ( Cell< T > & aCell)

◆ unit_to_si()

value belfem::unit_to_si ( const string & aString)

◆ utf8_character_count()

size_t belfem::utf8_character_count ( const string & aString)

◆ version()

std::string belfem::version ( )

returns the BELFEM semantic version as "major.minor.patch" (e.g.

"0.1.0"), assigned via project( belfem VERSION ... ) in the top-level CMakeLists.txt

Variable Documentation

◆ BELFEM_EPS

real belfem::BELFEM_EPS = std::numeric_limits<real>::epsilon()
constexpr

◆ BELFEM_EPSILON

real belfem::BELFEM_EPSILON = 10 * std::numeric_limits<real>::epsilon()
constexpr

◆ BELFEM_MESH_EPSILON

real belfem::BELFEM_MESH_EPSILON = 1e-9
constexpr

◆ gBelfemDataPath

gstring belfem::gBelfemDataPath

path to belfem data files, set by environment variable $BELFEM_DATA

◆ gDefaultSolver

const SolverType belfem::gDefaultSolver = SolverType::UNDEFINED

◆ gFinDiffDeltaAngle

real belfem::gFinDiffDeltaAngle = 1.74532925199433e-3
constexpr

◆ gFinDiffDeltaB

real belfem::gFinDiffDeltaB = 0.001
constexpr

◆ gFinDiffDeltaT

real belfem::gFinDiffDeltaT = 0.001
constexpr

◆ gLongName

const std::string belfem::gLongName = "BELFEM -- The Berkeley Lab Finite Element Framework"

◆ gMaxCommChunkLength

int belfem::gMaxCommChunkLength = 64 * 1024
constexpr

◆ gNoID

id_t belfem::gNoID = std::numeric_limits<id_t>::max()
constexpr

◆ gNoIndex

index_t belfem::gNoIndex = std::numeric_limits<index_t>::max()
constexpr

◆ gNoOwner

proc_t belfem::gNoOwner = std::numeric_limits<proc_t>::max()
constexpr

◆ gNumMaterialProperties

size_t belfem::gNumMaterialProperties = static_cast< size_t >( MaterialProperty::UNDEFINED )
constexpr

Total number of material properties.

◆ gNumNonConstantMaterialProperties

size_t belfem::gNumNonConstantMaterialProperties = static_cast< size_t >( MaterialProperty::T_crit )
constexpr

Number of non-constant material properties.

Does not include jc and n because they are handled differently

◆ gRhoMax

greal belfem::gRhoMax

maximim resistrivity in Ohm*m, default: 1e10

◆ gRhoMin

greal belfem::gRhoMin

minimim resistrivity in Ohm*m, default: 0

◆ gTAlphaSwitchMax

real belfem::gTAlphaSwitchMax = 273.15
constexpr

Upper bound for the thermal expansion split temperature [K].

The split is 0.618 * theta_Debye, capped here. The Debye factor keeps the anchor above the steep part of cp, where dln(C)/dT would be negative; the cap keeps it inside the range where expansion measurements still carry signal, and limits how far a single anchor has to extrapolate. For a high-theta material the cap binds, for a low-theta one the Debye factor does.

The value must not undercut the temperature at which dln(C)/dT changes sign, which sits at roughly 0.43 - 0.51 * theta for the fitted metals - 0.618 * theta clears it by construction, but a flat cap breaks that relationship once theta exceeds about 425 K ( aluminum, chromium ). The ice point clears the sign change for every material in the roster, and the choice of anchor inside the admissible window is uncritical: moving it shifts the cryogenic alpha by less than the scatter of the underlying expansion data ( under 5 % for copper, aluminum, iron and nickel ).

◆ gTbulk

greal belfem::gTbulk

temperature in K of the bulk material when no thermal kernel is chosen; NaN until the executable or the deck sets it

◆ gTfreeze

real belfem::gTfreeze = 273.15
constexpr

◆ gTmin

real belfem::gTmin = 1.0
constexpr

◆ gTref

real belfem::gTref = 288.15
constexpr

◆ gTroom

real belfem::gTroom = 293.15
constexpr

◆ gURL

const std::string belfem::gURL = "http://belfem.lbl.gov"

◆ opVertexDegree

struct belfem::OpVertexDegree belfem::opVertexDegree

◆ opVertexID

struct belfem::OpVertexID belfem::opVertexID

◆ opVertexIndex

struct belfem::OpVertexIndex belfem::opVertexIndex

◆ opVertexLevel

struct belfem::OpVertexLevel belfem::opVertexLevel

◆ opVertexOwner

struct belfem::OpVertexOwner belfem::opVertexOwner