Serac  0.1
Serac is an implicit thermal strucural mechanics simulation code.
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
serac Namespace Reference

Accelerator functionality. More...

Namespaces

 accelerator
 Namespace for methods involving accelerator-enabled builds.
 
 cli
 Command line functionality.
 
 heat_transfer
 HeatTransfer helper structs.
 
 input
 The input related helper functions and objects.
 
 mesh
 Mesh related input options.
 
 output
 The output related helper functions and objects.
 
 profiling
 profiling namespace
 
 solid_mechanics
 SolidMechanics helper data types.
 
 terminator
 Terminator functionality.
 

Classes

struct  variant_alternative
 Obtains the type at index I of a variant<T0, T1> More...
 
struct  variant_alternative< 0, T0, T1 >
 Obtains the type at index 0 of a variant<T0, T1> More...
 
struct  variant_alternative< 1, T0, T1 >
 Obtains the type at index 1 of a variant<T0, T1> More...
 
struct  variant
 A simple variant type that supports only two elements. More...
 
class  EquationSolver
 This class manages the objects typically required to solve a nonlinear set of equations arising from discretization of a PDE of the form F(x) = 0. Specifically, it has. More...
 
class  SuperLUSolver
 A wrapper class for using the MFEM SuperLU solver with a HypreParMatrix. More...
 
struct  DifferentiateWRT
 
struct  differentiate_wrt_this
 this type exists solely as a way to signal to serac::Functional that the function serac::Functional::operator()` should differentiate w.r.t. a specific argument More...
 
struct  ElemInfo
 a (poorly named) tuple of quantities used to discover the sparsity pattern associated with element and boundary element matrices. More...
 
struct  SignedIndex
 this type explicitly stores sign (typically used conveying edge/face orientation) and index values More...
 
struct  DofNumbering
 this object extracts the dofs for each element in a FiniteElementSpace as a 2D array such that element_dofs_(e, i) will be the ith dof of element e. More...
 
struct  GradientAssemblyLookupTables
 this object figures out the sparsity pattern associated with a finite element discretization of the given test and trial function spaces, and records which nonzero each element "stiffness" matrix maps to, to facilitate assembling the element matrices into the global sparse matrix. e.g. More...
 
struct  Domain
 a class for representing a geometric region that can be used for integration More...
 
struct  dual
 Dual number struct (value plus gradient) More...
 
struct  is_dual_number
 class for checking if a type is a dual number or not More...
 
struct  is_dual_number< dual< T > >
 class for checking if a type is a dual number or not More...
 
struct  ElementRestriction
 
struct  BlockElementRestriction
 a generalization of mfem::ElementRestriction that works with multiple kinds of element geometries. Instead of doing the "E->L" (gather) and "L->E" (scatter) operations for only one element geometry, this class does them with block "E-vectors", where each element geometry is a separate block. More...
 
struct  TensorProductQuadratureRule
 a convenience class for generating information about tensor product integration rules from the underlying 1D rule. More...
 
struct  CompileTimeValue
 
struct  batched_jacobian
 this struct is used to look up mfem's memory layout of the quadrature point jacobian matrices More...
 
struct  batched_jacobian< mfem::Geometry::CUBE, q >
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
struct  batched_jacobian< mfem::Geometry::SQUARE, q >
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
struct  batched_jacobian< mfem::Geometry::TRIANGLE, q >
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
struct  batched_jacobian< mfem::Geometry::TETRAHEDRON, q >
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
struct  batched_position
 this struct is used to look up mfem's memory layout of the quadrature point position vectors More...
 
struct  batched_position< mfem::Geometry::CUBE, q >
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
struct  batched_position< mfem::Geometry::SQUARE, q >
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
struct  batched_position< mfem::Geometry::TRIANGLE, q >
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
struct  batched_position< mfem::Geometry::TETRAHEDRON, q >
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
struct  batched_position< mfem::Geometry::SEGMENT, q >
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
struct  H1
 H1 elements of order p. More...
 
struct  Hcurl
 H(curl) elements of order p. More...
 
struct  L2
 Discontinuous elements of order p. More...
 
struct  QOI
 "Quantity of Interest" elements (i.e. elements with a single shape function, 1) More...
 
struct  finite_element
 Template prototype for finite element implementations. More...
 
struct  DependsOn
 
struct  Index
 Compile-time alias for index of differentiation. More...
 
class  Functional< test(trials...), exec >
 Intended to be like std::function for finite element kernels. More...
 
struct  QoIProlongation
 this class behaves like a Prolongation operator, except is specialized for the case of a quantity of interest. The action of its MultTranspose() operator (the only thing it is used for) sums the values from different processors. More...
 
struct  QoIElementRestriction
 this class behaves like a Restriction operator, except is specialized for the case of a quantity of interest. The action of its ScatterAdd() operator (the only thing it is used for) sums the values on this local processor. More...
 
class  Functional< double(trials...), exec >
 a partial template specialization of Functional with test == double, implying "quantity of interest" More...
 
struct  GeometricFactors
 a class that computes and stores positions and jacobians at each quadrature point More...
 
struct  Dimension
 Compile-time alias for a dimension. More...
 
struct  Integral
 a class for representing a Integral calculations and their derivatives More...
 
struct  isotropic_tensor
 an object representing a highly symmetric kind of tensor, that is interoperable with serac::tensor, but uses less memory and performs less calculation than its dense counterpart More...
 
struct  isotropic_tensor< T, n >
 there is no such thing as a rank-1 isotropic tensor, but we include this specialization to help explain that to users, rather than just producing an "incomplete type" compilation error More...
 
struct  isotropic_tensor< T, m, m >
 a rank-2 isotropic tensor is essentially just the Identity matrix, with a constant of proportionality More...
 
struct  isotropic_tensor< T, 3, 3, 3 >
 the only rank-3 isotropic tensor we suport is the alternating tensor (levi-civita symbol) More...
 
struct  isotropic_tensor< T, m, m, m, m >
 there are 3 independent rank-4 isotropic tensors (dilatational, symmetric, antisymmetric), so this object represents a linear combination of them More...
 
struct  QuadratureRule
 A rule for numerical quadrature (set of points and weights) Can be thought of as a compile-time analogue of mfem::IntegrationRule. More...
 
struct  Nothing
 these classes are a little confusing. These two special types represent the similar (but different) cases of: More...
 
struct  Empty
 see Nothing for a complete description of this class and when to use it More...
 
struct  QuadratureData
 A class for storing and access user-defined types at quadrature points. More...
 
class  ShapeAwareFunctional< shape, test(trials...), exec >
 This is a small wrapper around serac::Functional for shape-displaced domains of integration. More...
 
struct  tensor
 Arbitrary-rank tensor class. More...
 
struct  zero
 A sentinel struct for eliding no-op tensor operations. More...
 
struct  is_zero
 checks if a type is zero More...
 
struct  is_zero< zero >
 
struct  LuFactorization
 Representation of an LU factorization. More...
 
struct  tuple
 This is a class that mimics most of std::tuple's interface, except that it is usable in CUDA kernels and admits some arithmetic operator overloads. More...
 
struct  tuple< T0 >
 Type that mimics std::tuple. More...
 
struct  tuple< T0, T1 >
 Type that mimics std::tuple. More...
 
struct  tuple< T0, T1, T2 >
 Type that mimics std::tuple. More...
 
struct  tuple< T0, T1, T2, T3 >
 Type that mimics std::tuple. More...
 
struct  tuple< T0, T1, T2, T3, T4 >
 Type that mimics std::tuple. More...
 
struct  tuple< T0, T1, T2, T3, T4, T5 >
 Type that mimics std::tuple. More...
 
struct  tuple< T0, T1, T2, T3, T4, T5, T6 >
 Type that mimics std::tuple. More...
 
struct  tuple< T0, T1, T2, T3, T4, T5, T6, T7 >
 Type that mimics std::tuple. More...
 
struct  tuple_size
 
struct  tuple_size< serac::tuple< Types... > >
 
struct  tuple_element
 a struct used to determine the type at index I of a tuple More...
 
struct  tuple_element< I, tuple< Head, Tail... > >
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
struct  tuple_element< 0, tuple< Head, Tail... > >
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
struct  is_tuple
 Trait for checking if a type is a serac::tuple. More...
 
struct  is_tuple< serac::tuple< T... > >
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
struct  is_tuple_of_tuples
 Trait for checking if a type if a serac::tuple containing only serac::tuple. More...
 
struct  is_tuple_of_tuples< serac::tuple< T... > >
 Trait for checking if a type if a serac::tuple containing only serac::tuple. More...
 
struct  is_tensor_of_dual_number
 class for checking if a type is a tensor of dual numbers or not More...
 
struct  is_tensor_of_dual_number< tensor< dual< T >, n... > >
 class for checking if a type is a tensor of dual numbers or not More...
 
struct  SolverStatus
 Status and diagnostics of nonlinear equation solvers. More...
 
struct  ScalarSolverOptions
 Settings for solve_scalar_equation. More...
 
struct  TimesteppingOptions
 A timestep and boundary condition enforcement method for a dynamic solver. More...
 
struct  AMGXOptions
 Stores the information required to configure a NVIDIA AMGX preconditioner. More...
 
struct  LinearSolverOptions
 Parameters for an iterative linear solution scheme. More...
 
struct  NonlinearSolverOptions
 Nonlinear solution scheme parameters. More...
 
class  BasePhysics
 This is the abstract base class for a generic forward solver. More...
 
class  BoundaryCondition
 Boundary condition information bundle. More...
 
class  FilterView
 A "view" for filtering a container. More...
 
class  BoundaryConditionManager
 A container for the boundary condition information relating to a specific physics module. More...
 
struct  Parameters
 a struct that is used in the physics modules to clarify which template arguments are user-controlled parameters (e.g. for design optimization) More...
 
struct  ContactOptions
 Stores the options for a contact pair. More...
 
class  ContactData
 This class stores all ContactInteractions for a problem, calls Tribol functions that act on all contact interactions, and agglomerates fields that exist over different ContactInteractions. More...
 
class  HeatTransfer
 An object containing the solver for a heat transfer PDE. More...
 
class  HeatTransfer< order, dim, Parameters< parameter_space... >, std::integer_sequence< int, parameter_indices... > >
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
struct  HeatTransferInputOptions
 Stores all information held in the input file that is used to configure the solver. More...
 
struct  GreenSaintVenantThermoelasticMaterial
 Green-Saint Venant isotropic thermoelastic model. More...
 
struct  ParameterizedGreenSaintVenantThermoelasticMaterial
 Green-Saint Venant isotropic thermoelastic model. More...
 
struct  HardeningInputOptions
 Contains function that defines the schema for hardening laws. More...
 
struct  LiquidCrystElastomerBrighenti
 Brighenti's liquid crystal elastomer model. More...
 
struct  LiquidCrystalElastomerBertoldi
 Bertoldi's liquid crystal elastomer model Paper: Li, S., Librandi, G., Yao, Y., Richard, A. J., Schneider‐Yamamura, A., Aizenberg, J., & Bertoldi, K. (2021). Controlling Liquid Crystal Orientations for Programmable Anisotropic Transformations in Cellular Microstructures. Advanced Materials, 33(42), 2105024. More...
 
struct  SolidMaterialInputOptions
 Contains function that defines the schema for solid mechanics materials. More...
 
struct  ThermalMaterialInputOptions
 Contains function that defines the schema for heat transfer materials. More...
 
class  SolidMechanics
 
class  SolidMechanics< order, dim, Parameters< parameter_space... >, std::integer_sequence< int, parameter_indices... > >
 The nonlinear solid solver class. More...
 
class  SolidMechanicsContact
 
class  SolidMechanicsContact< order, dim, Parameters< parameter_space... >, std::integer_sequence< int, parameter_indices... > >
 The nonlinear solid with contact solver class. More...
 
struct  SolidMechanicsInputOptions
 Stores all information held in the input file that is used to configure the solver. More...
 
class  FiniteElementDual
 Class for encapsulating the dual vector space of a finite element space (i.e. the space of linear forms as applied to a specific basis set) More...
 
class  FiniteElementState
 Class for encapsulating the critical MFEM components of a primal finite element field. More...
 
class  FiniteElementVector
 Class for encapsulating the data associated with a vector derived from a MFEM finite element space. Specifically, it contains the information needed for both primal finite element state fields and dual finite element vectors. More...
 
class  StateManager
 Manages the lifetimes of FEState objects such that restarts are abstracted from physics modules. More...
 
class  Thermomechanics
 The operator-split thermal-structural solver. More...
 
struct  ThermomechanicsInputOptions
 Stores all information held in the input file that is used to configure the thermal structural solver. More...
 

Typedefs

template<typename T , int dim, ExecutionSpace space>
using ExecArray = axom::Array< T, dim, detail::execution_to_memory_v< space > >
 Alias for an Array corresponding to a particular ExecutionSpace.
 
template<typename T , int dim = 1>
using CPUArray = ExecArray< T, dim, ExecutionSpace::CPU >
 Alias for an array on the CPU.
 
template<typename T , int dim = 1>
using GPUArray = ExecArray< T, dim, ExecutionSpace::CPU >
 Alias for an array on the GPU.
 
template<typename T , int dim = 1>
using UnifiedArray = ExecArray< T, dim, ExecutionSpace::CPU >
 Alias for an array in unified memory.
 
template<typename T , int dim, ExecutionSpace space>
using ExecArrayView = axom::ArrayView< T, dim, detail::execution_to_memory_v< space > >
 Alias for an ArrayView corresponding to a particular ExecutionSpace.
 
template<typename T , int dim = 1>
using CPUArrayView = ExecArrayView< T, dim, ExecutionSpace::CPU >
 Alias for an array view on the CPU.
 
using vec2 = tensor< double, 2 >
 statically sized vector of 2 doubles
 
using vec3 = tensor< double, 3 >
 statically sized vector of 3 doubles
 
using mat2 = tensor< double, 2, 2 >
 statically sized 2x2 matrix of doubles
 
using mat3 = tensor< double, 3, 3 >
 statically sized 3x3 matrix of doubles
 
template<typename T , int n1, int n2 = 1>
using reduced_tensor = std::conditional_t<(n1==1 &&n2==1), double, std::conditional_t< n1==1, tensor< T, n2 >, std::conditional_t< n2==1, tensor< T, n1 >, tensor< T, n1, n2 > >> >
 Removes 1s from tensor dimensions For example, a tensor<T, 1, 10> is equivalent to a tensor<T, 10> More...
 
template<typename T1 , typename T2 >
using outer_product_t = typename detail::outer_prod< T1, T2 >::type
 a type function that returns the tensor type of an outer product of two tensors More...
 
template<int i, int n, typename T >
using one_hot_t = typename one_hot< i, n, T >::type
 a tuple type with n entries, all of which are of type serac::zero, except for the i^{th} entry, which is of type T More...
 
using var_hardening_t = std::variant< solid_mechanics::PowerLawHardening, solid_mechanics::VoceHardening >
 Holds all possible isotropic hardening laws that can be utilized in our input file.
 
using var_solid_material_t = std::variant< solid_mechanics::NeoHookean, solid_mechanics::LinearIsotropic, solid_mechanics::J2, solid_mechanics::J2Nonlinear< solid_mechanics::PowerLawHardening >, solid_mechanics::J2Nonlinear< solid_mechanics::VoceHardening > >
 All possible solid mechanics materials that can be utilized in our input file.
 
using var_thermal_material_t = std::variant< heat_transfer::LinearIsotropicConductor, heat_transfer::LinearConductor< 2 >, heat_transfer::LinearConductor< 3 > >
 Holds all possible heat transfer materials that can be utilized in our Input Deck.
 
using GeneralCoefficient = variant< std::shared_ptr< mfem::Coefficient >, std::shared_ptr< mfem::VectorCoefficient > >
 A sum type for encapsulating either a scalar or vector coeffient.
 

Enumerations

enum class  ExecutionSpace { CPU , GPU , Dynamic }
 enum used for signalling whether or not to perform certain calculations on the CPU or GPU
 
enum class  Family {
  QOI , H1 , HCURL , HDIV ,
  L2
}
 Element conformity. More...
 
enum class  TimestepMethod {
  QuasiStatic , BackwardEuler , SDIRK33 , ForwardEuler ,
  RK2 , RK3SSP , RK4 , GeneralizedAlpha ,
  ImplicitMidpoint , SDIRK23 , SDIRK34 , Newmark ,
  HHTAlpha , WBZAlpha , AverageAcceleration , LinearAcceleration ,
  CentralDifference , FoxGoodwin
}
 Timestep method of a solver. More...
 
enum class  DirichletEnforcementMethod { DirectControl , RateControl , FullControl }
 this enum describes which way to enforce the time-varying constraint u(t) == U(t) More...
 
enum class  LinearSolver { CG , GMRES , SuperLU , Strumpack }
 Linear solution method indicator. More...
 
enum class  NonlinearSolver {
  Newton , LBFGS , KINFullStep , KINBacktrackingLineSearch ,
  KINPicard
}
 Nonlinear solver method indicator. More...
 
enum class  AMGXSolver {
  AMG , PCGF , CG , PCG ,
  PBICGSTAB , BICGSTAB , FGMRES , JACOBI_L1 ,
  GS , POLYNOMIAL , KPZ_POLYNOMIAL , BLOCK_JACOBI ,
  MULTICOLOR_GS , MULTICOLOR_DILU
}
 Solver types supported by AMGX. More...
 
enum class  Preconditioner {
  HypreJacobi , HypreL1Jacobi , HypreGaussSeidel , HypreAMG ,
  HypreILU , AMGX , None
}
 The type of preconditioner to be used. More...
 
enum class  GeometricNonlinearities { On , Off }
 Enum to set the geometric nonlinearity flag. More...
 
enum class  ContactMethod { SingleMortar }
 Methodology for enforcing contact constraints (i.e. how you form the constraint equations) More...
 
enum class  ContactEnforcement { Penalty , LagrangeMultiplier }
 Describes how to enforce the contact constraint equations. More...
 
enum class  ContactType { TiedNormal , Frictionless }
 Mechanical constraint type on contact surfaces. More...
 
enum class  ElementType { H1 , HCURL , HDIV , L2 }
 The type of a finite element basis function. More...
 

Functions

void defineInputFileSchema (axom::inlet::Inlet &inlet)
 Define the input file structure for the driver code. More...
 
std::string about ()
 Returns a string about the configuration of Serac. More...
 
std::string gitSHA ()
 Returns a string for the Git SHA when the driver was built. More...
 
void printRunInfo ()
 Outputs basic run information to the screen. More...
 
std::string version (bool add_SHA=true)
 Returns a string for the version of Serac. More...
 
template<typename T , int dim, axom::MemorySpace space>
auto view (axom::Array< T, dim, space > &arr)
 convenience function for creating a view of an axom::Array type
 
std::pair< int, int > getMPIInfo (MPI_Comm comm=MPI_COMM_WORLD)
 Returns the number of processes and rank for an MPI communicator. More...
 
std::pair< int, int > initialize (int argc, char *argv[], MPI_Comm comm=MPI_COMM_WORLD)
 Initializes MPI, signal handling, and logging. More...
 
void exitGracefully (bool error=false)
 Exits the program gracefully after cleaning up necessary tasks. More...
 
template<typename T , typename T0 , typename T1 >
constexpr T & get (variant< T0, T1 > &v)
 Returns the variant member of specified type. More...
 
template<typename T , typename T0 , typename T1 >
constexpr const T & get (const variant< T0, T1 > &v)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename Visitor , typename Variant >
constexpr decltype(auto) visit (Visitor visitor, Variant &&v)
 Applies a functor to the active variant element. More...
 
template<typename T , typename T0 , typename T1 >
bool holds_alternative (const variant< T0, T1 > &v)
 Checks whether a variant's active member is of a certain type. More...
 
template<typename T , typename T0 , typename T1 >
T * get_if (variant< T0, T1 > *v)
 Returns the member of requested type if it's active, otherwise nullptr. More...
 
template<typename T , typename T0 , typename T1 >
const T * get_if (const variant< T0, T1 > *v)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
mfem::Mesh buildMeshFromFile (const std::string &mesh_file)
 Constructs an MFEM mesh from a file. More...
 
void squish (mfem::Mesh &mesh)
 a transformation from the unit disk/sphere (in L1 norm) to a unit disk/sphere (in L2 norm) More...
 
mfem::Mesh buildDiskMesh (int approx_number_of_elements)
 Constructs a 2D MFEM mesh of a unit disk, centered at the origin. More...
 
mfem::Mesh buildBallMesh (int approx_number_of_elements)
 Constructs a 3D MFEM mesh of a unit ball, centered at the origin. More...
 
mfem::Mesh buildRectangleMesh (int elements_in_x, int elements_in_y, double size_x=1., double size_y=1.)
 Constructs a 2D MFEM mesh of a rectangle. More...
 
mfem::Mesh buildCuboidMesh (int elements_in_x, int elements_in_y, int elements_in_z, double size_x=1., double size_y=1., double size_z=1.)
 Constructs a 3D MFEM mesh of a cuboid. More...
 
mfem::Mesh buildCylinderMesh (int radial_refinement, int elements_lengthwise, double radius, double height)
 Constructs a 3D MFEM mesh of a cylinder. More...
 
mfem::Mesh buildRing (int radial_refinement, double inner_radius, double outer_radius, double total_angle, int sectors)
 Constructs a 2D MFEM mesh of a ring.
 
mfem::Mesh buildRingMesh (int radial_refinement, double inner_radius, double outer_radius, double total_angle=M_PI, int sectors=8)
 Constructs a 2D MFEM mesh of a ring. More...
 
mfem::Mesh buildHollowCylinderMesh (int radial_refinement, int elements_lengthwise, double inner_radius, double outer_radius, double height, double total_angle=M_PI, int sectors=8)
 Constructs a 3D MFEM mesh of a hollow cylinder. More...
 
mfem::Mesh build_hollow_quarter_cylinder (std::size_t radial_divisions, std::size_t angular_divisions, std::size_t vertical_divisions, double inner_radius, double outer_radius, double height)
 Constructs an MFEM mesh of a hollow cylinder restricted to the first orthant. More...
 
std::unique_ptr< mfem::HypreParMatrix > buildMonolithicMatrix (const mfem::BlockOperator &block_operator)
 Function for building a monolithic parallel Hypre matrix from a block system of smaller Hypre matrices. More...
 
std::unique_ptr< mfem::NewtonSolver > buildNonlinearSolver (NonlinearSolverOptions nonlinear_opts={}, MPI_Comm comm=MPI_COMM_WORLD)
 Build a nonlinear solver using the nonlinear option struct. More...
 
std::pair< std::unique_ptr< mfem::Solver >, std::unique_ptr< mfem::Solver > > buildLinearSolverAndPreconditioner (LinearSolverOptions linear_opts={}, MPI_Comm comm=MPI_COMM_WORLD)
 Build the linear solver and its associated preconditioner given a linear options struct. More...
 
std::unique_ptr< mfem::Solver > buildPreconditioner (Preconditioner preconditioner, int print_level=0,[[maybe_unused]] MPI_Comm comm=MPI_COMM_WORLD)
 Build a preconditioner from the available options. More...
 
auto differentiate_wrt (const mfem::Vector &v)
 this function is intended to only be used in combination with serac::Functional::operator(), as a way for the user to express that it should both evaluate and differentiate w.r.t. a specific argument (only 1 argument at a time) More...
 
bool operator< (const ElemInfo &x, const ElemInfo &y)
 operator for sorting lexicographically by {global_row, global_col} More...
 
bool operator!= (const ElemInfo &x, const ElemInfo &y)
 operator determining inequality by {global_row, global_col} More...
 
SignedIndex decodeSignedIndex (int i)
 mfem will frequently encode {sign, index} into a single int32_t. This function decodes those values. More...
 
bool isHcurl (const mfem::ParFiniteElementSpace &fes)
 return whether or not the underlying function space is Hcurl or not More...
 
bool isL2 (const mfem::ParFiniteElementSpace &fes)
 return whether or not the underlying function space is L2 or not More...
 
bool compatibleWithFaceRestriction (const mfem::ParFiniteElementSpace &fes)
 attempt to characterize which FiniteElementSpaces mfem::FaceRestriction actually works with More...
 
template<typename T , ExecutionSpace exec>
ExecArray< T, 3, exec > allocateMemoryForBdrElementGradients (const mfem::ParFiniteElementSpace &trial_fes, const mfem::ParFiniteElementSpace &test_fes)
 this is a (hopefully) temporary measure to work around the fact that mfem's support for querying information about boundary elements is inconsistent, or entirely unimplemented. If the finite element spaces both work with mfem::FaceRestriction, it will return a 3D array sized to store the boundary element gradient matrices, else the 3D array will have dimensions 0x0x0 to indicate that it is unused. More...
 
template<typename T , ExecutionSpace exec>
ExecArray< T, 2, exec > allocateMemoryForBdrElementGradients (const mfem::ParFiniteElementSpace &fes)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<int d>
std::vector< tensor< double, d > > gather (const mfem::Vector &coordinates, mfem::Array< int > ids)
 gather vertex coordinates for a list of vertices More...
 
Domain EntireDomain (const mfem::Mesh &mesh)
 constructs a domain from all the elements in a mesh
 
Domain EntireBoundary (const mfem::Mesh &mesh)
 constructs a domain from all the boundary elements in a mesh
 
std::vector< int > set_operation (set_op op, const std::vector< int > &a, const std::vector< int > &b)
 return a std::vector that is the result of applying (a op b)
 
Domain set_operation (set_op op, const Domain &a, const Domain &b)
 return a Domain that is the result of applying (a op b)
 
Domain operator| (const Domain &a, const Domain &b)
 create a new domain that is the union of a and b
 
Domain operator& (const Domain &a, const Domain &b)
 create a new domain that is the intersection of a and b
 
Domain operator- (const Domain &a, const Domain &b)
 create a new domain that is the set difference of a and b
 
template<int dim>
auto by_attr (int value)
 convenience predicate for creating domains by attribute
 
template<typename T >
 dual (double, T) -> dual< T >
 class template argument deduction guide for type dual. More...
 
template<typename gradient_type >
constexpr SERAC_HOST_DEVICE auto operator+ (dual< gradient_type > a, double b)
 addition of a dual number and a non-dual number
 
template<typename gradient_type >
constexpr SERAC_HOST_DEVICE auto operator+ (double a, dual< gradient_type > b)
 addition of a dual number and a non-dual number
 
template<typename gradient_type_a , typename gradient_type_b >
constexpr SERAC_HOST_DEVICE auto operator+ (dual< gradient_type_a > a, dual< gradient_type_b > b)
 addition of two dual numbers
 
template<typename gradient_type >
constexpr auto operator- (dual< gradient_type > x)
 unary negation of a dual number
 
template<typename gradient_type >
constexpr SERAC_HOST_DEVICE auto operator- (dual< gradient_type > a, double b)
 subtraction of a non-dual number from a dual number
 
template<typename gradient_type >
constexpr SERAC_HOST_DEVICE auto operator- (double a, dual< gradient_type > b)
 subtraction of a dual number from a non-dual number
 
template<typename gradient_type_a , typename gradient_type_b >
constexpr SERAC_HOST_DEVICE auto operator- (dual< gradient_type_a > a, dual< gradient_type_b > b)
 subtraction of two dual numbers
 
template<typename gradient_type >
constexpr SERAC_HOST_DEVICE auto operator* (const dual< gradient_type > &a, double b)
 multiplication of a dual number and a non-dual number
 
template<typename gradient_type >
constexpr SERAC_HOST_DEVICE auto operator* (double a, const dual< gradient_type > &b)
 multiplication of a dual number and a non-dual number
 
template<typename gradient_type_a , typename gradient_type_b >
constexpr SERAC_HOST_DEVICE auto operator* (dual< gradient_type_a > a, dual< gradient_type_b > b)
 multiplication of two dual numbers
 
template<typename gradient_type >
constexpr SERAC_HOST_DEVICE auto operator/ (const dual< gradient_type > &a, double b)
 division of a dual number by a non-dual number
 
template<typename gradient_type >
constexpr SERAC_HOST_DEVICE auto operator/ (double a, const dual< gradient_type > &b)
 division of a non-dual number by a dual number
 
template<typename gradient_type_a , typename gradient_type_b >
constexpr SERAC_HOST_DEVICE auto operator/ (dual< gradient_type_a > a, dual< gradient_type_b > b)
 division of two dual numbers
 
 binary_comparator_overload (<)
 implement operator< for dual numbers More...
 
 binary_comparator_overload (<=)
 implement operator<= for dual numbers
 
 binary_comparator_overload (>=)
 implement operator>= for dual numbers
 
template<typename gradient_type >
constexpr SERAC_HOST_DEVICE auto & operator+= (dual< gradient_type > &a, const dual< gradient_type > &b)
 compound assignment (+) for dual numbers
 
template<typename gradient_type >
constexpr SERAC_HOST_DEVICE auto & operator-= (dual< gradient_type > &a, const dual< gradient_type > &b)
 compound assignment (-) for dual numbers
 
template<typename gradient_type >
constexpr SERAC_HOST_DEVICE auto & operator+= (dual< gradient_type > &a, double b)
 compound assignment (+) for dual numbers with double righthand side
 
template<typename gradient_type >
constexpr SERAC_HOST_DEVICE auto & operator-= (dual< gradient_type > &a, double b)
 compound assignment (-) for dual numbers with double righthand side
 
template<typename gradient_type >
SERAC_HOST_DEVICE auto abs (dual< gradient_type > x)
 Implementation of absolute value function for dual numbers. More...
 
template<typename gradient_type >
SERAC_HOST_DEVICE auto max (dual< gradient_type > a, double b)
 Implementation of max for dual numbers. More...
 
template<typename gradient_type >
SERAC_HOST_DEVICE auto max (double a, dual< gradient_type > b)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename gradient_type >
SERAC_HOST_DEVICE auto max (dual< gradient_type > a, dual< gradient_type > b)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename gradient_type >
SERAC_HOST_DEVICE auto min (dual< gradient_type > a, double b)
 Implementation of min for dual numbers. More...
 
template<typename gradient_type >
SERAC_HOST_DEVICE auto min (double a, dual< gradient_type > b)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename gradient_type >
SERAC_HOST_DEVICE auto min (dual< gradient_type > a, dual< gradient_type > b)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename gradient_type >
SERAC_HOST_DEVICE auto sqrt (dual< gradient_type > x)
 implementation of square root for dual numbers
 
template<typename gradient_type >
SERAC_HOST_DEVICE auto cos (dual< gradient_type > a)
 implementation of cosine for dual numbers
 
template<typename gradient_type >
SERAC_HOST_DEVICE auto sin (dual< gradient_type > a)
 implementation of sine for dual numbers
 
template<typename gradient_type >
SERAC_HOST_DEVICE auto atan (dual< gradient_type > a)
 implementation of atan for dual numbers
 
template<typename gradient_type >
SERAC_HOST_DEVICE auto atan2 (dual< gradient_type > y, dual< gradient_type > x)
 implementation of atan2 for dual numbers
 
template<typename gradient_type >
SERAC_HOST_DEVICE auto atan2 (double y, dual< gradient_type > x)
 implementation of atan2 for dual numbers
 
template<typename gradient_type >
SERAC_HOST_DEVICE auto atan2 (dual< gradient_type > y, double x)
 implementation of atan2 for dual numbers
 
template<typename gradient_type >
SERAC_HOST_DEVICE auto asin (dual< gradient_type > a)
 implementation of asin for dual numbers
 
template<typename gradient_type >
SERAC_HOST_DEVICE auto acos (dual< gradient_type > a)
 implementation of acos for dual numbers
 
template<typename gradient_type >
SERAC_HOST_DEVICE auto exp (dual< gradient_type > a)
 implementation of exponential function for dual numbers
 
template<typename gradient_type >
SERAC_HOST_DEVICE auto log (dual< gradient_type > a)
 implementation of the natural logarithm function for dual numbers
 
template<typename gradient_type >
SERAC_HOST_DEVICE auto log1p (dual< gradient_type > a)
 implementation of the natural logarithm of one plus the argument function for dual numbers
 
template<typename gradient_type >
SERAC_HOST_DEVICE auto pow (dual< gradient_type > a, dual< gradient_type > b)
 implementation of a (dual) raised to the b (dual) power
 
template<typename gradient_type >
SERAC_HOST_DEVICE auto pow (double a, dual< gradient_type > b)
 implementation of a (non-dual) raised to the b (dual) power
 
template<typename gradient_type >
SERAC_HOST_DEVICE auto pow (dual< gradient_type > a, double b)
 implementation of a (dual) raised to the b (non-dual) power
 
template<typename T , int... n>
auto & operator<< (std::ostream &out, dual< T > A)
 overload of operator<< for dual to work with std::cout and other std::ostreams
 
constexpr SERAC_HOST_DEVICE auto make_dual (double x)
 promote a value to a dual number of the appropriate type
 
template<typename T >
constexpr SERAC_HOST_DEVICE auto get_value (const T &arg)
 return the "value" part from a given type. For non-dual types, this is just the identity function
 
template<typename T >
constexpr SERAC_HOST_DEVICE auto get_value (dual< T > arg)
 return the "value" part from a dual number type
 
template<typename gradient_type >
constexpr SERAC_HOST_DEVICE auto get_gradient (dual< gradient_type > arg)
 return the "gradient" part from a dual number type
 
template<mfem::Geometry::Type g>
constexpr SERAC_HOST_DEVICE int elements_per_block (int q)
 this function returns information about how many elements should be processed by a single thread block in CUDA (note: the optimal values are hardware and problem specific, but these values are still significantly faster than naively allocating only 1 element / block) More...
 
template<Family f, typename T , int q, int dim>
SERAC_HOST_DEVICE void parent_to_physical (tensor< T, q > &qf_input, const tensor< double, dim, dim, q > &jacobians)
 transform information in the parent space (i.e. values and derivatives w.r.t {xi, eta, zeta}) into the physical space (i.e. values and derivatives w.r.t. {x, y, z}) More...
 
template<Family f, typename T , int q, int dim>
SERAC_HOST_DEVICE void physical_to_parent (tensor< T, q > &qf_output, const tensor< double, dim, dim, q > &jacobians)
 transform information in the physical space (i.e. sources and fluxes w.r.t {x, y, z}) back to the parent space (i.e. values and derivatives w.r.t. {xi, eta, zeta}). Note: this also multiplies by the outputs by the determinant of the quadrature point Jacobian. More...
 
template<typename... T>
constexpr uint32_t index_of_differentiation ()
 given a list of types, this function returns the index that corresponds to the type dual_vector. More...
 
void check_for_missing_nodal_gridfunc (const mfem::Mesh &mesh)
 function for verifying that the mesh has been fully initialized
 
void check_for_unsupported_elements (const mfem::Mesh &mesh)
 function for verifying that there are no unsupported element types in the mesh
 
template<typename function_space >
std::pair< std::unique_ptr< mfem::ParFiniteElementSpace >, std::unique_ptr< mfem::FiniteElementCollection > > generateParFiniteElementSpace (mfem::ParMesh *mesh)
 create an mfem::ParFiniteElementSpace from one of serac's tag types: H1, Hcurl, L2 More...
 
template<int Q, mfem::Geometry::Type geom, typename function_space >
void compute_geometric_factors (mfem::Vector &positions_q, mfem::Vector &jacobians_q, const mfem::Vector &positions_e, const std::vector< int > &elements)
 a kernel to compute the positions and jacobians at each quadrature point (mfem calls this "geometric factors") More...
 
constexpr int num_quadrature_points (mfem::Geometry::Type g, int Q)
 return the number of quadrature points in a Gauss-Legendre rule with parameter "Q" More...
 
constexpr int dimension_of (mfem::Geometry::Type g)
 Returns the dimension of an element geometry. More...
 
std::array< uint32_t, mfem::Geometry::NUM_GEOMETRIES > geometry_counts (const mfem::Mesh &mesh)
 count the number of elements of each geometry in a mesh More...
 
std::array< uint32_t, mfem::Geometry::NUM_GEOMETRIES > boundary_geometry_counts (const mfem::Mesh &mesh)
 count the number of boundary elements of each geometry in a mesh More...
 
template<mfem::Geometry::Type geom, int Q, typename test , typename... trials, typename lambda_type , typename qpt_data_type >
void generate_kernels (FunctionSignature< test(trials...)> s, Integral &integral, lambda_type &&qf, std::shared_ptr< QuadratureData< qpt_data_type > > qdata)
 function to generate kernels held by an Integral object of type "Domain", with a specific element type More...
 
template<typename s , int Q, int dim, typename lambda_type , typename qpt_data_type >
Integral MakeDomainIntegral (const Domain &domain, lambda_type &&qf, std::shared_ptr< QuadratureData< qpt_data_type > > qdata, std::vector< uint32_t > argument_indices)
 function to generate kernels held by an Integral object of type "Domain", for all element types More...
 
template<mfem::Geometry::Type geom, int Q, typename test , typename... trials, typename lambda_type >
void generate_bdr_kernels (FunctionSignature< test(trials...)> s, Integral &integral, lambda_type &&qf)
 function to generate kernels held by an Integral object of type "BoundaryDomain", with a specific element type More...
 
template<typename s , int Q, int dim, typename lambda_type >
Integral MakeBoundaryIntegral (const Domain &domain, lambda_type &&qf, std::vector< uint32_t > argument_indices)
 function to generate kernels held by an Integral object of type "Boundary", for all element types More...
 
template<int m>
constexpr SERAC_HOST_DEVICE isotropic_tensor< double, m, m > Identity ()
 return the identity matrix of the specified size More...
 
template<typename S , typename T , int m>
constexpr SERAC_HOST_DEVICE auto operator* (S scale, isotropic_tensor< T, m, m > I)
 scalar multiplication More...
 
template<typename S , typename T , int m>
constexpr SERAC_HOST_DEVICE auto operator* (isotropic_tensor< T, m, m > I, S scale)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename S , typename T , int m>
constexpr SERAC_HOST_DEVICE auto operator+ (isotropic_tensor< S, m, m > I1, isotropic_tensor< T, m, m > I2)
 addition of isotropic tensors More...
 
template<typename S , typename T , int m>
constexpr SERAC_HOST_DEVICE auto operator- (isotropic_tensor< S, m, m > I1, isotropic_tensor< T, m, m > I2)
 difference of isotropic tensors More...
 
template<typename S , typename T , int m>
constexpr SERAC_HOST_DEVICE auto operator+ (const isotropic_tensor< S, m, m > &I, const tensor< T, m, m > &A)
 sum of isotropic and (nonisotropic) tensor More...
 
template<typename S , typename T , int m>
constexpr SERAC_HOST_DEVICE auto operator+ (const tensor< S, m, m > &A, const isotropic_tensor< T, m, m > &I)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename S , typename T , int m>
constexpr SERAC_HOST_DEVICE auto operator- (const isotropic_tensor< S, m, m > &I, const tensor< T, m, m > &A)
 difference of isotropic and (nonisotropic) tensor More...
 
template<typename S , typename T , int m>
constexpr SERAC_HOST_DEVICE auto operator- (const tensor< S, m, m > &A, const isotropic_tensor< T, m, m > &I)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename S , typename T , int m, int... n>
constexpr SERAC_HOST_DEVICE auto dot (const isotropic_tensor< S, m, m > &I, const tensor< T, m, n... > &A)
 dot product between an isotropic and (nonisotropic) tensor More...
 
template<typename S , typename T , int m, int... n>
constexpr SERAC_HOST_DEVICE auto dot (const tensor< S, n... > &A, isotropic_tensor< T, m, m > I)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename S , typename T , int m>
constexpr SERAC_HOST_DEVICE auto double_dot (const isotropic_tensor< S, m, m > &I, const tensor< T, m, m > &A)
 double-dot product between an isotropic and (nonisotropic) tensor More...
 
template<typename T , int m>
constexpr SERAC_HOST_DEVICE auto sym (const isotropic_tensor< T, m, m > &I)
 return the symmetric part of an isotropic tensor More...
 
template<typename T , int m>
constexpr SERAC_HOST_DEVICE auto antisym (const isotropic_tensor< T, m, m > &)
 return the antisymmetric part of an isotropic tensor More...
 
template<typename T , int m>
constexpr SERAC_HOST_DEVICE auto tr (const isotropic_tensor< T, m, m > &I)
 calculate the trace of an isotropic tensor More...
 
template<typename T , int m>
constexpr SERAC_HOST_DEVICE auto transpose (const isotropic_tensor< T, m, m > &I)
 return the transpose of an isotropic tensor More...
 
template<typename T , int m>
constexpr SERAC_HOST_DEVICE auto inv (const isotropic_tensor< T, m, m > &I)
 return the inverse of an isotropic tensor More...
 
template<typename T , int m>
constexpr SERAC_HOST_DEVICE auto det (const isotropic_tensor< T, m, m > &I)
 compute the determinant of an isotropic tensor More...
 
template<typename T , int m>
constexpr SERAC_HOST_DEVICE auto norm (const isotropic_tensor< T, m, m > &I)
 compute the Frobenius norm (sqrt(tr(dot(transpose(I), I)))) of an isotropic tensor More...
 
template<typename T , int m>
constexpr SERAC_HOST_DEVICE auto squared_norm (const isotropic_tensor< T, m, m > &I)
 compute the squared Frobenius norm (tr(dot(transpose(I), I))) of an isotropic tensor More...
 
template<int m>
constexpr SERAC_HOST_DEVICE auto SymmetricIdentity ()
 a helper function for creating the rank-4 isotropic tensor defined by: d(sym(A)_{ij}) / d(A_{kl}) More...
 
template<int m>
constexpr SERAC_HOST_DEVICE auto AntisymmetricIdentity ()
 a helper function for creating the rank-4 isotropic tensor defined by: d(antisym(A)_{ij}) / d(A_{kl}) More...
 
template<typename S , typename T , int m>
constexpr SERAC_HOST_DEVICE auto operator* (S scale, isotropic_tensor< T, m, m, m, m > I)
 scalar multiplication More...
 
template<typename S , typename T , int m>
constexpr SERAC_HOST_DEVICE auto operator* (isotropic_tensor< S, m, m, m, m > I, T scale)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename S , typename T , int m>
constexpr SERAC_HOST_DEVICE auto operator+ (isotropic_tensor< S, m, m, m, m > I1, isotropic_tensor< T, m, m, m, m > I2)
 addition of isotropic tensors More...
 
template<typename S , typename T , int m>
constexpr SERAC_HOST_DEVICE auto operator- (isotropic_tensor< S, m, m, m, m > I1, isotropic_tensor< T, m, m, m, m > I2)
 difference of isotropic tensors More...
 
template<typename S , typename T , int m, int... n>
constexpr SERAC_HOST_DEVICE auto double_dot (const isotropic_tensor< S, m, m, m, m > &I, const tensor< T, m, m, n... > &A)
 double-dot product between an isotropic and (nonisotropic) tensor More...
 
template<int n, typename T = double>
constexpr SERAC_HOST_DEVICE tensor< T, n > GaussLobattoNodes (T a=T(0), T b=T(1))
 The positions (in 1D space) of Gauss-Lobatto points. More...
 
template<int n, mfem::Geometry::Type geom>
constexpr SERAC_HOST_DEVICE auto GaussLegendreNodes ()
 The positions of Gauss-Legendre points for different geometries. More...
 
template<int n, mfem::Geometry::Type geom>
constexpr SERAC_HOST_DEVICE auto GaussLegendreWeights ()
 The weights associated with each Gauss-Legendre point. More...
 
constexpr SERAC_HOST_DEVICE int factorial (int n)
 compute n! More...
 
template<int n, typename T >
constexpr SERAC_HOST_DEVICE tensor< T, n > powers (T x)
 compute the first n powers of x More...
 
template<int n, typename S >
constexpr SERAC_HOST_DEVICE tensor< S, n > ChebyshevT (S x)
 Chebyshev polynomials of the first kind Satisfying: T_n(cos(t)) == cos(n*t) More...
 
template<int n, typename T >
SERAC_HOST_DEVICE tensor< T, n > ChebyshevU (T x)
 Chebyshev polynomials of the second kind Satisfying: sin(t) U_n(cos(t)) == sin((n+1)*t) More...
 
template<int n, typename T >
SERAC_HOST_DEVICE tensor< T, n > Legendre (T x)
 Legendre Polynomials, orthogonal on the domain (-1, 1) with unit weight function. More...
 
template<int n, typename T >
SERAC_HOST_DEVICE tensor< T, n > Bernstein (T s)
 Bernstein Polynomials on the domain [0, 1]. More...
 
template<int n, typename T >
constexpr SERAC_HOST_DEVICE tensor< T, n > GaussLobattoInterpolation ([[maybe_unused]] T x)
 Lagrange Interpolating polynomials for nodes at Gauss-Lobatto points on the interval [0, 1]. More...
 
template<int n, typename T >
constexpr SERAC_HOST_DEVICE tensor< T, n > GaussLobattoInterpolationDerivative ([[maybe_unused]] T x)
 Derivatives of the Lagrange Interpolating polynomials for nodes at Gauss-Lobatto points on the interval [0, 1]. More...
 
template<int n, typename T >
constexpr SERAC_HOST_DEVICE tensor< T, n > GaussLegendreInterpolation ([[maybe_unused]] T x)
 Lagrange Interpolating polynomials for nodes at Gauss-Legendre points on the interval [0, 1]. More...
 
template<int n, typename T >
constexpr SERAC_HOST_DEVICE tensor< T, n > GaussLegendreInterpolationDerivative ([[maybe_unused]] T x)
 Derivatives of the Lagrange Interpolating polynomials for nodes at Gauss-Legendre points on the interval [-1, 1]. More...
 
template<mfem::Geometry::Type g, int Q>
constexpr SERAC_HOST_DEVICE auto GaussQuadratureRule ()
 Returns the Gauss-Legendre quadrature rule for an element and order. More...
 
template<typename T , int n1>
 tensor (const T(&data)[n1]) -> tensor< T, n1 >
 class template argument deduction guide for type tensor. More...
 
template<typename T , int n1, int n2>
 tensor (const T(&data)[n1][n2]) -> tensor< T, n1, n2 >
 class template argument deduction guide for type tensor. More...
 
constexpr SERAC_HOST_DEVICE auto operator+ (zero, zero)
 the sum of two zeros is zero
 
template<typename T >
constexpr SERAC_HOST_DEVICE auto operator+ (zero, T other)
 the sum of zero with something non-zero just returns the other value
 
template<typename T >
constexpr SERAC_HOST_DEVICE auto operator+ (T other, zero)
 the sum of zero with something non-zero just returns the other value
 
constexpr SERAC_HOST_DEVICE auto operator- (zero)
 the unary negation of zero is zero
 
constexpr SERAC_HOST_DEVICE auto operator- (zero, zero)
 the difference of two zeros is zero
 
template<typename T >
constexpr SERAC_HOST_DEVICE auto operator- (zero, T other)
 the difference of zero with something else is the unary negation of the other thing
 
template<typename T >
constexpr SERAC_HOST_DEVICE auto operator- (T other, zero)
 the difference of something else with zero is the other thing itself
 
constexpr SERAC_HOST_DEVICE auto operator* (zero, zero)
 the product of two zeros is zero
 
template<typename T >
constexpr SERAC_HOST_DEVICE auto operator* (zero, T)
 the product zero with something else is also zero
 
template<typename T >
constexpr SERAC_HOST_DEVICE auto operator* (T, zero)
 the product zero with something else is also zero
 
template<typename T >
constexpr SERAC_HOST_DEVICE auto operator/ (zero, T)
 zero divided by something is zero
 
template<typename T >
void operator/ (T, zero)
 Get a human-readable compiler error when you try to divide by zero.
 
constexpr SERAC_HOST_DEVICE auto operator+= (zero, zero)
 zero plus zero is zero
 
constexpr SERAC_HOST_DEVICE auto operator-= (zero, zero)
 zero minus zero is zero
 
template<int i>
SERAC_HOST_DEVICE zeroget (zero &x)
 let zero be accessed like a tuple
 
template<int i>
SERAC_HOST_DEVICE zero get (const zero &)
 let zero be accessed like a tuple
 
template<typename T >
constexpr SERAC_HOST_DEVICE zero dot (const T &, zero)
 the dot product of anything with zero is zero
 
template<typename T >
constexpr SERAC_HOST_DEVICE zero dot (zero, const T &)
 the dot product of anything with zero is zero
 
template<typename T , int... n>
constexpr SERAC_HOST_DEVICE auto tensor_with_shape (std::integer_sequence< int, n... >)
 Creates a tensor given the dimensions in a std::integer_sequence. More...
 
template<typename lambda_type >
SERAC_SUPPRESS_NVCC_HOSTDEVICE_WARNING constexpr SERAC_HOST_DEVICE auto make_tensor (lambda_type f)
 Creates a tensor of requested dimension by subsequent calls to a functor Can be thought of as analogous to std::transform in that the set of possible indices for dimensions n are transformed into the values of the tensor by f. More...
 
template<int n1, typename lambda_type >
SERAC_SUPPRESS_NVCC_HOSTDEVICE_WARNING constexpr SERAC_HOST_DEVICE auto make_tensor (lambda_type f)
 Creates a tensor of requested dimension by subsequent calls to a functor. More...
 
template<int n1, int n2, typename lambda_type >
SERAC_SUPPRESS_NVCC_HOSTDEVICE_WARNING constexpr SERAC_HOST_DEVICE auto make_tensor (lambda_type f)
 Creates a tensor of requested dimension by subsequent calls to a functor. More...
 
template<int n1, int n2, int n3, typename lambda_type >
SERAC_SUPPRESS_NVCC_HOSTDEVICE_WARNING constexpr SERAC_HOST_DEVICE auto make_tensor (lambda_type f)
 Creates a tensor of requested dimension by subsequent calls to a functor. More...
 
template<int n1, int n2, int n3, int n4, typename lambda_type >
SERAC_SUPPRESS_NVCC_HOSTDEVICE_WARNING constexpr SERAC_HOST_DEVICE auto make_tensor (lambda_type f)
 Creates a tensor of requested dimension by subsequent calls to a functor. More...
 
template<typename S , typename T , int m, int... n>
constexpr SERAC_HOST_DEVICE auto operator+ (const tensor< S, m, n... > &A, const tensor< T, m, n... > &B)
 return the sum of two tensors More...
 
template<typename T , int m, int... n>
constexpr SERAC_HOST_DEVICE auto operator- (const tensor< T, m, n... > &A)
 return the unary negation of a tensor More...
 
template<typename S , typename T , int m, int... n>
constexpr SERAC_HOST_DEVICE auto operator- (const tensor< S, m, n... > &A, const tensor< T, m, n... > &B)
 return the difference of two tensors More...
 
template<typename S , typename T , int m, int... n>
constexpr SERAC_HOST_DEVICE auto & operator+= (tensor< S, m, n... > &A, const tensor< T, m, n... > &B)
 compound assignment (+) on tensors More...
 
template<typename T , int n>
constexpr SERAC_HOST_DEVICE auto & operator+= (tensor< T, n, 1 > &A, const tensor< T, n > &B)
 compound assignment (+) on tensors More...
 
template<typename T , int n>
constexpr SERAC_HOST_DEVICE auto & operator+= (tensor< T, 1, n > &A, const tensor< T, n > &B)
 compound assignment (+) on tensors More...
 
template<typename T >
constexpr SERAC_HOST_DEVICE auto & operator+= (tensor< T, 1 > &A, const T &B)
 compound assignment (+) on tensors More...
 
template<typename T >
constexpr SERAC_HOST_DEVICE auto & operator+= (tensor< T, 1, 1 > &A, const T &B)
 compound assignment (+) on tensors More...
 
template<typename T , int... n>
constexpr SERAC_HOST_DEVICE auto & operator+= (tensor< T, n... > &A, zero)
 compound assignment (+) between a tensor and zero (no-op) More...
 
template<typename S , typename T , int m, int... n>
constexpr SERAC_HOST_DEVICE auto & operator-= (tensor< S, m, n... > &A, const tensor< T, m, n... > &B)
 compound assignment (-) on tensors More...
 
template<typename T , int... n>
constexpr SERAC_HOST_DEVICE auto & operator-= (tensor< T, n... > &A, zero)
 compound assignment (-) between a tensor and zero (no-op) More...
 
template<typename T , int n>
constexpr SERAC_HOST_DEVICE auto outer (double A, tensor< T, n > B)
 
template<typename T , int m>
constexpr SERAC_HOST_DEVICE auto outer (const tensor< T, m > &A, double B)
 
template<typename T , int n>
constexpr SERAC_HOST_DEVICE auto outer (zero, const tensor< T, n > &)
 
template<typename T , int n>
constexpr SERAC_HOST_DEVICE auto outer (const tensor< T, n > &, zero)
 
template<typename S , typename T , int m, int n>
constexpr SERAC_HOST_DEVICE auto outer (const tensor< S, m > &A, const tensor< T, n > &B)
 
template<typename S , typename T , int m, int n>
constexpr SERAC_HOST_DEVICE auto inner (const tensor< S, m, n > &A, const tensor< T, m, n > &B)
 this function contracts over all indices of the two tensor arguments More...
 
template<typename S , typename T , int m>
constexpr SERAC_HOST_DEVICE auto inner (const tensor< S, m > &A, const tensor< T, m > &B)
 
constexpr SERAC_HOST_DEVICE auto inner (double A, double B)
 
template<typename S , typename T , int m, int n, int p>
constexpr SERAC_HOST_DEVICE auto dot (const tensor< S, m, n > &A, const tensor< T, n, p > &B)
 this function contracts over the "middle" index of the two tensor arguments More...
 
template<typename T , int m>
constexpr SERAC_HOST_DEVICE auto dot (const tensor< T, m > &A, double B)
 
template<typename T , int m>
constexpr SERAC_HOST_DEVICE auto dot (double B, const tensor< T, m > &A)
 
template<typename S , typename T , int m>
constexpr SERAC_HOST_DEVICE auto dot (const tensor< S, m > &A, const tensor< T, m > &B)
 
template<typename S , typename T , int m, int n>
constexpr SERAC_HOST_DEVICE auto dot (const tensor< S, m > &A, const tensor< T, m, n > &B)
 
template<typename S , typename T , int m, int n, int p>
constexpr SERAC_HOST_DEVICE auto dot (const tensor< S, m > &A, const tensor< T, m, n, p > &B)
 
template<typename S , typename T , int m, int n, int p, int q>
constexpr SERAC_HOST_DEVICE auto dot (const tensor< S, m > &A, const tensor< T, m, n, p, q > &B)
 
template<typename S , typename T , int m, int n>
constexpr SERAC_HOST_DEVICE auto dot (const tensor< S, m, n > &A, const tensor< T, n > &B)
 
template<typename S , typename T , int m, int n, int p, int q, int r>
constexpr SERAC_HOST_DEVICE auto dot (const tensor< S, m, n > &A, const tensor< T, n, p, q, r > &B)
 
template<typename S , typename T , int m, int n, int p, int q>
constexpr SERAC_HOST_DEVICE auto dot (const tensor< S, m, n > &A, const tensor< T, n, p, q > &B)
 
template<typename S , typename T , int m, int n, int p>
constexpr SERAC_HOST_DEVICE auto dot (const tensor< S, m, n, p > &A, const tensor< T, p > &B)
 
template<typename S , typename T , typename U , int m, int n>
constexpr SERAC_HOST_DEVICE auto dot (const tensor< S, m > &u, const tensor< T, m, n > &A, const tensor< U, n > &v)
 
template<typename S , typename T , int m, int n, int p, int q>
constexpr SERAC_HOST_DEVICE auto dot (const tensor< S, m, n, p, q > &A, const tensor< T, q > &B)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename T >
auto cross (const tensor< T, 3, 2 > &A)
 compute the cross product of the columns of A: A(:,1) x A(:,2)
 
template<typename T >
auto cross (const tensor< T, 2, 1 > &v)
 return the in-plane components of the cross product of {v[0], v[1], 0} x {0, 0, 1}
 
template<typename T >
auto cross (const tensor< T, 2 > &v)
 return the in-plane components of the cross product of {v[0], v[1], 0} x {0, 0, 1}
 
template<typename S , typename T >
auto cross (const tensor< S, 3 > &u, const tensor< T, 3 > &v)
 compute the (right handed) cross product of two 3-vectors
 
template<typename S , typename T , int m, int n, int p, int q>
constexpr SERAC_HOST_DEVICE auto double_dot (const tensor< S, m, n, p, q > &A, const tensor< T, p, q > &B)
 double dot product, contracting over the two "middle" indices More...
 
template<typename S , typename T , int m, int n, int p>
constexpr SERAC_HOST_DEVICE auto double_dot (const tensor< S, m, n, p > &A, const tensor< T, n, p > &B)
 
template<typename S , typename T , int m, int n>
constexpr auto double_dot (const tensor< S, m, n > &A, const tensor< T, m, n > &B)
 
template<typename S , typename T , int... m, int... n>
constexpr SERAC_HOST_DEVICE auto operator* (const tensor< S, m... > &A, const tensor< T, n... > &B)
 this is a shorthand for dot(A, B)
 
template<typename T , int m>
constexpr SERAC_HOST_DEVICE auto squared_norm (const tensor< T, m > &A)
 Returns the squared Frobenius norm of the tensor. More...
 
template<typename T , int m, int n>
constexpr SERAC_HOST_DEVICE auto squared_norm (const tensor< T, m, n > &A)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename T , int... n>
constexpr SERAC_HOST_DEVICE auto squared_norm (const tensor< T, n... > &A)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename T , int... n>
SERAC_HOST_DEVICE auto norm (const tensor< T, n... > &A)
 Returns the Frobenius norm of the tensor. More...
 
constexpr SERAC_HOST_DEVICE auto norm (zero)
 overload of Frobenius norm for zero type
 
template<typename T , int... n>
SERAC_HOST_DEVICE auto normalize (const tensor< T, n... > &A)
 Normalizes the tensor Each element is divided by the Frobenius norm of the tensor,. More...
 
template<typename T , int n>
constexpr SERAC_HOST_DEVICE auto tr (const tensor< T, n, n > &A)
 Returns the trace of a square matrix. More...
 
template<typename T , int n>
constexpr SERAC_HOST_DEVICE auto sym (const tensor< T, n, n > &A)
 Returns the symmetric part of a square matrix. More...
 
template<typename T , int n>
constexpr SERAC_HOST_DEVICE auto antisym (const tensor< T, n, n > &A)
 Returns the antisymmetric part of a square matrix. More...
 
template<typename T , int n>
constexpr SERAC_HOST_DEVICE auto dev (const tensor< T, n, n > &A)
 Calculates the deviator of a matrix (rank-2 tensor) More...
 
template<typename T , int n>
constexpr SERAC_HOST_DEVICE auto diagonal_matrix (const tensor< T, n, n > &A)
 Returns a square matrix (rank-2 tensor) containing the diagonal entries of the input square matrix with zeros in the off-diagonal positions. More...
 
template<typename T , int n>
constexpr SERAC_HOST_DEVICE tensor< T, n, n > diag (const tensor< T, n > &d)
 Returns a square diagonal matrix by specifying the diagonal entries. More...
 
template<typename T , int n>
constexpr SERAC_HOST_DEVICE tensor< T, n > diag (const tensor< T, n, n > &D)
 Returns an array containing the diagonal entries of a square matrix. More...
 
template<int dim>
constexpr SERAC_HOST_DEVICE tensor< double, dim, dim > DenseIdentity ()
 Obtains the identity matrix of the specified dimension. More...
 
template<typename T , int m, int n>
constexpr SERAC_HOST_DEVICE auto transpose (const tensor< T, m, n > &A)
 Returns the transpose of the matrix. More...
 
template<typename T >
constexpr SERAC_HOST_DEVICE auto det (const tensor< T, 2, 2 > &A)
 Returns the determinant of a matrix. More...
 
template<typename T >
constexpr SERAC_HOST_DEVICE auto det (const tensor< T, 3, 3 > &A)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename T >
constexpr SERAC_HOST_DEVICE auto detApIm1 (const tensor< T, 2, 2 > &A)
 computes det(A + I) - 1, where precision is not lost when the entries A_{ij} << 1 More...
 
template<typename T >
constexpr SERAC_HOST_DEVICE auto detApIm1 (const tensor< T, 3, 3 > &A)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename T , int dim>
auto matrix_sqrt (const tensor< T, dim, dim > &A)
 compute the matrix square root of a square, real-valued, symmetric matrix i.e. given A, find B such that A = dot(B, B) More...
 
template<int i1, int i2, typename S , int m, int... n, typename T , int p, int q>
SERAC_HOST_DEVICE auto contract (const tensor< S, m, n... > &A, const tensor< T, p, q > &B)
 a convenience function that computes a dot product between two tensor, but that allows the user to specify which indices should be summed over. For example: More...
 
template<int i1, int i2, typename T >
SERAC_HOST_DEVICE auto contract (const zero &, const T &)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename T , int... n>
double relative_error (tensor< T, n... > A, tensor< T, n... > B)
 computes the relative error (in the frobenius norm) between two tensors of the same shape More...
 
template<int n>
SERAC_HOST_DEVICE bool is_symmetric (tensor< double, n, n > A, double tolerance=1.0e-8)
 Return whether a square rank 2 tensor is symmetric. More...
 
SERAC_HOST_DEVICE bool is_symmetric_and_positive_definite (tensor< double, 2, 2 > A)
 Return whether a matrix is symmetric and positive definite This check uses Sylvester's criterion, checking that each upper left subtensor has a determinant greater than zero. More...
 
SERAC_HOST_DEVICE bool is_symmetric_and_positive_definite (tensor< double, 3, 3 > A)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename T , int n, int... m>
constexpr SERAC_HOST_DEVICE auto solve_lower_triangular (const tensor< T, n, n > &L, const tensor< T, n, m... > &b, const tensor< int, n > &P)
 Solves a lower triangular system Ly = b. More...
 
template<typename T , int n, int... m>
constexpr SERAC_HOST_DEVICE auto solve_lower_triangular (const tensor< T, n, n > &L, const tensor< T, n, m... > &b)
 
template<typename T , int n, int... m>
constexpr SERAC_HOST_DEVICE auto solve_upper_triangular (const tensor< T, n, n > &U, const tensor< T, n, m... > &y)
 Solves an upper triangular system Ux = y. More...
 
template<typename S , typename T , int n, int... m>
constexpr SERAC_HOST_DEVICE auto linear_solve (const LuFactorization< S, n > &lu_factors, const tensor< T, n, m... > &b)
 
template<typename T , int n>
constexpr SERAC_HOST_DEVICE auto linear_solve (const LuFactorization< T, n > &, const zero)
 
constexpr SERAC_HOST_DEVICE tensor< double, 2, 2 > inv (const tensor< double, 2, 2 > &A)
 Inverts a matrix. More...
 
constexpr SERAC_HOST_DEVICE tensor< double, 3, 3 > inv (const tensor< double, 3, 3 > &A)
 
template<typename T , int n>
constexpr SERAC_HOST_DEVICE auto inv (const tensor< T, n, n > &A)
 
template<typename T , int m, int... n>
auto & operator<< (std::ostream &out, const tensor< T, m, n... > &A)
 recursively serialize the entries in a tensor to an ostream. Output format uses braces and comma separators to mimic C syntax for multidimensional array initialization. More...
 
auto & operator<< (std::ostream &out, zero)
 Write a zero out to an output stream. More...
 
SERAC_HOST_DEVICE void print (double value)
 print a double using printf, so that it is suitable for use inside cuda kernels. (used in final recursion of printf(tensor<...>)) More...
 
template<int m, int... n>
SERAC_HOST_DEVICE void print (const tensor< double, m, n... > &A)
 print a tensor using printf, so that it is suitable for use inside cuda kernels. More...
 
template<int n>
constexpr SERAC_HOST_DEVICE auto chop (const tensor< double, n > &A)
 replace all entries in a tensor satisfying |x| < 1.0e-10 by literal zero More...
 
template<int m, int n>
constexpr SERAC_HOST_DEVICE auto chop (const tensor< double, m, n > &A)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
SERAC_HOST_DEVICE auto get_gradient (double)
 Retrieves the gradient component of a double (which is nothing) More...
 
template<int... n>
constexpr SERAC_HOST_DEVICE auto get_gradient (const tensor< double, n... > &)
 get the gradient of type tensor (note: since its stored type is not a dual number, the derivative term is identically zero) More...
 
constexpr SERAC_HOST_DEVICE auto chain_rule (const zero, const zero)
 evaluate the change (to first order) in a function, f, given a small change in the input argument, dx.
 
template<typename T >
constexpr SERAC_HOST_DEVICE auto chain_rule (const zero, const T)
 
template<typename T >
constexpr SERAC_HOST_DEVICE auto chain_rule (const T, const zero)
 
constexpr SERAC_HOST_DEVICE auto chain_rule (const double df_dx, const double dx)
 
template<int... n>
constexpr SERAC_HOST_DEVICE auto chain_rule (const tensor< double, n... > &df_dx, const double dx)
 
template<int... n>
constexpr SERAC_HOST_DEVICE auto chain_rule (const tensor< double, n... > &df_dx, const tensor< double, n... > &dx)
 
template<int m, int... n>
constexpr SERAC_HOST_DEVICE auto chain_rule (const tensor< double, m, n... > &df_dx, const tensor< double, n... > &dx)
 
template<int m, int n, int... p>
SERAC_HOST_DEVICE auto chain_rule (const tensor< double, m, n, p... > &df_dx, const tensor< double, p... > &dx)
 
template<typename T , int... n>
constexpr SERAC_HOST_DEVICE int size (const tensor< T, n... > &)
 returns the total number of stored values in a tensor More...
 
constexpr SERAC_HOST_DEVICE int size (const double &)
 overload of size() for double, we say a double "stores" 1 value More...
 
constexpr SERAC_HOST_DEVICE int size (zero)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<int i, typename T , int... n>
constexpr SERAC_HOST_DEVICE int dimension (const tensor< T, n... > &)
 a function for querying the ith dimension of a tensor More...
 
template<typename T , int m, int... n>
constexpr SERAC_HOST_DEVICE int leading_dimension (tensor< T, m, n... >)
 a function for querying the first dimension of a tensor More...
 
template<typename T , int... n>
bool isnan (const tensor< T, n... > &A)
 returns true if any entry of a tensor is nan
 
bool isnan (const zero &)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename... T>
 tuple (T...) -> tuple< T... >
 Class template argument deduction rule for tuples. More...
 
template<typename... T>
SERAC_HOST_DEVICE tuple< T... > make_tuple (const T &... args)
 helper function for combining a list of values into a tuple More...
 
template<int i, typename... T>
constexpr SERAC_HOST_DEVICE auto & get (tuple< T... > &values)
 return a reference to the ith tuple entry More...
 
template<int i, typename... T>
constexpr SERAC_HOST_DEVICE const auto & get (const tuple< T... > &values)
 return a copy of the ith tuple entry More...
 
template<int i, typename... T>
constexpr SERAC_HOST_DEVICE auto type (const tuple< T... > &values)
 a function intended to be used for extracting the ith type from a tuple. More...
 
template<typename... S, typename... T, int... i>
constexpr SERAC_HOST_DEVICE auto plus_helper (const tuple< S... > &x, const tuple< T... > &y, std::integer_sequence< int, i... >)
 A helper function for the + operator of tuples. More...
 
template<typename... S, typename... T>
constexpr SERAC_HOST_DEVICE auto operator+ (const tuple< S... > &x, const tuple< T... > &y)
 return a tuple of values defined by elementwise sum of x and y More...
 
template<typename... T, int... i>
constexpr SERAC_HOST_DEVICE void plus_equals_helper (tuple< T... > &x, const tuple< T... > &y, std::integer_sequence< int, i... >)
 A helper function for the += operator of tuples. More...
 
template<typename... T>
constexpr SERAC_HOST_DEVICE auto operator+= (tuple< T... > &x, const tuple< T... > &y)
 add values contained in y, to the tuple x More...
 
template<typename... T, int... i>
constexpr SERAC_HOST_DEVICE void minus_equals_helper (tuple< T... > &x, const tuple< T... > &y, std::integer_sequence< int, i... >)
 A helper function for the -= operator of tuples. More...
 
template<typename... T>
constexpr SERAC_HOST_DEVICE auto operator-= (tuple< T... > &x, const tuple< T... > &y)
 add values contained in y, to the tuple x More...
 
template<typename... S, typename... T, int... i>
constexpr SERAC_HOST_DEVICE auto minus_helper (const tuple< S... > &x, const tuple< T... > &y, std::integer_sequence< int, i... >)
 A helper function for the - operator of tuples. More...
 
template<typename... S, typename... T>
constexpr SERAC_HOST_DEVICE auto operator- (const tuple< S... > &x, const tuple< T... > &y)
 return a tuple of values defined by elementwise difference of x and y More...
 
template<typename... T, int... i>
constexpr SERAC_HOST_DEVICE auto unary_minus_helper (const tuple< T... > &x, std::integer_sequence< int, i... >)
 A helper function for the - operator of tuples. More...
 
template<typename... T>
constexpr SERAC_HOST_DEVICE auto operator- (const tuple< T... > &x)
 return a tuple of values defined by applying the unary minus operator to each element of x More...
 
template<typename... S, typename... T, int... i>
constexpr SERAC_HOST_DEVICE auto div_helper (const tuple< S... > &x, const tuple< T... > &y, std::integer_sequence< int, i... >)
 A helper function for the / operator of tuples. More...
 
template<typename... S, typename... T>
constexpr SERAC_HOST_DEVICE auto operator/ (const tuple< S... > &x, const tuple< T... > &y)
 return a tuple of values defined by elementwise division of x by y More...
 
template<typename... T, int... i>
constexpr SERAC_HOST_DEVICE auto div_helper (const double a, const tuple< T... > &x, std::integer_sequence< int, i... >)
 A helper function for the / operator of tuples. More...
 
template<typename... T, int... i>
constexpr SERAC_HOST_DEVICE auto div_helper (const tuple< T... > &x, const double a, std::integer_sequence< int, i... >)
 A helper function for the / operator of tuples. More...
 
template<typename... T>
constexpr SERAC_HOST_DEVICE auto operator/ (const double a, const tuple< T... > &x)
 return a tuple of values defined by division of a by the elements of x More...
 
template<typename... T>
constexpr SERAC_HOST_DEVICE auto operator/ (const tuple< T... > &x, const double a)
 return a tuple of values defined by elementwise division of x by a More...
 
template<typename... S, typename... T, int... i>
constexpr SERAC_HOST_DEVICE auto mult_helper (const tuple< S... > &x, const tuple< T... > &y, std::integer_sequence< int, i... >)
 A helper function for the * operator of tuples. More...
 
template<typename... S, typename... T>
constexpr SERAC_HOST_DEVICE auto operator* (const tuple< S... > &x, const tuple< T... > &y)
 return a tuple of values defined by elementwise multiplication of x and y More...
 
template<typename... T, int... i>
constexpr SERAC_HOST_DEVICE auto mult_helper (const double a, const tuple< T... > &x, std::integer_sequence< int, i... >)
 A helper function for the * operator of tuples. More...
 
template<typename... T, int... i>
constexpr SERAC_HOST_DEVICE auto mult_helper (const tuple< T... > &x, const double a, std::integer_sequence< int, i... >)
 A helper function for the * operator of tuples. More...
 
template<typename... T>
constexpr SERAC_HOST_DEVICE auto operator* (const double a, const tuple< T... > &x)
 multiply each component of x by the value a on the left More...
 
template<typename... T>
constexpr SERAC_HOST_DEVICE auto operator* (const tuple< T... > &x, const double a)
 multiply each component of x by the value a on the right More...
 
template<typename... T, std::size_t... i>
auto & print_helper (std::ostream &out, const serac::tuple< T... > &A, std::integer_sequence< size_t, i... >)
 helper used to implement printing a tuple of values More...
 
template<typename... T>
auto & operator<< (std::ostream &out, const serac::tuple< T... > &A)
 print a tuple of values More...
 
template<typename lambda , typename... T, int... i>
SERAC_HOST_DEVICE auto apply_helper (lambda f, tuple< T... > &args, std::integer_sequence< int, i... >)
 A helper to apply a lambda to a tuple. More...
 
template<typename lambda , typename... T>
SERAC_HOST_DEVICE auto apply (lambda f, tuple< T... > &args)
 a way of passing an n-tuple to a function that expects n separate arguments More...
 
template<typename lambda , typename... T, int... i>
SERAC_HOST_DEVICE auto apply_helper (lambda f, const tuple< T... > &args, std::integer_sequence< int, i... >)
 
template<typename lambda , typename... T>
SERAC_HOST_DEVICE auto apply (lambda f, const tuple< T... > &args)
 a way of passing an n-tuple to a function that expects n separate arguments More...
 
template<typename S , typename T , int m, int... n, typename = std::enable_if_t<std::is_arithmetic_v<S> || is_dual_number<S>::value>>
constexpr SERAC_HOST_DEVICE auto operator* (S scale, const tensor< T, m, n... > &A)
 multiply a tensor by a scalar value More...
 
template<typename S , typename T , int m, int... n, typename = std::enable_if_t<std::is_arithmetic_v<S> || is_dual_number<S>::value>>
constexpr SERAC_HOST_DEVICE auto operator* (const tensor< T, m, n... > &A, S scale)
 multiply a tensor by a scalar value More...
 
template<typename S , typename T , int m, int... n, typename = std::enable_if_t<std::is_arithmetic_v<S> || is_dual_number<S>::value>>
constexpr SERAC_HOST_DEVICE auto operator/ (S scale, const tensor< T, m, n... > &A)
 divide a scalar by each element in a tensor More...
 
template<typename S , typename T , int m, int... n, typename = std::enable_if_t<std::is_arithmetic_v<S> || is_dual_number<S>::value>>
constexpr SERAC_HOST_DEVICE auto operator/ (const tensor< T, m, n... > &A, S scale)
 divide a tensor by a scalar More...
 
template<int i, int N>
constexpr SERAC_HOST_DEVICE auto make_dual_helper (zero)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<int i, int N>
constexpr SERAC_HOST_DEVICE auto make_dual_helper (double arg)
 promote a double value to dual number with a one_hot_t< i, N, double > gradient type More...
 
template<int i, int N, typename T , int... n>
constexpr SERAC_HOST_DEVICE auto make_dual_helper (const tensor< T, n... > &arg)
 promote a tensor value to dual number with a one_hot_t< i, N, tensor > gradient type More...
 
template<typename T0 , typename T1 >
constexpr SERAC_HOST_DEVICE auto make_dual (const tuple< T0, T1 > &args)
 Promote a tuple of values to their corresponding dual types. More...
 
template<typename T0 , typename T1 , typename T2 >
constexpr SERAC_HOST_DEVICE auto make_dual (const tuple< T0, T1, T2 > &args)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<bool dualify, typename T >
SERAC_HOST_DEVICE auto promote_to_dual_when (const T &x)
 a function that optionally (decided at compile time) converts a value to its dual type More...
 
template<bool dualify, typename T , int n>
SERAC_HOST_DEVICE auto promote_each_to_dual_when (const tensor< T, n > &x)
 a function that optionally (decided at compile time) converts a list of values to their dual types More...
 
template<int n, typename... T, int... i>
constexpr SERAC_HOST_DEVICE auto make_dual_helper (const serac::tuple< T... > &args, std::integer_sequence< int, i... >)
 layer of indirection required to implement make_dual_wrt
 
template<int n, typename... T>
constexpr auto make_dual_wrt (const serac::tuple< T... > &args)
 take a tuple of values, and promote the nth one to a one-hot dual number of the appropriate type More...
 
template<typename T1 , typename T2 , int n>
SERAC_HOST_DEVICE auto get_value (const tensor< tuple< T1, T2 >, n > &input)
 Extracts all of the values from a tensor of dual numbers. More...
 
template<typename... T>
SERAC_HOST_DEVICE auto get_value (const serac::tuple< T... > &tuple_of_values)
 Retrieves the value components of a set of (possibly dual) numbers. More...
 
template<typename... T>
SERAC_HOST_DEVICE auto get_gradient (dual< serac::tuple< T... >> arg)
 Retrieves the gradient components of a set of dual numbers. More...
 
template<typename... T, int... n>
SERAC_HOST_DEVICE auto get_gradient (const tensor< dual< serac::tuple< T... >>, n... > &arg)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename... T>
SERAC_HOST_DEVICE auto get_gradient (serac::tuple< T... > tuple_of_values)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<int... n>
constexpr SERAC_HOST_DEVICE auto make_dual (const tensor< double, n... > &A)
 Constructs a tensor of dual numbers from a tensor of values. More...
 
template<typename T , int n>
constexpr SERAC_HOST_DEVICE LuFactorization< T, n > factorize_lu (const tensor< T, n, n > &A)
 Compute LU factorization of a matrix with partial pivoting. More...
 
template<typename S , typename T , int n, int... m>
constexpr SERAC_HOST_DEVICE auto linear_solve (const tensor< S, n, n > &A, const tensor< T, n, m... > &b)
 Solves Ax = b for x using Gaussian elimination with partial pivoting. More...
 
template<typename T , int n>
constexpr SERAC_HOST_DEVICE auto make_dual (const tensor< T, n > &x, const tensor< T, n > &dx)
 Create a tensor of dual numbers with specified seed.
 
template<typename T , int m, int n>
constexpr SERAC_HOST_DEVICE auto make_dual (const tensor< T, m, n > &x, const tensor< T, m, n > &dx)
 Create a tensor of dual numbers with specified seed.
 
template<typename gradient_type , int n>
constexpr SERAC_HOST_DEVICE auto inv (tensor< dual< gradient_type >, n, n > A)
 
template<typename T , int... n>
SERAC_HOST_DEVICE auto get_value (const tensor< dual< T >, n... > &arg)
 Retrieves a value tensor from a tensor of dual numbers. More...
 
template<int... n>
constexpr SERAC_HOST_DEVICE auto get_gradient (const tensor< dual< double >, n... > &arg)
 Retrieves a gradient tensor from a tensor of dual numbers. More...
 
template<int... n, int... m>
constexpr SERAC_HOST_DEVICE auto get_gradient (const tensor< dual< tensor< double, m... >>, n... > &arg)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename function , typename... ParamTypes>
auto solve_scalar_equation (function &&f, double x0, double lower_bound, double upper_bound, ScalarSolverOptions options, ParamTypes... params)
 Solves a nonlinear scalar-valued equation and gives derivatives of solution to parameters. More...
 
template<typename function , int n>
auto find_root (function &&f, tensor< double, n > x0)
 Finds a root of a vector-valued nonlinear function. More...
 
template<typename T , int size>
auto eigenvalues (const serac::tensor< T, size, size > &A)
 compute the eigenvalues of a symmetric matrix A More...
 
template<class Iter , class Pred >
 FilterView (Iter, Iter, Pred &&) -> FilterView< Iter, Pred >
 Deduction guide - iterator and lambda types must be deduced, so this mitigates a "builder" function. More...
 
template<typename T >
auto greenStrain (const tensor< T, 3, 3 > &grad_u)
 Compute Green's strain from the displacement gradient.
 
template<typename MaterialType , typename StateType , typename... parameter_types>
auto uniaxial_stress_test (double t_max, size_t num_steps, const MaterialType material, const StateType initial_state, std::function< double(double)> epsilon_xx, const parameter_types... parameter_functions)
 Drive the material model thorugh a uniaxial tension experiment. More...
 
template<typename MaterialType , typename StateType , typename... functions>
auto single_quadrature_point_test (double t_max, size_t num_steps, const MaterialType material, const StateType initial_state, const functions... f)
 This function takes a material model (and associate state variables), subjects it to a time history of stimuli, described by functions ... f, and returns the outputs at each step. This is intended to be used for testing materials, to ensure their response is in agreement with known data (analytic or experimental). More...
 
double norm (const FiniteElementState &state, const double p=2)
 Find the Lp norm of a finite element state across all dofs. More...
 
double computeL2Error (const FiniteElementState &state, mfem::VectorCoefficient &exact_solution)
 Find the L2 norm of the error of a vector-valued finite element state with respect to an exact solution. More...
 
double computeL2Error (const FiniteElementState &state, mfem::Coefficient &exact_solution)
 Find the L2 norm of the error of a scalar-valued finite element state with respect to an exact solution. More...
 
bool is_scalar_valued (const GeneralCoefficient &coef)
 convenience function for querying the type stored in a GeneralCoefficient
 
bool is_vector_valued (const GeneralCoefficient &coef)
 convenience function for querying the type stored in a GeneralCoefficient
 
double avg (const FiniteElementVector &fe_vector)
 Find the average value of a finite element vector across all dofs. More...
 
double max (const FiniteElementVector &fe_vector)
 Find the max value of a finite element vector across all dofs. More...
 
double min (const FiniteElementVector &fe_vector)
 Find the min value of a finite element vector across all dofs. More...
 
bool sameFiniteElementSpace (const mfem::FiniteElementSpace &left, const mfem::FiniteElementSpace &right)
 Check if two finite element spaces are the same. More...
 
double innerProduct (const FiniteElementVector &vec1, const FiniteElementVector &vec2)
 Find the inner prodcut between two finite element vectors across all dofs. More...
 

Variables

constexpr ExecutionSpace default_execution_space = ExecutionSpace::CPU
 The default execution space for serac builds.
 
std::shared_ptr< QuadratureData< Nothing > > NoQData
 a single instance of a QuadratureData container of Nothings, since they are all interchangeable More...
 
std::shared_ptr< QuadratureData< Empty > > EmptyQData
 a single instance of a QuadratureData container of Emptys, since they are all interchangeable
 
const ScalarSolverOptions default_solver_options {.xtol = 1e-8, .rtol = 0, .max_iter = 25}
 Default options for solve_scalar_equation.
 
constexpr int SHAPE_ORDER = 1
 Polynomial order used to discretize the shape displacement field.
 
constexpr H1< SHAPE_ORDER, 2 > SHAPE_DIM_2
 Function space for shape displacement on dimension 2 meshes.
 
constexpr H1< SHAPE_ORDER, 3 > SHAPE_DIM_3
 Function space for shape displacement on dimension 2 meshes.
 

Detailed Description

Accelerator functionality.

The Serac namespace

Typedef Documentation

◆ one_hot_t

template<int i, int n, typename T >
using serac::one_hot_t = typedef typename one_hot<i, n, T>::type

a tuple type with n entries, all of which are of type serac::zero, except for the i^{th} entry, which is of type T

e.g. one_hot_t< 2, 4, T > == tuple<zero, zero, T, zero>

Definition at line 120 of file tuple_tensor_dual_functions.hpp.

◆ outer_product_t

template<typename T1 , typename T2 >
using serac::outer_product_t = typedef typename detail::outer_prod<T1, T2>::type

a type function that returns the tensor type of an outer product of two tensors

Template Parameters
T1the first argument to the outer product
T2the second argument to the outer product

Definition at line 1741 of file tensor.hpp.

◆ reduced_tensor

template<typename T , int n1, int n2 = 1>
using serac::reduced_tensor = typedef std::conditional_t< (n1 == 1 && n2 == 1), double, std::conditional_t<n1 == 1, tensor<T, n2>, std::conditional_t<n2 == 1, tensor<T, n1>, tensor<T, n1, n2> >> >

Removes 1s from tensor dimensions For example, a tensor<T, 1, 10> is equivalent to a tensor<T, 10>

Template Parameters
TThe scalar type of the tensor
n1The first dimension
n2The second dimension

Definition at line 273 of file tensor.hpp.

Enumeration Type Documentation

◆ AMGXSolver

enum serac::AMGXSolver
strong

Solver types supported by AMGX.

Enumerator
AMG 

GPU Algebraic Multigrid

PCGF 

GPU PCGF

CG 

GPU CG

PCG 

GPU PCG

PBICGSTAB 

GPU PBICGSTAB

BICGSTAB 

GPU BICGSTAB

FGMRES 

GPU FGMRES

JACOBI_L1 

GPU JACOBI_L1

GS 

GPU GS

POLYNOMIAL 

GPU POLYNOMIAL

KPZ_POLYNOMIAL 

GPU KPZ_POLYNOMIAL

BLOCK_JACOBI 

GPU BLOCK_JACOBI

MULTICOLOR_GS 

GPU MULTICOLOR_GS

MULTICOLOR_DILU 

GPU MULTICOLOR_DILU

Definition at line 128 of file solver_config.hpp.

◆ ContactEnforcement

Describes how to enforce the contact constraint equations.

Enumerator
Penalty 

Equal penalty applied to all constrained dofs

LagrangeMultiplier 

Solve for exact pressures to satisfy constraints

Definition at line 28 of file contact_config.hpp.

◆ ContactMethod

enum serac::ContactMethod
strong

Methodology for enforcing contact constraints (i.e. how you form the constraint equations)

Enumerator
SingleMortar 

Puso and Laursen 2004 w/ approximate tangent

Definition at line 20 of file contact_config.hpp.

◆ ContactType

enum serac::ContactType
strong

Mechanical constraint type on contact surfaces.

Enumerator
TiedNormal 

Tied contact in the normal direction, no friction

Frictionless 

Enforce gap >= 0, pressure <= 0, gap * pressure = 0 in the normal direction

Definition at line 37 of file contact_config.hpp.

◆ DirichletEnforcementMethod

this enum describes which way to enforce the time-varying constraint u(t) == U(t)

Enumerator
DirectControl 

Satisfies u(t+dt) == U(t+dt)

This method imposes additional stability criteria for the case of second order differential equations

RateControl 

(default value) Satisfies dudt(t+dt) == dUdt(t+dt)

This method does not impose any additional stability criteria for the case of second order differential equations.

FullControl 

satisfies u(t+dt) == U(t+dt), dudt(t+dt) == dUdt(t+dt), (and d2udt2(t+dt) == d2Udt2(t+dt), for a second order ODE)

Empirically, this method tends to be the most accurate for small timesteps (by a constant factor), but is more expensive to evaluate

Definition at line 59 of file solver_config.hpp.

◆ ElementType

enum serac::ElementType
strong

The type of a finite element basis function.

Note
TODO This class is used instead of the Family class from functional due to incompatibilities with Vector expression templates and the dual number class.
Enumerator
H1 

Nodal scalar-valued basis functions.

HCURL 

Nedelec (continuous tangent) vector-valued basis functions.

HDIV 

Raviart-Thomas (continuous normal) vector-valued basis functions.

L2 

Discontinuous scalar-valued basis functions.

Definition at line 33 of file finite_element_vector.hpp.

◆ Family

enum serac::Family
strong

Element conformity.

QOI denotes a "quantity of interest", implying integration with the test function "1" H1 denotes a function space where values are continuous across element boundaries HCURL denotes a vector-valued function space where only the tangential component is continuous across element boundaries HDIV denotes a vector-valued function space where only the normal component is continuous across element boundaries L2 denotes a function space where values are discontinuous across element boundaries

Definition at line 181 of file finite_element.hpp.

◆ GeometricNonlinearities

Enum to set the geometric nonlinearity flag.

Enumerator
On 

Include geometric nonlinearities

Off 

Do not include geometric nonlinearities

Definition at line 31 of file common.hpp.

◆ LinearSolver

enum serac::LinearSolver
strong

Linear solution method indicator.

Enumerator
CG 

Conjugate gradient

GMRES 

Generalized minimal residual method

SuperLU 

SuperLU MPI-enabled direct nodal solver

Strumpack 

Strumpack MPI-enabled direct frontal solver

Definition at line 101 of file solver_config.hpp.

◆ NonlinearSolver

Nonlinear solver method indicator.

Enumerator
Newton 

MFEM-native Newton-Raphson

LBFGS 

MFEM-native Limited memory BFGS

KINFullStep 

KINSOL Full Newton (Sundials must be enabled)

KINBacktrackingLineSearch 

KINSOL Newton with Backtracking Line Search (Sundials must be enabled)

KINPicard 

KINSOL Picard (Sundials must be enabled)

Definition at line 115 of file solver_config.hpp.

◆ Preconditioner

enum serac::Preconditioner
strong

The type of preconditioner to be used.

Enumerator
HypreJacobi 

Hypre-based Jacobi

HypreL1Jacobi 

Hypre-based L1-scaled Jacobi

HypreGaussSeidel 

Hypre-based Gauss-Seidel

HypreAMG 

Hypre's BoomerAMG algebraic multi-grid

HypreILU 

Hypre's Incomplete LU

AMGX 

NVIDIA's AMGX GPU-enabled algebraic multi-grid, GPU builds only

None 

No preconditioner used

Definition at line 166 of file solver_config.hpp.

◆ TimestepMethod

enum serac::TimestepMethod
strong

Timestep method of a solver.

Enumerator
QuasiStatic 

Quasistatic

BackwardEuler 

FirstOrderODE option

SDIRK33 

FirstOrderODE option

ForwardEuler 

FirstOrderODE option

RK2 

FirstOrderODE option

RK3SSP 

FirstOrderODE option

RK4 

FirstOrderODE option

GeneralizedAlpha 

FirstOrderODE option

ImplicitMidpoint 

FirstOrderODE option

SDIRK23 

FirstOrderODE option

SDIRK34 

FirstOrderODE option

Newmark 

SecondOrderODE option

HHTAlpha 

SecondOrderODE option

WBZAlpha 

SecondOrderODE option

AverageAcceleration 

SecondOrderODE option

LinearAcceleration 

SecondOrderODE option

CentralDifference 

SecondOrderODE option

FoxGoodwin 

SecondOrderODE option

Definition at line 24 of file solver_config.hpp.

Function Documentation

◆ about()

std::string serac::about ( )

Returns a string about the configuration of Serac.

Returns
string containing various configuration information about Serac

Definition at line 53 of file about.cpp.

◆ abs()

template<typename gradient_type >
SERAC_HOST_DEVICE auto serac::abs ( dual< gradient_type >  x)

Implementation of absolute value function for dual numbers.

Note
This is not differentiable at x = 0.0. At that point, the gradient is calculated as the gradient of x.

Definition at line 220 of file dual.hpp.

◆ allocateMemoryForBdrElementGradients()

template<typename T , ExecutionSpace exec>
ExecArray<T, 3, exec> serac::allocateMemoryForBdrElementGradients ( const mfem::ParFiniteElementSpace &  trial_fes,
const mfem::ParFiniteElementSpace &  test_fes 
)

this is a (hopefully) temporary measure to work around the fact that mfem's support for querying information about boundary elements is inconsistent, or entirely unimplemented. If the finite element spaces both work with mfem::FaceRestriction, it will return a 3D array sized to store the boundary element gradient matrices, else the 3D array will have dimensions 0x0x0 to indicate that it is unused.

Parameters
trial_festhe trial finite element space
test_festhe test finite element space

known issues: getting dofs/ids for boundary elements in 2D w/ Hcurl spaces getting dofs/ids for boundary elements in 2D,3D w/ L2 spaces

Definition at line 129 of file dof_numbering.hpp.

◆ antisym() [1/2]

template<typename T , int m>
constexpr SERAC_HOST_DEVICE auto serac::antisym ( const isotropic_tensor< T, m, m > &  )
constexpr

return the antisymmetric part of an isotropic tensor

Template Parameters
Tthe types stored in the isotropic tensor
mthe number of rows and columns in I
Returns
zero (isotropic matrices are symmetric, so the antisymmetric part is identically zero)

Definition at line 256 of file isotropic_tensor.hpp.

◆ antisym() [2/2]

template<typename T , int n>
constexpr SERAC_HOST_DEVICE auto serac::antisym ( const tensor< T, n, n > &  A)
constexpr

Returns the antisymmetric part of a square matrix.

Parameters
[in]AThe matrix to obtain the antisymmetric part of
Returns
(1/2) * (A - A^T)

Definition at line 1105 of file tensor.hpp.

◆ AntisymmetricIdentity()

template<int m>
constexpr SERAC_HOST_DEVICE auto serac::AntisymmetricIdentity ( )
constexpr

a helper function for creating the rank-4 isotropic tensor defined by: d(antisym(A)_{ij}) / d(A_{kl})

Template Parameters
mthe dimension

Definition at line 394 of file isotropic_tensor.hpp.

◆ apply() [1/2]

template<typename lambda , typename... T>
SERAC_HOST_DEVICE auto serac::apply ( lambda  f,
const tuple< T... > &  args 
)

a way of passing an n-tuple to a function that expects n separate arguments

Template Parameters
lambdaa callable type
Tthe types of arguments to be passed in to f
Parameters
fthe callable object
argsa tuple of arguments

e.g. foo(bar, baz) is equivalent to apply(foo, serac::tuple(bar,baz));

Definition at line 692 of file tuple.hpp.

◆ apply() [2/2]

template<typename lambda , typename... T>
SERAC_HOST_DEVICE auto serac::apply ( lambda  f,
tuple< T... > &  args 
)

a way of passing an n-tuple to a function that expects n separate arguments

Template Parameters
lambdaa callable type
Tthe types of arguments to be passed in to f
Parameters
fthe callable object
argsa tuple of arguments

e.g. foo(bar, baz) is equivalent to apply(foo, serac::tuple(bar,baz));

Definition at line 668 of file tuple.hpp.

◆ apply_helper() [1/2]

template<typename lambda , typename... T, int... i>
SERAC_HOST_DEVICE auto serac::apply_helper ( lambda  f,
const tuple< T... > &  args,
std::integer_sequence< int, i... >   
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 677 of file tuple.hpp.

◆ apply_helper() [2/2]

template<typename lambda , typename... T, int... i>
SERAC_HOST_DEVICE auto serac::apply_helper ( lambda  f,
tuple< T... > &  args,
std::integer_sequence< int, i... >   
)

A helper to apply a lambda to a tuple.

Template Parameters
lambdaThe functor type
TThe tuple types
iThe integer sequence to i
Parameters
fThe functor to apply to the tuple
argsThe input tuple
Returns
The functor output

Definition at line 653 of file tuple.hpp.

◆ avg()

double serac::avg ( const FiniteElementVector fe_vector)

Find the average value of a finite element vector across all dofs.

Parameters
fe_vectorThe state variable to compute the average of
Returns
The average value
Note
This acts on the actual scalar degree of freedom values, not the interpolated shape function values. This implies these may or may not be nodal averages depending on the choice of finite element basis.

Definition at line 89 of file finite_element_vector.cpp.

◆ Bernstein()

template<int n, typename T >
SERAC_HOST_DEVICE tensor<T, n> serac::Bernstein ( s)

Bernstein Polynomials on the domain [0, 1].

Template Parameters
nhow many entries to compute
Parameters
[in]swhere to evaluate the polynomials

Definition at line 467 of file polynomials.hpp.

◆ binary_comparator_overload()

serac::binary_comparator_overload ( )

implement operator< for dual numbers

implement operator> for dual numbers

implement operator== for dual numbers

◆ boundary_geometry_counts()

std::array<uint32_t, mfem::Geometry::NUM_GEOMETRIES> serac::boundary_geometry_counts ( const mfem::Mesh &  mesh)
inline

count the number of boundary elements of each geometry in a mesh

Parameters
meshthe mesh to count

Definition at line 83 of file geometry.hpp.

◆ build_hollow_quarter_cylinder()

mfem::Mesh serac::build_hollow_quarter_cylinder ( std::size_t  radial_divisions,
std::size_t  angular_divisions,
std::size_t  vertical_divisions,
double  inner_radius,
double  outer_radius,
double  height 
)

Constructs an MFEM mesh of a hollow cylinder restricted to the first orthant.

Parameters
radial_divisionsnumber of elements in the radial direction
angular_divisionsnumber of elements in the theta direction
vertical_divisionsnumber of elements in the z-direction
inner_radiusthe radius of the inner wall of the cylinder
outer_radiusthe radius of the outer wall of the cylinder
heightthe height of the top surface of the cylinder
Note
the cylinder's axis of symmetry is along the z-direction

Definition at line 358 of file mesh_utils.cpp.

◆ buildBallMesh()

mfem::Mesh serac::buildBallMesh ( int  approx_number_of_elements)

Constructs a 3D MFEM mesh of a unit ball, centered at the origin.

This routine creates a mesh by refining a coarse ball mesh until the number of elements is as close as possible to the user-specified number of elements

Parameters
[in]approx_number_of_elementsApproximate number of elements
Returns
The constructed mesh

Definition at line 107 of file mesh_utils.cpp.

◆ buildCuboidMesh()

mfem::Mesh serac::buildCuboidMesh ( int  elements_in_x,
int  elements_in_y,
int  elements_in_z,
double  size_x = 1.,
double  size_y = 1.,
double  size_z = 1. 
)

Constructs a 3D MFEM mesh of a cuboid.

Parameters
[in]elements_in_xthe number of elements in the x-direction
[in]elements_in_ythe number of elements in the y-direction
[in]elements_in_zthe number of elements in the z-direction
[in]size_xOverall size in the x-direction
[in]size_yOverall size in the y-direction
[in]size_zOverall size in the z-direction
Returns
The constructed serial mesh

Definition at line 149 of file mesh_utils.cpp.

◆ buildCylinderMesh()

mfem::Mesh serac::buildCylinderMesh ( int  radial_refinement,
int  elements_lengthwise,
double  radius,
double  height 
)

Constructs a 3D MFEM mesh of a cylinder.

Parameters
[in]radial_refinementthe number of times to apply uniform mesh refinement to the cross section
[in]elements_lengthwisethe number of elements in the z-direction
[in]radiusthe radius of the cylinder
[in]heightthe number of elements in the z-direction
Returns
The constructed mesh

Definition at line 156 of file mesh_utils.cpp.

◆ buildDiskMesh()

mfem::Mesh serac::buildDiskMesh ( int  approx_number_of_elements)

Constructs a 2D MFEM mesh of a unit disk, centered at the origin.

This routine creates a mesh by refining a coarse disk mesh until the number of elements is as close as possible to the user-specified number of elements

Parameters
[in]approx_number_of_elementsThe appoximate number of elements
Returns
The constructed mesh

Definition at line 74 of file mesh_utils.cpp.

◆ buildHollowCylinderMesh()

mfem::Mesh serac::buildHollowCylinderMesh ( int  radial_refinement,
int  elements_lengthwise,
double  inner_radius,
double  outer_radius,
double  height,
double  total_angle = M_PI,
int  sectors = 8 
)

Constructs a 3D MFEM mesh of a hollow cylinder.

Parameters
[in]radial_refinementthe number of times to apply uniform mesh refinement to the cross section
[in]elements_lengthwisethe number of elements in the z-direction
[in]inner_radiusinner radius the radius of the cylindrical shell
[in]outer_radiusouer radius the radius of the cylindrical shell
[in]heightthe number of elements in the z-direction
[in]total_anglethe angle in radians over which to generate the portion of an extruded cylinder
[in]sectorsthe number of starting sectors in the hollow cylinder
Returns
A unique_ptr containing the constructed mesh

Definition at line 350 of file mesh_utils.cpp.

◆ buildLinearSolverAndPreconditioner()

std::pair< std::unique_ptr< mfem::Solver >, std::unique_ptr< mfem::Solver > > serac::buildLinearSolverAndPreconditioner ( LinearSolverOptions  linear_opts = {},
MPI_Comm  comm = MPI_COMM_WORLD 
)

Build the linear solver and its associated preconditioner given a linear options struct.

Parameters
linear_optsThe options to configure the linear solver and preconditioner
commThe MPI communicator for the supplied HypreParMatrix and HypreParVectors
Returns
A pair containing the constructed linear solver and preconditioner objects

Definition at line 205 of file equation_solver.cpp.

◆ buildMeshFromFile()

mfem::Mesh serac::buildMeshFromFile ( const std::string &  mesh_file)

Constructs an MFEM mesh from a file.

This opens and reads an external mesh file and constructs a serial MFEM Mesh object.

Parameters
[in]mesh_fileThe mesh file to open
Returns
A serial mesh object

Definition at line 19 of file mesh_utils.cpp.

◆ buildMonolithicMatrix()

std::unique_ptr<mfem::HypreParMatrix> serac::buildMonolithicMatrix ( const mfem::BlockOperator &  block_operator)

Function for building a monolithic parallel Hypre matrix from a block system of smaller Hypre matrices.

Parameters
block_operatorThe block system of HypreParMatrices
Returns
The assembled monolithic HypreParMatrix
Precondition
block_operator must have assembled HypreParMatrices for its sub-blocks

Definition at line 72 of file equation_solver.cpp.

◆ buildNonlinearSolver()

std::unique_ptr< mfem::NewtonSolver > serac::buildNonlinearSolver ( NonlinearSolverOptions  nonlinear_opts = {},
MPI_Comm  comm = MPI_COMM_WORLD 
)

Build a nonlinear solver using the nonlinear option struct.

Parameters
nonlinear_optsThe options to configure the nonlinear solution scheme
commThe MPI communicator for the supplied nonlinear operators and HypreParVectors
Returns
The constructed nonlinear solver

Definition at line 156 of file equation_solver.cpp.

◆ buildPreconditioner()

std::unique_ptr< mfem::Solver > serac::buildPreconditioner ( Preconditioner  preconditioner,
int  print_level = 0,
[[maybe_unused] ] MPI_Comm  comm = MPI_COMM_WORLD 
)

Build a preconditioner from the available options.

Parameters
preconditionerThe preconditioner type to be built
print_levelThe print level for the constructed preconditioner
commThe communicator for the underlying operator and HypreParVectors
Returns
A constructed preconditioner based on the input option

Definition at line 305 of file equation_solver.cpp.

◆ buildRectangleMesh()

mfem::Mesh serac::buildRectangleMesh ( int  elements_in_x,
int  elements_in_y,
double  size_x = 1.,
double  size_y = 1. 
)

Constructs a 2D MFEM mesh of a rectangle.

Parameters
[in]elements_in_xthe number of elements in the x-direction
[in]elements_in_ythe number of elements in the y-direction
[in]size_xOverall size in the x-direction
[in]size_yOverall size in the y-direction
Returns
The constructed serial mesh

Definition at line 144 of file mesh_utils.cpp.

◆ buildRingMesh()

mfem::Mesh serac::buildRingMesh ( int  radial_refinement,
double  inner_radius,
double  outer_radius,
double  total_angle = M_PI,
int  sectors = 8 
)

Constructs a 2D MFEM mesh of a ring.

Parameters
[in]radial_refinementthe number of times to apply uniform mesh refinement to the cross section
[in]inner_radiusinner radius the radius of the cylindrical shell
[in]outer_radiusouer radius the radius of the cylindrical shell
[in]total_anglethe angle in radians over which to generate the portion of an extruded cylinder
[in]sectorsthe number of starting sectors in the hollow cylinder
Returns
A unique_ptr containing the constructed mesh

Definition at line 344 of file mesh_utils.cpp.

◆ chain_rule() [1/7]

constexpr SERAC_HOST_DEVICE auto serac::chain_rule ( const double  df_dx,
const double  dx 
)
constexpr

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Note
for a scalar-valued function of a scalar, the chain rule is just multiplication

Definition at line 1789 of file tensor.hpp.

◆ chain_rule() [2/7]

template<typename T >
constexpr SERAC_HOST_DEVICE auto serac::chain_rule ( const  T,
const  zero 
)
constexpr

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Note
this overload implements a no-op for the case where the small change is indentically zero

Definition at line 1780 of file tensor.hpp.

◆ chain_rule() [3/7]

template<int m, int n, int... p>
SERAC_HOST_DEVICE auto serac::chain_rule ( const tensor< double, m, n, p... > &  df_dx,
const tensor< double, p... > &  dx 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Note
for a matrix-valued function of a tensor, the chain rule contracts over all indices of dx

Definition at line 1832 of file tensor.hpp.

◆ chain_rule() [4/7]

template<int m, int... n>
constexpr SERAC_HOST_DEVICE auto serac::chain_rule ( const tensor< double, m, n... > &  df_dx,
const tensor< double, n... > &  dx 
)
constexpr

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Note
for a vector-valued function of a tensor, the chain rule contracts over all indices of dx

Definition at line 1818 of file tensor.hpp.

◆ chain_rule() [5/7]

template<int... n>
constexpr SERAC_HOST_DEVICE auto serac::chain_rule ( const tensor< double, n... > &  df_dx,
const double  dx 
)
constexpr

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Note
for a tensor-valued function of a scalar, the chain rule is just scalar multiplication

Definition at line 1796 of file tensor.hpp.

◆ chain_rule() [6/7]

template<int... n>
constexpr SERAC_HOST_DEVICE auto serac::chain_rule ( const tensor< double, n... > &  df_dx,
const tensor< double, n... > &  dx 
)
constexpr

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Note
for a scalar-valued function of a tensor, the chain rule is the inner product

Definition at line 1806 of file tensor.hpp.

◆ chain_rule() [7/7]

template<typename T >
constexpr SERAC_HOST_DEVICE auto serac::chain_rule ( const  zero,
const  T 
)
constexpr

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Note
this overload implements a no-op for the case where the gradient w.r.t. an input argument is identically zero

Definition at line 1770 of file tensor.hpp.

◆ ChebyshevT()

template<int n, typename S >
constexpr SERAC_HOST_DEVICE tensor<S, n> serac::ChebyshevT ( x)
constexpr

Chebyshev polynomials of the first kind Satisfying: T_n(cos(t)) == cos(n*t)

Template Parameters
nhow many entries to compute
Parameters
[in]xwhere to evaluate the polynomials

Definition at line 407 of file polynomials.hpp.

◆ ChebyshevU()

template<int n, typename T >
SERAC_HOST_DEVICE tensor<T, n> serac::ChebyshevU ( x)

Chebyshev polynomials of the second kind Satisfying: sin(t) U_n(cos(t)) == sin((n+1)*t)

Template Parameters
nhow many entries to compute
Parameters
[in]xwhere to evaluate the polynomials

Definition at line 428 of file polynomials.hpp.

◆ chop()

template<int n>
constexpr SERAC_HOST_DEVICE auto serac::chop ( const tensor< double, n > &  A)
constexpr

replace all entries in a tensor satisfying |x| < 1.0e-10 by literal zero

Parameters
[in]AThe tensor to "chop"

Definition at line 1670 of file tensor.hpp.

◆ compatibleWithFaceRestriction()

bool serac::compatibleWithFaceRestriction ( const mfem::ParFiniteElementSpace &  fes)
inline

attempt to characterize which FiniteElementSpaces mfem::FaceRestriction actually works with

Parameters
festhe finite element space in question

Definition at line 109 of file dof_numbering.hpp.

◆ compute_geometric_factors()

template<int Q, mfem::Geometry::Type geom, typename function_space >
void serac::compute_geometric_factors ( mfem::Vector &  positions_q,
mfem::Vector &  jacobians_q,
const mfem::Vector &  positions_e,
const std::vector< int > &  elements 
)

a kernel to compute the positions and jacobians at each quadrature point (mfem calls this "geometric factors")

Template Parameters
Qa parameter controlling the number of quadrature points an element
function_spacethe polynomial order and kind of function space used to interpolate
geomthe element geometry
Parameters
positions_q(output) the positions for each quadrature point
jacobians_q(output) the jacobians for each quadrature point
positions_e(input) the "e-vector" of position data
elements(input) the list of element indices that are part of this domain

Definition at line 17 of file geometric_factors.cpp.

◆ computeL2Error() [1/2]

double serac::computeL2Error ( const FiniteElementState state,
mfem::Coefficient &  exact_solution 
)

Find the L2 norm of the error of a scalar-valued finite element state with respect to an exact solution.

Parameters
stateThe numerical solution
exact_solutionThe exact solution to measure error against
Returns
The L2 norm of the difference between state and exact_solution

Definition at line 104 of file finite_element_state.cpp.

◆ computeL2Error() [2/2]

double serac::computeL2Error ( const FiniteElementState state,
mfem::VectorCoefficient &  exact_solution 
)

Find the L2 norm of the error of a vector-valued finite element state with respect to an exact solution.

Parameters
stateThe numerical solution
exact_solutionThe exact solution to measure error against
Returns
The L2 norm of the difference between state and exact_solution

Definition at line 99 of file finite_element_state.cpp.

◆ contract()

template<int i1, int i2, typename S , int m, int... n, typename T , int p, int q>
SERAC_HOST_DEVICE auto serac::contract ( const tensor< S, m, n... > &  A,
const tensor< T, p, q > &  B 
)

a convenience function that computes a dot product between two tensor, but that allows the user to specify which indices should be summed over. For example:

tensor< double, 4, 4, 4 > A = ...;
tensor< double, 4, 4 > B = ...;
tensor< double, 4, 4, 4 > C = contract<1, 0>(A, B);
// sum over index 1 for A
// V
// C(i, j, k) = \sum_l A(i, l, j) * B(l, k)
// ^
// sum over index 0 for B
Template Parameters
i1the index of contraction for the left operand
i2the index of contraction for the right operand
Sthe datatype stored in the left operand
mleading dimension of the left operand
nthe trailing dimensions of the left operand
Tthe datatype stored in the right operand
pthe number of rows in the right operand
qthe number of columns in the right operand
Parameters
Athe left operand
Bthe right operand

Definition at line 1317 of file tensor.hpp.

◆ decodeSignedIndex()

SignedIndex serac::decodeSignedIndex ( int  i)
inline

mfem will frequently encode {sign, index} into a single int32_t. This function decodes those values.

Parameters
ian integer that mfem has encoded to contain two separate pieces of information

Definition at line 78 of file dof_numbering.hpp.

◆ defineInputFileSchema()

void serac::defineInputFileSchema ( axom::inlet::Inlet &  inlet)

Define the input file structure for the driver code.

Parameters
[in]inletThe inlet instance

Definition at line 45 of file serac.cpp.

◆ DenseIdentity()

template<int dim>
constexpr SERAC_HOST_DEVICE tensor<double, dim, dim> serac::DenseIdentity ( )
constexpr

Obtains the identity matrix of the specified dimension.

Returns
I_dim

Definition at line 1183 of file tensor.hpp.

◆ det() [1/2]

template<typename T , int m>
constexpr SERAC_HOST_DEVICE auto serac::det ( const isotropic_tensor< T, m, m > &  I)
constexpr

compute the determinant of an isotropic tensor

Template Parameters
Tthe types stored in the isotropic tensor
mthe number of rows and columns in I
Parameters
Ithe isotropic tensor to compute the determinant of

Definition at line 311 of file isotropic_tensor.hpp.

◆ det() [2/2]

template<typename T >
constexpr SERAC_HOST_DEVICE auto serac::det ( const tensor< T, 2, 2 > &  A)
constexpr

Returns the determinant of a matrix.

Parameters
[in]AThe matrix to obtain the determinant of

Definition at line 1215 of file tensor.hpp.

◆ detApIm1()

template<typename T >
constexpr SERAC_HOST_DEVICE auto serac::detApIm1 ( const tensor< T, 2, 2 > &  A)
constexpr

computes det(A + I) - 1, where precision is not lost when the entries A_{ij} << 1

detApIm1(A) = det(A + I) - 1 When the entries of A are small compared to unity, computing det(A + I) - 1 directly will suffer from catastrophic cancellation.

Parameters
AInput matrix
Returns
det(A + I) - 1, where I is the identity matrix

Definition at line 1238 of file tensor.hpp.

◆ dev()

template<typename T , int n>
constexpr SERAC_HOST_DEVICE auto serac::dev ( const tensor< T, n, n > &  A)
constexpr

Calculates the deviator of a matrix (rank-2 tensor)

Parameters
[in]AThe matrix to calculate the deviator of In the context of stress tensors, the deviator is obtained by subtracting the mean stress (average of main diagonal elements) from each element on the main diagonal

Definition at line 1124 of file tensor.hpp.

◆ diag() [1/2]

template<typename T , int n>
constexpr SERAC_HOST_DEVICE tensor<T, n, n> serac::diag ( const tensor< T, n > &  d)
constexpr

Returns a square diagonal matrix by specifying the diagonal entries.

Parameters
[in]da list of diagonal entries

Definition at line 1155 of file tensor.hpp.

◆ diag() [2/2]

template<typename T , int n>
constexpr SERAC_HOST_DEVICE tensor<T, n> serac::diag ( const tensor< T, n, n > &  D)
constexpr

Returns an array containing the diagonal entries of a square matrix.

Parameters
[in]Dthe matrix to extract the diagonal entries from

Definition at line 1169 of file tensor.hpp.

◆ diagonal_matrix()

template<typename T , int n>
constexpr SERAC_HOST_DEVICE auto serac::diagonal_matrix ( const tensor< T, n, n > &  A)
constexpr

Returns a square matrix (rank-2 tensor) containing the diagonal entries of the input square matrix with zeros in the off-diagonal positions.

Parameters
[in]AThe input square matrix This operation is used to compute a term in the constitutive response of a linear, cubic solid material

Definition at line 1141 of file tensor.hpp.

◆ differentiate_wrt()

auto serac::differentiate_wrt ( const mfem::Vector &  v)
inline

this function is intended to only be used in combination with serac::Functional::operator(), as a way for the user to express that it should both evaluate and differentiate w.r.t. a specific argument (only 1 argument at a time)

For example:

mfem::Vector arg0 = ...;
mfem::Vector arg1 = ...;
mfem::Vector just_the_value = my_functional(arg0, arg1);
auto [value, gradient_wrt_arg1] = my_functional(arg0, differentiate_wrt(arg1));
auto differentiate_wrt(const mfem::Vector &v)
this function is intended to only be used in combination with serac::Functional::operator(),...

Definition at line 42 of file differentiate_wrt.hpp.

◆ dimension()

template<int i, typename T , int... n>
constexpr SERAC_HOST_DEVICE int serac::dimension ( const tensor< T, n... > &  )
constexpr

a function for querying the ith dimension of a tensor

Template Parameters
iwhich dimension to query
Tthe datatype stored in the tensor
nthe tensor extents
Returns
the ith dimension

Definition at line 1874 of file tensor.hpp.

◆ dimension_of()

constexpr int serac::dimension_of ( mfem::Geometry::Type  g)
constexpr

Returns the dimension of an element geometry.

Parameters
[in]gThe Geometry to retrieve the dimension of

Definition at line 49 of file geometry.hpp.

◆ div_helper() [1/3]

template<typename... T, int... i>
constexpr SERAC_HOST_DEVICE auto serac::div_helper ( const double  a,
const tuple< T... > &  x,
std::integer_sequence< int, i... >   
)
constexpr

A helper function for the / operator of tuples.

Template Parameters
Tthe types stored in the tuple y
iThe integer sequence to i
Parameters
xtuple of values
athe constant numerator
Returns
the returned tuple ratio

Definition at line 485 of file tuple.hpp.

◆ div_helper() [2/3]

template<typename... S, typename... T, int... i>
constexpr SERAC_HOST_DEVICE auto serac::div_helper ( const tuple< S... > &  x,
const tuple< T... > &  y,
std::integer_sequence< int, i... >   
)
constexpr

A helper function for the / operator of tuples.

Template Parameters
Sthe types stored in the tuple x
Tthe types stored in the tuple y
iThe integer sequence to i
Parameters
xtuple of values
ytuple of values
Returns
the returned tuple ratio

Definition at line 455 of file tuple.hpp.

◆ div_helper() [3/3]

template<typename... T, int... i>
constexpr SERAC_HOST_DEVICE auto serac::div_helper ( const tuple< T... > &  x,
const double  a,
std::integer_sequence< int, i... >   
)
constexpr

A helper function for the / operator of tuples.

Template Parameters
Tthe types stored in the tuple y
iThe integer sequence to i
Parameters
xtuple of values
athe constant denomenator
Returns
the returned tuple ratio

Definition at line 500 of file tuple.hpp.

◆ dot() [1/13]

template<typename S , typename T , int m, int... n>
constexpr SERAC_HOST_DEVICE auto serac::dot ( const isotropic_tensor< S, m, m > &  I,
const tensor< T, m, n... > &  A 
)
constexpr

dot product between an isotropic and (nonisotropic) tensor

Template Parameters
Sthe types stored in isotropic tensor
Tthe types stored in tensor
mthe number of rows and columns in I
nthe trailing dimensions of A
Parameters
Ithe left operand
Athe (full) right operand
Returns
a new tensor equal to the index notation expression: output(i,...) := I(i,j) * A(j,...)

Definition at line 203 of file isotropic_tensor.hpp.

◆ dot() [2/13]

template<typename S , typename T , int m>
constexpr SERAC_HOST_DEVICE auto serac::dot ( const tensor< S, m > &  A,
const tensor< T, m > &  B 
)
constexpr

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Note
vector . vector

Definition at line 746 of file tensor.hpp.

◆ dot() [3/13]

template<typename S , typename T , int m, int n>
constexpr SERAC_HOST_DEVICE auto serac::dot ( const tensor< S, m > &  A,
const tensor< T, m, n > &  B 
)
constexpr

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Note
vector . matrix

Definition at line 760 of file tensor.hpp.

◆ dot() [4/13]

template<typename S , typename T , int m, int n, int p>
constexpr SERAC_HOST_DEVICE auto serac::dot ( const tensor< S, m > &  A,
const tensor< T, m, n, p > &  B 
)
constexpr

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Note
vector . tensor3D

Definition at line 776 of file tensor.hpp.

◆ dot() [5/13]

template<typename S , typename T , int m, int n, int p, int q>
constexpr SERAC_HOST_DEVICE auto serac::dot ( const tensor< S, m > &  A,
const tensor< T, m, n, p, q > &  B 
)
constexpr

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Note
vector . tensor4D

this overload, and others of the form dot(vector, tensor), can be implemented more succinctly as a single variadic function, but for some reason gcc-11 (but not gcc-10 or gcc-12) seemed to break when compiling that compact implementation, so we're manually writing out some of the different dot product overloads in order to support that compiler and version

Definition at line 796 of file tensor.hpp.

◆ dot() [6/13]

template<typename S , typename T , typename U , int m, int n>
constexpr SERAC_HOST_DEVICE auto serac::dot ( const tensor< S, m > &  u,
const tensor< T, m, n > &  A,
const tensor< U, n > &  v 
)
constexpr

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Note
vector . matrix . vector

Definition at line 876 of file tensor.hpp.

◆ dot() [7/13]

template<typename S , typename T , int m, int n>
constexpr SERAC_HOST_DEVICE auto serac::dot ( const tensor< S, m, n > &  A,
const tensor< T, n > &  B 
)
constexpr

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Note
matrix . vector

Definition at line 810 of file tensor.hpp.

◆ dot() [8/13]

template<typename S , typename T , int m, int n, int p>
constexpr SERAC_HOST_DEVICE auto serac::dot ( const tensor< S, m, n > &  A,
const tensor< T, n, p > &  B 
)
constexpr

this function contracts over the "middle" index of the two tensor arguments

Template Parameters
Sthe underlying type of the tensor (lefthand) argument
Tthe underlying type of the tensor (righthand) argument
nintegers describing the tensor shape
Parameters
[in]AThe lefthand tensor
[in]BThe righthand tensor

Definition at line 708 of file tensor.hpp.

◆ dot() [9/13]

template<typename S , typename T , int m, int n, int p, int q>
constexpr SERAC_HOST_DEVICE auto serac::dot ( const tensor< S, m, n > &  A,
const tensor< T, n, p, q > &  B 
)
constexpr

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Note
matrix . tensor

Definition at line 842 of file tensor.hpp.

◆ dot() [10/13]

template<typename S , typename T , int m, int n, int p, int q, int r>
constexpr SERAC_HOST_DEVICE auto serac::dot ( const tensor< S, m, n > &  A,
const tensor< T, n, p, q, r > &  B 
)
constexpr

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Note
matrix . tensor

Definition at line 826 of file tensor.hpp.

◆ dot() [11/13]

template<typename S , typename T , int m, int n, int p>
constexpr SERAC_HOST_DEVICE auto serac::dot ( const tensor< S, m, n, p > &  A,
const tensor< T, p > &  B 
)
constexpr

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Note
3rd-order-tensor . vector

Definition at line 858 of file tensor.hpp.

◆ dot() [12/13]

template<typename T , int m>
constexpr SERAC_HOST_DEVICE auto serac::dot ( const tensor< T, m > &  A,
double  B 
)
constexpr

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Note
vector . scalar

Definition at line 726 of file tensor.hpp.

◆ dot() [13/13]

template<typename T , int m>
constexpr SERAC_HOST_DEVICE auto serac::dot ( double  B,
const tensor< T, m > &  A 
)
constexpr

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Note
scalar * vector

Definition at line 736 of file tensor.hpp.

◆ double_dot() [1/5]

template<typename S , typename T , int m>
constexpr SERAC_HOST_DEVICE auto serac::double_dot ( const isotropic_tensor< S, m, m > &  I,
const tensor< T, m, m > &  A 
)
constexpr

double-dot product between an isotropic and (nonisotropic) tensor

Template Parameters
Sthe types stored in isotropic tensor
Tthe types stored in tensor
mthe number of rows and columns in I, A
Parameters
Ithe left operand
Athe (full) right operand
Returns
a new tensor equal to the index notation expression: output := I(i,j) * A(i,j) \(\propto\) tr(A)

Definition at line 229 of file isotropic_tensor.hpp.

◆ double_dot() [2/5]

template<typename S , typename T , int m, int... n>
constexpr SERAC_HOST_DEVICE auto serac::double_dot ( const isotropic_tensor< S, m, m, m, m > &  I,
const tensor< T, m, m, n... > &  A 
)
constexpr

double-dot product between an isotropic and (nonisotropic) tensor

Template Parameters
Sthe types stored in isotropic tensor
Tthe types stored in tensor
mthe dimension of each extent of I
Parameters
Ithe left operand
Athe (full) right operand
Returns
a new tensor equal to the index notation expression: output(...) := I(i,j) * A(i,j,...)

Definition at line 466 of file isotropic_tensor.hpp.

◆ double_dot() [3/5]

template<typename S , typename T , int m, int n>
constexpr auto serac::double_dot ( const tensor< S, m, n > &  A,
const tensor< T, m, n > &  B 
)
constexpr

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Note
2nd-order-tensor : 2nd-order-tensor, like inner()

Definition at line 984 of file tensor.hpp.

◆ double_dot() [4/5]

template<typename S , typename T , int m, int n, int p>
constexpr SERAC_HOST_DEVICE auto serac::double_dot ( const tensor< S, m, n, p > &  A,
const tensor< T, n, p > &  B 
)
constexpr

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Note
3rd-order-tensor : 2nd-order-tensor

Definition at line 966 of file tensor.hpp.

◆ double_dot() [5/5]

template<typename S , typename T , int m, int n, int p, int q>
constexpr SERAC_HOST_DEVICE auto serac::double_dot ( const tensor< S, m, n, p, q > &  A,
const tensor< T, p, q > &  B 
)
constexpr

double dot product, contracting over the two "middle" indices

Template Parameters
Sthe underlying type of the tensor (lefthand) argument
Tthe underlying type of the tensor (righthand) argument
mfirst dimension of A
nsecond dimension of A
pthird dimension of A, first dimensions of B
qfourth dimension of A, second dimensions of B
Parameters
[in]AThe lefthand tensor
[in]BThe righthand tensor

Definition at line 946 of file tensor.hpp.

◆ dual()

template<typename T >
serac::dual ( double  ,
 
) -> dual< T >

class template argument deduction guide for type dual.

Note
this lets users write
dual something{my_value, my_gradient};
dual(double, T) -> dual< T >
class template argument deduction guide for type dual.
instead of explicitly writing the template parameter
dual< decltype(my_gradient) > something{my_value, my_gradient};

◆ eigenvalues()

template<typename T , int size>
auto serac::eigenvalues ( const serac::tensor< T, size, size > &  A)

compute the eigenvalues of a symmetric matrix A

Template Parameters
Teither double or a serac::dual type
sizethe dimensions of the matrix
Parameters
Athe matrix
Returns
a vector of the eigenvalues of A (and their derivatives, if A contains dual numbers)

Definition at line 722 of file tuple_tensor_dual_functions.hpp.

◆ elements_per_block()

template<mfem::Geometry::Type g>
constexpr SERAC_HOST_DEVICE int serac::elements_per_block ( int  q)
constexpr

this function returns information about how many elements should be processed by a single thread block in CUDA (note: the optimal values are hardware and problem specific, but these values are still significantly faster than naively allocating only 1 element / block)

Template Parameters
gthe element geometry
Parameters
qthe number of quadrature points per dimension
Returns
how many elements each thread block should process

Definition at line 141 of file finite_element.hpp.

◆ exitGracefully()

void serac::exitGracefully ( bool  error = false)

Exits the program gracefully after cleaning up necessary tasks.

This performs finalization work needed by the program such as finalizing MPI and flushing and closing the SLIC logger.

/note This is a collective function.

Parameters
[in]errorTrue if the program should return an error code

Definition at line 44 of file terminator.cpp.

◆ factorial()

constexpr SERAC_HOST_DEVICE int serac::factorial ( int  n)
constexpr

compute n!

Parameters
[in]n

Definition at line 374 of file polynomials.hpp.

◆ factorize_lu()

template<typename T , int n>
constexpr SERAC_HOST_DEVICE LuFactorization<T, n> serac::factorize_lu ( const tensor< T, n, n > &  A)
constexpr

Compute LU factorization of a matrix with partial pivoting.

The convention followed is to place ones on the diagonal of the lower triangular factor.

Parameters
[in]AThe matrix to factorize
Returns
An LuFactorization object
See also
LuFactorization

Definition at line 359 of file tuple_tensor_dual_functions.hpp.

◆ FilterView()

template<class Iter , class Pred >
serac::FilterView ( Iter  ,
Iter  ,
Pred &&   
) -> FilterView< Iter, Pred >

Deduction guide - iterator and lambda types must be deduced, so this mitigates a "builder" function.

Template Parameters
IterIterator for the view
PredPredicate for the view

◆ find_root()

template<typename function , int n>
auto serac::find_root ( function &&  f,
tensor< double, n >  x0 
)

Finds a root of a vector-valued nonlinear function.

Uses Newton-Raphson iteration.

Template Parameters
functionType for the functor object
nVector dimension of the equation
Parameters
fA callable representing the function of which a root is sought. Must take an n-vector argument and return an n-vector
x0Initial guess for root. Must be an n-vector.
Returns
A root of f.

Definition at line 692 of file tuple_tensor_dual_functions.hpp.

◆ gather()

template<int d>
std::vector<tensor<double, d> > serac::gather ( const mfem::Vector &  coordinates,
mfem::Array< int >  ids 
)

gather vertex coordinates for a list of vertices

Parameters
coordinatesmfem's 1D list of vertex coordinates
idsthe list of vertex indices to gather

Definition at line 39 of file domain.cpp.

◆ GaussLegendreInterpolation()

template<int n, typename T >
constexpr SERAC_HOST_DEVICE tensor<T, n> serac::GaussLegendreInterpolation ( [[maybe_unused] ] T  x)
constexpr

Lagrange Interpolating polynomials for nodes at Gauss-Legendre points on the interval [0, 1].

Do[xi = GaussianQuadratureWeights[n, 0, 1, 30][[All, 1]]; Print["if constexpr (n == " <> ToString[n] <> ") return " <> ToString[CForm /@ HornerForm /@ (InterpolatingPolynomial[Transpose[{xi, #}], x] & /@ IdentityMatrix[n])] <> ";"], {n, 1, 4} ]

note: the quadratic (n == 2) and cubic (n == 3) versions of this function only satisfied the kronecker delta property to an error of ~1.0e-13 and keeping more than 16 significant figures seems to help bring that error down to machine epsilon again.

Template Parameters
nhow many entries to compute
Parameters
[in]xwhere to evaluate the polynomials

Definition at line 558 of file polynomials.hpp.

◆ GaussLegendreInterpolationDerivative()

template<int n, typename T >
constexpr SERAC_HOST_DEVICE tensor<T, n> serac::GaussLegendreInterpolationDerivative ( [[maybe_unused] ] T  x)
constexpr

Derivatives of the Lagrange Interpolating polynomials for nodes at Gauss-Legendre points on the interval [-1, 1].

Mathematica/Wolfram Language code to generate more entries in the table: Do[xi = GaussianQuadratureWeights[n, 0, 1, 30][[All, 1]]; Print["if constexpr (n == " <> ToString[n] <> ") return " <> ToString[CForm /@ HornerForm /@ (D[InterpolatingPolynomial[Transpose[{xi, #}], x], x] & /@ IdentityMatrix[n])] <> ";"], {n, 1, 4} ]

Template Parameters
nhow many entries to compute
Parameters
[in]xwhere to evaluate the polynomials

Definition at line 595 of file polynomials.hpp.

◆ GaussLegendreNodes()

template<int n, mfem::Geometry::Type geom>
constexpr SERAC_HOST_DEVICE auto serac::GaussLegendreNodes ( )
constexpr

The positions of Gauss-Legendre points for different geometries.

Template Parameters
nThe number of points per dimension

Mathematica/Wolfram Language code to generate the 1D entries in the table: Do[Print["if constexpr (n == " <> ToString[n] <> ") return " <> ToString[GaussianQuadratureWeights[n, 0, 1, 17][[All, 1]]] <> ";"], {n, 1, 8}]

Definition at line 43 of file polynomials.hpp.

◆ GaussLegendreWeights()

template<int n, mfem::Geometry::Type geom>
constexpr SERAC_HOST_DEVICE auto serac::GaussLegendreWeights ( )
constexpr

The weights associated with each Gauss-Legendre point.

Template Parameters
nThe number of points

Mathematica/Wolfram Language code to generate more entries in the table: Do[Print["if constexpr (n == " <> ToString[n] <> ") return " <> ToString[GaussianQuadratureWeights[n, 0, 1, 17][[All, 2]]] <> ";"], {n, 1, 8}]

Definition at line 272 of file polynomials.hpp.

◆ GaussLobattoInterpolation()

template<int n, typename T >
constexpr SERAC_HOST_DEVICE tensor<T, n> serac::GaussLobattoInterpolation ( [[maybe_unused] ] T  x)
constexpr

Lagrange Interpolating polynomials for nodes at Gauss-Lobatto points on the interval [0, 1].

Template Parameters
nhow many entries to compute
Parameters
[in]xwhere to evaluate the polynomials

Definition at line 494 of file polynomials.hpp.

◆ GaussLobattoInterpolationDerivative()

template<int n, typename T >
constexpr SERAC_HOST_DEVICE tensor<T, n> serac::GaussLobattoInterpolationDerivative ( [[maybe_unused] ] T  x)
constexpr

Derivatives of the Lagrange Interpolating polynomials for nodes at Gauss-Lobatto points on the interval [0, 1].

Template Parameters
nhow many entries to compute
Parameters
[in]xwhere to evaluate the polynomials

Definition at line 521 of file polynomials.hpp.

◆ GaussLobattoNodes()

template<int n, typename T = double>
constexpr SERAC_HOST_DEVICE tensor<T, n> serac::GaussLobattoNodes ( a = T(0),
b = T(1) 
)
constexpr

The positions (in 1D space) of Gauss-Lobatto points.

Template Parameters
nThe number of points
Parameters
[in]aThe left endpoint of the interval
[in]bThe right endpoint of the interval

Definition at line 28 of file polynomials.hpp.

◆ GaussQuadratureRule()

template<mfem::Geometry::Type g, int Q>
constexpr SERAC_HOST_DEVICE auto serac::GaussQuadratureRule ( )
constexpr

Returns the Gauss-Legendre quadrature rule for an element and order.

Template Parameters
Theshape of the element to produce a quadrature rule for
Qthe number of quadrature points per dimension

Definition at line 45 of file quadrature.hpp.

◆ generate_bdr_kernels()

template<mfem::Geometry::Type geom, int Q, typename test , typename... trials, typename lambda_type >
void serac::generate_bdr_kernels ( FunctionSignature< test(trials...)>  s,
Integral integral,
lambda_type &&  qf 
)

function to generate kernels held by an Integral object of type "BoundaryDomain", with a specific element type

Template Parameters
geomthe element geometry
Qa parameter that controls the number of quadrature points
testthe kind of test functions used in the integral
trialsthe trial space(s) of the integral's inputs
lambda_typea callable object that implements the q-function concept
Parameters
san object used to pass around test/trial information
integralthe Integral object to initialize
qfthe quadrature function

Definition at line 276 of file integral.hpp.

◆ generate_kernels()

template<mfem::Geometry::Type geom, int Q, typename test , typename... trials, typename lambda_type , typename qpt_data_type >
void serac::generate_kernels ( FunctionSignature< test(trials...)>  s,
Integral integral,
lambda_type &&  qf,
std::shared_ptr< QuadratureData< qpt_data_type > >  qdata 
)

function to generate kernels held by an Integral object of type "Domain", with a specific element type

Template Parameters
geomthe element geometry
Qa parameter that controls the number of quadrature points
testthe kind of test functions used in the integral
trialsthe trial space(s) of the integral's inputs
lambda_typea callable object that implements the q-function concept
qpt_data_typeany quadrature point data needed by the material model
Parameters
san object used to pass around test/trial information
integralthe Integral object to initialize
qfthe quadrature function
qdatathe values of any quadrature point data for the material

Definition at line 186 of file integral.hpp.

◆ generateParFiniteElementSpace()

template<typename function_space >
std::pair<std::unique_ptr<mfem::ParFiniteElementSpace>, std::unique_ptr<mfem::FiniteElementCollection> > serac::generateParFiniteElementSpace ( mfem::ParMesh *  mesh)
inline

create an mfem::ParFiniteElementSpace from one of serac's tag types: H1, Hcurl, L2

Template Parameters
function_spacea tag type containing the kind of function space and polynomial order
Parameters
meshthe mesh on which the space is defined
Returns
a pair containing the new finite element space and associated finite element collection

Definition at line 103 of file functional.hpp.

◆ geometry_counts()

std::array<uint32_t, mfem::Geometry::NUM_GEOMETRIES> serac::geometry_counts ( const mfem::Mesh &  mesh)
inline

count the number of elements of each geometry in a mesh

Parameters
meshthe mesh to count

Definition at line 70 of file geometry.hpp.

◆ get() [1/3]

template<int i, typename... T>
constexpr SERAC_HOST_DEVICE const auto& serac::get ( const tuple< T... > &  values)
constexpr

return a copy of the ith tuple entry

Template Parameters
ithe tuple index to access
Tthe types stored in the tuple

Definition at line 234 of file tuple.hpp.

◆ get() [2/3]

template<int i, typename... T>
constexpr SERAC_HOST_DEVICE auto& serac::get ( tuple< T... > &  values)
constexpr

return a reference to the ith tuple entry

Template Parameters
ithe tuple index to access
Tthe types stored in the tuple

Definition at line 199 of file tuple.hpp.

◆ get() [3/3]

template<typename T , typename T0 , typename T1 >
constexpr T& serac::get ( variant< T0, T1 > &  v)
constexpr

Returns the variant member of specified type.

Returns the variant member at the provided index.

Template Parameters
TThe type of the element to retrieve
T0The first member type of the variant
T1The second member type of the variant
Parameters
[in]vThe variant to return the element of
See also
std::variant::get
Precondition
T must be either T0 or T1
Note
If T == T0 == T1, the element at index 0 will be returned

Definition at line 338 of file variant.hpp.

◆ get_gradient() [1/4]

template<int... n>
constexpr SERAC_HOST_DEVICE auto serac::get_gradient ( const tensor< double, n... > &  )
constexpr

get the gradient of type tensor (note: since its stored type is not a dual number, the derivative term is identically zero)

Returns
The sentinel,
See also
zero

Definition at line 1755 of file tensor.hpp.

◆ get_gradient() [2/4]

template<int... n>
constexpr SERAC_HOST_DEVICE auto serac::get_gradient ( const tensor< dual< double >, n... > &  arg)
constexpr

Retrieves a gradient tensor from a tensor of dual numbers.

Parameters
[in]argThe tensor of dual numbers

Definition at line 506 of file tuple_tensor_dual_functions.hpp.

◆ get_gradient() [3/4]

SERAC_HOST_DEVICE auto serac::get_gradient ( double  )
inline

Retrieves the gradient component of a double (which is nothing)

Returns
The sentinel,
See also
zero

Definition at line 1747 of file tensor.hpp.

◆ get_gradient() [4/4]

template<typename... T>
SERAC_HOST_DEVICE auto serac::get_gradient ( dual< serac::tuple< T... >>  arg)

Retrieves the gradient components of a set of dual numbers.

Parameters
[in]argThe set of numbers to retrieve gradients from

Definition at line 310 of file tuple_tensor_dual_functions.hpp.

◆ get_if()

template<typename T , typename T0 , typename T1 >
T* serac::get_if ( variant< T0, T1 > *  v)

Returns the member of requested type if it's active, otherwise nullptr.

Template Parameters
TThe type to check for
Parameters
[in]vThe variant to check/retrieve from
See also
std::get_if

Definition at line 398 of file variant.hpp.

◆ get_value() [1/3]

template<typename... T>
SERAC_HOST_DEVICE auto serac::get_value ( const serac::tuple< T... > &  tuple_of_values)

Retrieves the value components of a set of (possibly dual) numbers.

Parameters
[in]tuple_of_valuesThe tuple of numbers to retrieve values from
Precondition
The tuple must contain only scalars or tensors of dual numbers or doubles

Definition at line 299 of file tuple_tensor_dual_functions.hpp.

◆ get_value() [2/3]

template<typename T , int... n>
SERAC_HOST_DEVICE auto serac::get_value ( const tensor< dual< T >, n... > &  arg)

Retrieves a value tensor from a tensor of dual numbers.

Parameters
[in]argThe tensor of dual numbers

Definition at line 494 of file tuple_tensor_dual_functions.hpp.

◆ get_value() [3/3]

template<typename T1 , typename T2 , int n>
SERAC_HOST_DEVICE auto serac::get_value ( const tensor< tuple< T1, T2 >, n > &  input)

Extracts all of the values from a tensor of dual numbers.

Template Parameters
T1the first type of the tuple stored in the tensor
T2the second type of the tuple stored in the tensor
nthe number of entries in the input argument
Parameters
[in]inputThe tensor of dual numbers
Returns
the tensor of all of the values

Definition at line 284 of file tuple_tensor_dual_functions.hpp.

◆ getMPIInfo()

std::pair< int, int > serac::getMPIInfo ( MPI_Comm  comm = MPI_COMM_WORLD)

Returns the number of processes and rank for an MPI communicator.

Parameters
commThe MPI communicator to initialize with
Returns
A pair containing {size, rank} relative to the provided MPI communicator
Precondition
The logger must be initialized (to display error messages)

Definition at line 26 of file initialize.cpp.

◆ gitSHA()

std::string serac::gitSHA ( )

Returns a string for the Git SHA when the driver was built.

Note: This will not update unless you reconfigure CMake after a commit.

Returns
string value of the Git SHA if built in a Git repo, empty if not

Definition at line 190 of file about.cpp.

◆ holds_alternative()

template<typename T , typename T0 , typename T1 >
bool serac::holds_alternative ( const variant< T0, T1 > &  v)

Checks whether a variant's active member is of a certain type.

Template Parameters
TThe type to check for
Parameters
[in]vThe variant to check
See also
std::holds_alternative

Definition at line 381 of file variant.hpp.

◆ Identity()

template<int m>
constexpr SERAC_HOST_DEVICE isotropic_tensor<double, m, m> serac::Identity ( )
constexpr

return the identity matrix of the specified size

Template Parameters
mthe number of rows and columns

Definition at line 61 of file isotropic_tensor.hpp.

◆ index_of_differentiation()

template<typename... T>
constexpr uint32_t serac::index_of_differentiation ( )
constexpr

given a list of types, this function returns the index that corresponds to the type dual_vector.

Template Parameters
Ta list of types, containing at most 1 differentiate_wrt_this

e.g.

static_assert(index_of_dual_vector < foo, bar, differentiate_wrt_this, baz, qux >() == 2);

Definition at line 49 of file functional.hpp.

◆ initialize()

std::pair< int, int > serac::initialize ( int  argc,
char *  argv[],
MPI_Comm  comm = MPI_COMM_WORLD 
)

Initializes MPI, signal handling, and logging.

Parameters
argcThe number of command-line arguments
argvThe command-line arguments, as C-strings
commThe MPI communicator to initialize with
Returns
A pair containing the size and rank relative to the provided MPI communicator

Definition at line 40 of file initialize.cpp.

◆ inner() [1/3]

template<typename S , typename T , int m>
constexpr SERAC_HOST_DEVICE auto serac::inner ( const tensor< S, m > &  A,
const tensor< T, m > &  B 
)
constexpr

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Note
for first order tensors (vectors)

Definition at line 684 of file tensor.hpp.

◆ inner() [2/3]

template<typename S , typename T , int m, int n>
constexpr SERAC_HOST_DEVICE auto serac::inner ( const tensor< S, m, n > &  A,
const tensor< T, m, n > &  B 
)
constexpr

this function contracts over all indices of the two tensor arguments

Template Parameters
Sthe underlying type of the tensor (lefthand) argument
Tthe underlying type of the tensor (righthand) argument
mthe number of rows
nthe number of columns
Parameters
[in]AThe lefthand tensor
[in]BThe righthand tensor

Definition at line 668 of file tensor.hpp.

◆ inner() [3/3]

constexpr SERAC_HOST_DEVICE auto serac::inner ( double  A,
double  B 
)
constexpr

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Note
for zeroth-order tensors (scalars)

Definition at line 697 of file tensor.hpp.

◆ innerProduct()

double serac::innerProduct ( const FiniteElementVector vec1,
const FiniteElementVector vec2 
)

Find the inner prodcut between two finite element vectors across all dofs.

Parameters
vec1The first vector
vec2The second vector
Returns
The inner prodcut between finite element vectors

Definition at line 132 of file finite_element_vector.cpp.

◆ inv() [1/5]

template<typename T , int m>
constexpr SERAC_HOST_DEVICE auto serac::inv ( const isotropic_tensor< T, m, m > &  I)
constexpr

return the inverse of an isotropic tensor

Template Parameters
Tthe types stored in the isotropic tensor
mthe number of rows and columns in I
Parameters
Ithe isotropic tensor to compute the inverse of
Returns
the inverse of I

Definition at line 298 of file isotropic_tensor.hpp.

◆ inv() [2/5]

constexpr SERAC_HOST_DEVICE tensor<double, 2, 2> serac::inv ( const tensor< double, 2, 2 > &  A)
constexpr

Inverts a matrix.

Parameters
[in]AThe matrix to invert
Note
Uses a shortcut for inverting a 2-by-2 matrix

Definition at line 1564 of file tensor.hpp.

◆ inv() [3/5]

constexpr SERAC_HOST_DEVICE tensor<double, 3, 3> serac::inv ( const tensor< double, 3, 3 > &  A)
constexpr

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Note
Uses a shortcut for inverting a 3-by-3 matrix

Definition at line 1582 of file tensor.hpp.

◆ inv() [4/5]

template<typename T , int n>
constexpr SERAC_HOST_DEVICE auto serac::inv ( const tensor< T, n, n > &  A)
constexpr

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Note
For N-by-N matrices with N > 3, requires Gaussian elimination with partial pivoting

Definition at line 1606 of file tensor.hpp.

◆ inv() [5/5]

template<typename gradient_type , int n>
constexpr SERAC_HOST_DEVICE auto serac::inv ( tensor< dual< gradient_type >, n, n >  A)
constexpr

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Note
when inverting a tensor of dual numbers, hardcode the analytic derivative of the inverse of a square matrix, rather than apply gauss elimination directly on the dual number types

TODO: compare performance of this hardcoded implementation to just using inv() directly

Definition at line 474 of file tuple_tensor_dual_functions.hpp.

◆ is_symmetric()

template<int n>
SERAC_HOST_DEVICE bool serac::is_symmetric ( tensor< double, n, n >  A,
double  tolerance = 1.0e-8 
)

Return whether a square rank 2 tensor is symmetric.

Template Parameters
nThe height of the tensor
Parameters
AThe square rank 2 tensor
toleranceThe tolerance to check for symmetry
Returns
Whether the square rank 2 tensor (matrix) is symmetric

Definition at line 1404 of file tensor.hpp.

◆ is_symmetric_and_positive_definite()

SERAC_HOST_DEVICE bool serac::is_symmetric_and_positive_definite ( tensor< double, 2, 2 >  A)
inline

Return whether a matrix is symmetric and positive definite This check uses Sylvester's criterion, checking that each upper left subtensor has a determinant greater than zero.

Parameters
AThe matrix to test for positive definiteness
Returns
Whether the matrix is positive definite

Definition at line 1424 of file tensor.hpp.

◆ isHcurl()

bool serac::isHcurl ( const mfem::ParFiniteElementSpace &  fes)
inline

return whether or not the underlying function space is Hcurl or not

Parameters
festhe finite element space in question

Definition at line 88 of file dof_numbering.hpp.

◆ isL2()

bool serac::isL2 ( const mfem::ParFiniteElementSpace &  fes)
inline

return whether or not the underlying function space is L2 or not

Parameters
festhe finite element space in question

Definition at line 98 of file dof_numbering.hpp.

◆ leading_dimension()

template<typename T , int m, int... n>
constexpr SERAC_HOST_DEVICE int serac::leading_dimension ( tensor< T, m, n... >  )
constexpr

a function for querying the first dimension of a tensor

Template Parameters
Tthe datatype stored in the tensor
mthe first dimension of the tensor
nthe trailing dimensions of the tensor
Returns
m

Definition at line 1889 of file tensor.hpp.

◆ Legendre()

template<int n, typename T >
SERAC_HOST_DEVICE tensor<T, n> serac::Legendre ( x)

Legendre Polynomials, orthogonal on the domain (-1, 1) with unit weight function.

Template Parameters
nhow many entries to compute
Parameters
[in]xwhere to evaluate the polynomials

Definition at line 448 of file polynomials.hpp.

◆ linear_solve() [1/3]

template<typename S , typename T , int n, int... m>
constexpr SERAC_HOST_DEVICE auto serac::linear_solve ( const LuFactorization< S, n > &  lu_factors,
const tensor< T, n, m... > &  b 
)
constexpr

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Note
For use with a matrix that has already been factorized

Definition at line 1538 of file tensor.hpp.

◆ linear_solve() [2/3]

template<typename T , int n>
constexpr SERAC_HOST_DEVICE auto serac::linear_solve ( const LuFactorization< T, n > &  ,
const  zero 
)
constexpr

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Note
Shortcut for case of zero rhs

Definition at line 1554 of file tensor.hpp.

◆ linear_solve() [3/3]

template<typename S , typename T , int n, int... m>
constexpr SERAC_HOST_DEVICE auto serac::linear_solve ( const tensor< S, n, n > &  A,
const tensor< T, n, m... > &  b 
)
constexpr

Solves Ax = b for x using Gaussian elimination with partial pivoting.

Parameters
[in]AThe coefficient matrix A
[in]bThe righthand side vector b
Returns
x The solution vector

Definition at line 420 of file tuple_tensor_dual_functions.hpp.

◆ make_dual() [1/2]

template<int... n>
constexpr SERAC_HOST_DEVICE auto serac::make_dual ( const tensor< double, n... > &  A)
constexpr

Constructs a tensor of dual numbers from a tensor of values.

Parameters
[in]AThe tensor of values
Note
a d-order tensor's gradient will be initialized to the (2*d)-order identity tensor

Definition at line 339 of file tuple_tensor_dual_functions.hpp.

◆ make_dual() [2/2]

template<typename T0 , typename T1 >
constexpr SERAC_HOST_DEVICE auto serac::make_dual ( const tuple< T0, T1 > &  args)
constexpr

Promote a tuple of values to their corresponding dual types.

Template Parameters
T0the first type of the tuple argument
T1the first type of the tuple argument
Parameters
argsthe values to be promoted

example:

dual < serac::tuple < double, zero > >
tensor < dual < serac::tuple < zero, tensor< double, 3 > >, 3 >
> dual_of_f = make_dual(f);
constexpr SERAC_HOST_DEVICE auto make_dual(double x)
promote a value to a dual number of the appropriate type
Definition: dual.hpp:412
This is a class that mimics most of std::tuple's interface, except that it is usable in CUDA kernels ...
Definition: tuple.hpp:28

Definition at line 183 of file tuple_tensor_dual_functions.hpp.

◆ make_dual_helper() [1/2]

template<int i, int N, typename T , int... n>
constexpr SERAC_HOST_DEVICE auto serac::make_dual_helper ( const tensor< T, n... > &  arg)
constexpr

promote a tensor value to dual number with a one_hot_t< i, N, tensor > gradient type

Template Parameters
ithe index where the non-serac::zero derivative term appears
Nhow many entries in the gradient type
Parameters
argthe value to be promoted

Definition at line 154 of file tuple_tensor_dual_functions.hpp.

◆ make_dual_helper() [2/2]

template<int i, int N>
constexpr SERAC_HOST_DEVICE auto serac::make_dual_helper ( double  arg)
constexpr

promote a double value to dual number with a one_hot_t< i, N, double > gradient type

Template Parameters
ithe index where the non-serac::zero derivative term appears
Nhow many entries in the gradient type
Parameters
argthe value to be promoted

Definition at line 137 of file tuple_tensor_dual_functions.hpp.

◆ make_dual_wrt()

template<int n, typename... T>
constexpr auto serac::make_dual_wrt ( const serac::tuple< T... > &  args)
constexpr

take a tuple of values, and promote the nth one to a one-hot dual number of the appropriate type

Template Parameters
nthe index of the tuple argument to be made into a dual number
Tthe types of the values in the tuple
Parameters
argsthe values to be promoted

Definition at line 269 of file tuple_tensor_dual_functions.hpp.

◆ make_tensor() [1/5]

template<typename lambda_type >
SERAC_SUPPRESS_NVCC_HOSTDEVICE_WARNING constexpr SERAC_HOST_DEVICE auto serac::make_tensor ( lambda_type  f)
constexpr

Creates a tensor of requested dimension by subsequent calls to a functor Can be thought of as analogous to std::transform in that the set of possible indices for dimensions n are transformed into the values of the tensor by f.

Template Parameters
lambda_typeThe type of the functor
Parameters
[in]fThe functor to generate the tensor values from
Note
the different cases of 0D, 1D, 2D, 3D, and 4D are implemented separately to work around a limitation in nvcc involving host device lambdas with auto parameters.

Definition at line 300 of file tensor.hpp.

◆ make_tensor() [2/5]

template<int n1, typename lambda_type >
SERAC_SUPPRESS_NVCC_HOSTDEVICE_WARNING constexpr SERAC_HOST_DEVICE auto serac::make_tensor ( lambda_type  f)
constexpr

Creates a tensor of requested dimension by subsequent calls to a functor.

Template Parameters
n1The dimension of the tensor
lambda_typeThe type of the functor
Parameters
[in]fThe functor to generate the tensor values from
Precondition
f must accept n1 arguments of type int
Note
the different cases of 0D, 1D, 2D, 3D, and 4D are implemented separately to work around a limitation in nvcc involving host device lambdas with auto parameters.

Definition at line 319 of file tensor.hpp.

◆ make_tensor() [3/5]

template<int n1, int n2, typename lambda_type >
SERAC_SUPPRESS_NVCC_HOSTDEVICE_WARNING constexpr SERAC_HOST_DEVICE auto serac::make_tensor ( lambda_type  f)
constexpr

Creates a tensor of requested dimension by subsequent calls to a functor.

Template Parameters
n1The first dimension of the tensor
n2The second dimension of the tensor
lambda_typeThe type of the functor
Parameters
[in]fThe functor to generate the tensor values from
Precondition
f must accept n1 x n2 arguments of type int
Note
the different cases of 0D, 1D, 2D, 3D, and 4D are implemented separately to work around a limitation in nvcc involving host device lambdas with auto parameters.

Definition at line 343 of file tensor.hpp.

◆ make_tensor() [4/5]

template<int n1, int n2, int n3, typename lambda_type >
SERAC_SUPPRESS_NVCC_HOSTDEVICE_WARNING constexpr SERAC_HOST_DEVICE auto serac::make_tensor ( lambda_type  f)
constexpr

Creates a tensor of requested dimension by subsequent calls to a functor.

Template Parameters
n1The first dimension of the tensor
n2The second dimension of the tensor
n3The third dimension of the tensor
lambda_typeThe type of the functor
Parameters
[in]fThe functor to generate the tensor values from
Precondition
f must accept n1 x n2 x n3 arguments of type int
Note
the different cases of 0D, 1D, 2D, 3D, and 4D are implemented separately to work around a limitation in nvcc involving host device lambdas with auto parameters.

Definition at line 370 of file tensor.hpp.

◆ make_tensor() [5/5]

template<int n1, int n2, int n3, int n4, typename lambda_type >
SERAC_SUPPRESS_NVCC_HOSTDEVICE_WARNING constexpr SERAC_HOST_DEVICE auto serac::make_tensor ( lambda_type  f)
constexpr

Creates a tensor of requested dimension by subsequent calls to a functor.

Template Parameters
n1The first dimension of the tensor
n2The second dimension of the tensor
n3The third dimension of the tensor
n4The fourth dimension of the tensor
lambda_typeThe type of the functor
Parameters
[in]fThe functor to generate the tensor values from
Precondition
f must accept n1 x n2 x n3 x n4 arguments of type int
Note
the different cases of 0D, 1D, 2D, 3D, and 4D are implemented separately to work around a limitation in nvcc involving host device lambdas with auto parameters.

Definition at line 400 of file tensor.hpp.

◆ make_tuple()

template<typename... T>
SERAC_HOST_DEVICE tuple<T...> serac::make_tuple ( const T &...  args)

helper function for combining a list of values into a tuple

Template Parameters
Ttypes of the values to be tuple-d
Parameters
argsthe actual values to be put into a tuple

Definition at line 180 of file tuple.hpp.

◆ MakeBoundaryIntegral()

template<typename s , int Q, int dim, typename lambda_type >
Integral serac::MakeBoundaryIntegral ( const Domain domain,
lambda_type &&  qf,
std::vector< uint32_t >  argument_indices 
)

function to generate kernels held by an Integral object of type "Boundary", for all element types

Template Parameters
sa function signature type containing test/trial space informationa type containing a function signature
Qa parameter that controls the number of quadrature points
dimthe dimension of the domain
lambda_typea callable object that implements the q-function concept
Parameters
domainthe domain of integration
qfthe quadrature function
argument_indicesthe indices of trial space arguments used in the Integral
Returns
Integral the initialized Integral object
Note
this function is not meant to be called by users

Definition at line 328 of file integral.hpp.

◆ MakeDomainIntegral()

template<typename s , int Q, int dim, typename lambda_type , typename qpt_data_type >
Integral serac::MakeDomainIntegral ( const Domain domain,
lambda_type &&  qf,
std::shared_ptr< QuadratureData< qpt_data_type > >  qdata,
std::vector< uint32_t >  argument_indices 
)

function to generate kernels held by an Integral object of type "Domain", for all element types

Template Parameters
sa function signature type containing test/trial space informationa type containing a function signature
Qa parameter that controls the number of quadrature points
dimthe dimension of the domain
lambda_typea callable object that implements the q-function concept
qpt_data_typeany quadrature point data needed by the material model
Parameters
domainthe domain of integration
qfthe quadrature function
qdatathe values of any quadrature point data for the material
argument_indicesthe indices of trial space arguments used in the Integral
Returns
Integral the initialized Integral object

Definition at line 239 of file integral.hpp.

◆ matrix_sqrt()

template<typename T , int dim>
auto serac::matrix_sqrt ( const tensor< T, dim, dim > &  A)

compute the matrix square root of a square, real-valued, symmetric matrix i.e. given A, find B such that A = dot(B, B)

Template Parameters
Tthe data type stored in each element of the matrix
Parameters
Athe matrix to compute the square root of
Returns
a square matrix, B, of the same type as A satisfying dot(B, B) == A

Definition at line 1278 of file tensor.hpp.

◆ max() [1/2]

double serac::max ( const FiniteElementVector fe_vector)

Find the max value of a finite element vector across all dofs.

Parameters
fe_vectorThe state variable to compute a max of
Returns
The max value
Note
This acts on the actual scalar degree of freedom values, not the interpolated shape function values. This implies these may or may not be nodal averages depending on the choice of finite element basis.

Definition at line 100 of file finite_element_vector.cpp.

◆ max() [2/2]

template<typename gradient_type >
SERAC_HOST_DEVICE auto serac::max ( dual< gradient_type >  a,
double  b 
)

Implementation of max for dual numbers.

Note
This is not differentiable at a == b. At that point, the gradient is calculated as the gradient of b.

Definition at line 230 of file dual.hpp.

◆ min() [1/2]

double serac::min ( const FiniteElementVector fe_vector)

Find the min value of a finite element vector across all dofs.

Parameters
fe_vectorThe state variable to compute a min of
Returns
The min value
Note
This acts on the actual scalar degree of freedom values, not the interpolated shape function values. This implies these may or may not be nodal averages depending on the choice of finite element basis.

Definition at line 108 of file finite_element_vector.cpp.

◆ min() [2/2]

template<typename gradient_type >
SERAC_HOST_DEVICE auto serac::min ( dual< gradient_type >  a,
double  b 
)

Implementation of min for dual numbers.

Note
This is not differentiable at a == b. At that point, the gradient is calculated as the gradient of b.

Definition at line 256 of file dual.hpp.

◆ minus_equals_helper()

template<typename... T, int... i>
constexpr SERAC_HOST_DEVICE void serac::minus_equals_helper ( tuple< T... > &  x,
const tuple< T... > &  y,
std::integer_sequence< int, i... >   
)
constexpr

A helper function for the -= operator of tuples.

Template Parameters
Tthe types stored in the tuples x and y
iinteger sequence used to index the tuples
Parameters
xtuple of values to be subracted from
ytuple of values to subtract from x

Definition at line 370 of file tuple.hpp.

◆ minus_helper()

template<typename... S, typename... T, int... i>
constexpr SERAC_HOST_DEVICE auto serac::minus_helper ( const tuple< S... > &  x,
const tuple< T... > &  y,
std::integer_sequence< int, i... >   
)
constexpr

A helper function for the - operator of tuples.

Template Parameters
Sthe types stored in the tuple x
Tthe types stored in the tuple y
iThe integer sequence to i
Parameters
xtuple of values
ytuple of values
Returns
the returned tuple difference

Definition at line 399 of file tuple.hpp.

◆ mult_helper() [1/3]

template<typename... T, int... i>
constexpr SERAC_HOST_DEVICE auto serac::mult_helper ( const double  a,
const tuple< T... > &  x,
std::integer_sequence< int, i... >   
)
constexpr

A helper function for the * operator of tuples.

Template Parameters
Tthe types stored in the tuple y
iThe integer sequence to i
Parameters
xtuple of values
aa constant multiplier
Returns
the returned tuple product

Definition at line 570 of file tuple.hpp.

◆ mult_helper() [2/3]

template<typename... S, typename... T, int... i>
constexpr SERAC_HOST_DEVICE auto serac::mult_helper ( const tuple< S... > &  x,
const tuple< T... > &  y,
std::integer_sequence< int, i... >   
)
constexpr

A helper function for the * operator of tuples.

Template Parameters
Sthe types stored in the tuple x
Tthe types stored in the tuple y
iThe integer sequence to i
Parameters
xtuple of values
ytuple of values
Returns
the returned tuple product

Definition at line 540 of file tuple.hpp.

◆ mult_helper() [3/3]

template<typename... T, int... i>
constexpr SERAC_HOST_DEVICE auto serac::mult_helper ( const tuple< T... > &  x,
const double  a,
std::integer_sequence< int, i... >   
)
constexpr

A helper function for the * operator of tuples.

Template Parameters
Tthe types stored in the tuple y
iThe integer sequence to i
Parameters
xtuple of values
aa constant multiplier
Returns
the returned tuple product

Definition at line 585 of file tuple.hpp.

◆ norm() [1/3]

double serac::norm ( const FiniteElementState state,
const double  p = 2 
)

Find the Lp norm of a finite element state across all dofs.

Parameters
stateThe state variable to compute a norm of
pThe order norm to compute
Returns
The Lp norm of the finite element state

Definition at line 86 of file finite_element_state.cpp.

◆ norm() [2/3]

template<typename T , int m>
constexpr SERAC_HOST_DEVICE auto serac::norm ( const isotropic_tensor< T, m, m > &  I)
constexpr

compute the Frobenius norm (sqrt(tr(dot(transpose(I), I)))) of an isotropic tensor

Template Parameters
Tthe types stored in the isotropic tensor
mthe number of rows and columns in I
Parameters
Ithe isotropic tensor to compute the norm of

Definition at line 324 of file isotropic_tensor.hpp.

◆ norm() [3/3]

template<typename T , int... n>
SERAC_HOST_DEVICE auto serac::norm ( const tensor< T, n... > &  A)

Returns the Frobenius norm of the tensor.

Parameters
[in]AThe tensor to obtain the norm from

Definition at line 1045 of file tensor.hpp.

◆ normalize()

template<typename T , int... n>
SERAC_HOST_DEVICE auto serac::normalize ( const tensor< T, n... > &  A)

Normalizes the tensor Each element is divided by the Frobenius norm of the tensor,.

See also
norm
Parameters
[in]AThe tensor to normalize

Definition at line 1062 of file tensor.hpp.

◆ num_quadrature_points()

constexpr int serac::num_quadrature_points ( mfem::Geometry::Type  g,
int  Q 
)
constexpr

return the number of quadrature points in a Gauss-Legendre rule with parameter "Q"

Template Parameters
gthe element geometry
Qthe number of quadrature points per dimension

Definition at line 25 of file geometry.hpp.

◆ operator!=()

bool serac::operator!= ( const ElemInfo x,
const ElemInfo y 
)
inline

operator determining inequality by {global_row, global_col}

Parameters
xthe ElemInfo on the left
ythe ElemInfo on the right

Definition at line 50 of file dof_numbering.hpp.

◆ operator*() [1/7]

template<typename... T>
constexpr SERAC_HOST_DEVICE auto serac::operator* ( const double  a,
const tuple< T... > &  x 
)
constexpr

multiply each component of x by the value a on the left

Template Parameters
Tthe types stored in the tuple
Parameters
aa scaling factor
xthe tuple object

Definition at line 597 of file tuple.hpp.

◆ operator*() [2/7]

template<typename S , typename T , int m, int... n, typename = std::enable_if_t<std::is_arithmetic_v<S> || is_dual_number<S>::value>>
constexpr SERAC_HOST_DEVICE auto serac::operator* ( const tensor< T, m, n... > &  A,
scale 
)
constexpr

multiply a tensor by a scalar value

Template Parameters
Sthe scalar value type. Must be arithmetic (e.g. float, double, int) or a dual number
Tthe underlying type of the tensor (righthand) argument
nintegers describing the tensor shape
Parameters
[in]AThe tensor to be scaled
[in]scaleThe scaling factor

Definition at line 52 of file tuple_tensor_dual_functions.hpp.

◆ operator*() [3/7]

template<typename... S, typename... T>
constexpr SERAC_HOST_DEVICE auto serac::operator* ( const tuple< S... > &  x,
const tuple< T... > &  y 
)
constexpr

return a tuple of values defined by elementwise multiplication of x and y

Template Parameters
Sthe types stored in the tuple x
Tthe types stored in the tuple y
Parameters
xa tuple of values
ya tuple of values

Definition at line 554 of file tuple.hpp.

◆ operator*() [4/7]

template<typename... T>
constexpr SERAC_HOST_DEVICE auto serac::operator* ( const tuple< T... > &  x,
const double  a 
)
constexpr

multiply each component of x by the value a on the right

Template Parameters
Tthe types stored in the tuple
Parameters
xthe tuple object
aa scaling factor

Definition at line 609 of file tuple.hpp.

◆ operator*() [5/7]

template<typename S , typename T , int m, int... n, typename = std::enable_if_t<std::is_arithmetic_v<S> || is_dual_number<S>::value>>
constexpr SERAC_HOST_DEVICE auto serac::operator* ( scale,
const tensor< T, m, n... > &  A 
)
constexpr

multiply a tensor by a scalar value

Template Parameters
Sthe scalar value type. Must be arithmetic (e.g. float, double, int) or a dual number
Tthe underlying type of the tensor (righthand) argument
nintegers describing the tensor shape
Parameters
[in]scaleThe scaling factor
[in]AThe tensor to be scaled

Definition at line 33 of file tuple_tensor_dual_functions.hpp.

◆ operator*() [6/7]

template<typename S , typename T , int m>
constexpr SERAC_HOST_DEVICE auto serac::operator* ( scale,
isotropic_tensor< T, m, m >  I 
)
constexpr

scalar multiplication

Template Parameters
Sthe type of the left operand, scale
Tthe type of the isotropic tensor
mthe number of rows and columns in the isotropic tensor
Parameters
scalethe value that multiplies each entry of I (from the left)
Ithe isotropic tensor being scaled
Returns
a new isotropic tensor equal to the product of scale * I

Definition at line 77 of file isotropic_tensor.hpp.

◆ operator*() [7/7]

template<typename S , typename T , int m>
constexpr SERAC_HOST_DEVICE auto serac::operator* ( scale,
isotropic_tensor< T, m, m, m, m >  I 
)
constexpr

scalar multiplication

Template Parameters
Sthe type of the left operand, scale
Tthe type of the isotropic tensor
mthe dimension of each rank-4 isotropic tensor
Parameters
scalethe value that multiplies each entry of I (from the left)
Ithe isotropic tensor being scaled
Returns
a new isotropic tensor equal to the product of scale * I

Definition at line 410 of file isotropic_tensor.hpp.

◆ operator+() [1/5]

template<typename S , typename T , int m>
constexpr SERAC_HOST_DEVICE auto serac::operator+ ( const isotropic_tensor< S, m, m > &  I,
const tensor< T, m, m > &  A 
)
constexpr

sum of isotropic and (nonisotropic) tensor

Template Parameters
Sthe type of the left isotropic tensor
Tthe type of the right tensor
mthe number of rows and columns in each tensor
Parameters
Ithe left operand
Athe (full) right operand
Returns
a new tensor equal to the sum of I and A

Definition at line 132 of file isotropic_tensor.hpp.

◆ operator+() [2/5]

template<typename S , typename T , int m, int... n>
constexpr SERAC_HOST_DEVICE auto serac::operator+ ( const tensor< S, m, n... > &  A,
const tensor< T, m, n... > &  B 
)
constexpr

return the sum of two tensors

Template Parameters
Sthe underlying type of the lefthand argument
Tthe underlying type of the righthand argument
nintegers describing the tensor shape
Parameters
[in]AThe lefthand operand
[in]BThe righthand operand

Definition at line 425 of file tensor.hpp.

◆ operator+() [3/5]

template<typename... S, typename... T>
constexpr SERAC_HOST_DEVICE auto serac::operator+ ( const tuple< S... > &  x,
const tuple< T... > &  y 
)
constexpr

return a tuple of values defined by elementwise sum of x and y

Template Parameters
Sthe types stored in the tuple x
Tthe types stored in the tuple y
Parameters
xa tuple of values
ya tuple of values

Definition at line 328 of file tuple.hpp.

◆ operator+() [4/5]

template<typename S , typename T , int m>
constexpr SERAC_HOST_DEVICE auto serac::operator+ ( isotropic_tensor< S, m, m >  I1,
isotropic_tensor< T, m, m >  I2 
)
constexpr

addition of isotropic tensors

Template Parameters
Sthe type of the left isotropic tensor
Tthe type of the right isotropic tensor
mthe number of rows and columns in each isotropic tensor
Parameters
I1the left operand
I2the right operand
Returns
a new isotropic tensor equal to the sum of I1 and I2

Definition at line 100 of file isotropic_tensor.hpp.

◆ operator+() [5/5]

template<typename S , typename T , int m>
constexpr SERAC_HOST_DEVICE auto serac::operator+ ( isotropic_tensor< S, m, m, m, m >  I1,
isotropic_tensor< T, m, m, m, m >  I2 
)
constexpr

addition of isotropic tensors

Template Parameters
Sthe type of the left isotropic tensor
Tthe type of the right isotropic tensor
mthe dimension of each rank-4 isotropic tensor
Parameters
I1the left operand
I2the right operand
Returns
a new isotropic tensor equal to the sum of I1 and I2

Definition at line 433 of file isotropic_tensor.hpp.

◆ operator+=() [1/7]

template<typename S , typename T , int m, int... n>
constexpr SERAC_HOST_DEVICE auto& serac::operator+= ( tensor< S, m, n... > &  A,
const tensor< T, m, n... > &  B 
)
constexpr

compound assignment (+) on tensors

Template Parameters
Sthe underlying type of the tensor (lefthand) argument
Tthe underlying type of the tensor (righthand) argument
nintegers describing the tensor shape
Parameters
[in]AThe lefthand tensor
[in]BThe righthand tensor

Definition at line 477 of file tensor.hpp.

◆ operator+=() [2/7]

template<typename T >
constexpr SERAC_HOST_DEVICE auto& serac::operator+= ( tensor< T, 1 > &  A,
const T &  B 
)
constexpr

compound assignment (+) on tensors

Template Parameters
Tthe underlying type of the tensor argument
Parameters
[in]AThe lefthand tensor
[in]BThe righthand tensor

Definition at line 536 of file tensor.hpp.

◆ operator+=() [3/7]

template<typename T >
constexpr SERAC_HOST_DEVICE auto& serac::operator+= ( tensor< T, 1, 1 > &  A,
const T &  B 
)
constexpr

compound assignment (+) on tensors

Template Parameters
Tthe underlying type of the tensor argument
Parameters
[in]AThe lefthand tensor
[in]BThe righthand tensor

Definition at line 548 of file tensor.hpp.

◆ operator+=() [4/7]

template<typename T , int n>
constexpr SERAC_HOST_DEVICE auto& serac::operator+= ( tensor< T, 1, n > &  A,
const tensor< T, n > &  B 
)
constexpr

compound assignment (+) on tensors

Template Parameters
Tthe underlying type of the tensor argument
Parameters
[in]AThe lefthand tensor
[in]BThe righthand tensor

Definition at line 521 of file tensor.hpp.

◆ operator+=() [5/7]

template<typename T , int n>
constexpr SERAC_HOST_DEVICE auto& serac::operator+= ( tensor< T, n, 1 > &  A,
const tensor< T, n > &  B 
)
constexpr

compound assignment (+) on tensors

Template Parameters
Tthe underlying type of the tensor argument
Parameters
[in]AThe lefthand tensor
[in]BThe righthand tensor

Definition at line 506 of file tensor.hpp.

◆ operator+=() [6/7]

template<typename T , int... n>
constexpr SERAC_HOST_DEVICE auto& serac::operator+= ( tensor< T, n... > &  A,
zero   
)
constexpr

compound assignment (+) between a tensor and zero (no-op)

Template Parameters
Tthe underlying type of the tensor (righthand) argument
nintegers describing the tensor shape
Parameters
[in]AThe lefthand tensor

Definition at line 560 of file tensor.hpp.

◆ operator+=() [7/7]

template<typename... T>
constexpr SERAC_HOST_DEVICE auto serac::operator+= ( tuple< T... > &  x,
const tuple< T... > &  y 
)
constexpr

add values contained in y, to the tuple x

Template Parameters
Tthe types stored in the tuples x and y
Parameters
xa tuple of values
ya tuple of values

Definition at line 356 of file tuple.hpp.

◆ operator-() [1/7]

template<typename S , typename T , int m>
constexpr SERAC_HOST_DEVICE auto serac::operator- ( const isotropic_tensor< S, m, m > &  I,
const tensor< T, m, m > &  A 
)
constexpr

difference of isotropic and (nonisotropic) tensor

Template Parameters
Sthe type of the left isotropic tensor
Tthe type of the right tensor
mthe number of rows and columns in each tensor
Parameters
Ithe left operand
Athe (full) right operand
Returns
a new tensor equal to the difference of I and A

Definition at line 167 of file isotropic_tensor.hpp.

◆ operator-() [2/7]

template<typename S , typename T , int m, int... n>
constexpr SERAC_HOST_DEVICE auto serac::operator- ( const tensor< S, m, n... > &  A,
const tensor< T, m, n... > &  B 
)
constexpr

return the difference of two tensors

Template Parameters
Sthe underlying type of the lefthand argument
Tthe underlying type of the righthand argument
nintegers describing the tensor shape
Parameters
[in]AThe lefthand operand
[in]BThe righthand operand

Definition at line 459 of file tensor.hpp.

◆ operator-() [3/7]

template<typename T , int m, int... n>
constexpr SERAC_HOST_DEVICE auto serac::operator- ( const tensor< T, m, n... > &  A)
constexpr

return the unary negation of a tensor

Template Parameters
Tthe underlying type of the righthand argument
nintegers describing the tensor shape
Parameters
[in]AThe tensor to negate

Definition at line 441 of file tensor.hpp.

◆ operator-() [4/7]

template<typename... S, typename... T>
constexpr SERAC_HOST_DEVICE auto serac::operator- ( const tuple< S... > &  x,
const tuple< T... > &  y 
)
constexpr

return a tuple of values defined by elementwise difference of x and y

Template Parameters
Sthe types stored in the tuple x
Tthe types stored in the tuple y
Parameters
xa tuple of values
ya tuple of values

Definition at line 413 of file tuple.hpp.

◆ operator-() [5/7]

template<typename... T>
constexpr SERAC_HOST_DEVICE auto serac::operator- ( const tuple< T... > &  x)
constexpr

return a tuple of values defined by applying the unary minus operator to each element of x

Template Parameters
Tthe types stored in the tuple y
Parameters
xa tuple of values

Definition at line 439 of file tuple.hpp.

◆ operator-() [6/7]

template<typename S , typename T , int m>
constexpr SERAC_HOST_DEVICE auto serac::operator- ( isotropic_tensor< S, m, m >  I1,
isotropic_tensor< T, m, m >  I2 
)
constexpr

difference of isotropic tensors

Template Parameters
Sthe type of the left isotropic tensor
Tthe type of the right isotropic tensor
mthe number of rows and columns in each isotropic tensor
Parameters
I1the left operand
I2the right operand
Returns
a new isotropic tensor equal to the difference of I1 and I2

Definition at line 116 of file isotropic_tensor.hpp.

◆ operator-() [7/7]

template<typename S , typename T , int m>
constexpr SERAC_HOST_DEVICE auto serac::operator- ( isotropic_tensor< S, m, m, m, m >  I1,
isotropic_tensor< T, m, m, m, m >  I2 
)
constexpr

difference of isotropic tensors

Template Parameters
Sthe type of the left isotropic tensor
Tthe type of the right isotropic tensor
mthe dimension of each rank-4 isotropic tensor
Parameters
I1the left operand
I2the right operand
Returns
a new isotropic tensor equal to the difference of I1 and I2

Definition at line 449 of file isotropic_tensor.hpp.

◆ operator-=() [1/3]

template<typename S , typename T , int m, int... n>
constexpr SERAC_HOST_DEVICE auto& serac::operator-= ( tensor< S, m, n... > &  A,
const tensor< T, m, n... > &  B 
)
constexpr

compound assignment (-) on tensors

Template Parameters
Sthe underlying type of the tensor (lefthand) argument
Tthe underlying type of the tensor (righthand) argument
nintegers describing the tensor shape
Parameters
[in]AThe lefthand tensor
[in]BThe righthand tensor

Definition at line 574 of file tensor.hpp.

◆ operator-=() [2/3]

template<typename T , int... n>
constexpr SERAC_HOST_DEVICE auto& serac::operator-= ( tensor< T, n... > &  A,
zero   
)
constexpr

compound assignment (-) between a tensor and zero (no-op)

Template Parameters
Tthe underlying type of the tensor (righthand) argument
nintegers describing the tensor shape
Parameters
[in]AThe lefthand tensor

Definition at line 589 of file tensor.hpp.

◆ operator-=() [3/3]

template<typename... T>
constexpr SERAC_HOST_DEVICE auto serac::operator-= ( tuple< T... > &  x,
const tuple< T... > &  y 
)
constexpr

add values contained in y, to the tuple x

Template Parameters
Tthe types stored in the tuples x and y
Parameters
xa tuple of values
ya tuple of values

Definition at line 383 of file tuple.hpp.

◆ operator/() [1/5]

template<typename... T>
constexpr SERAC_HOST_DEVICE auto serac::operator/ ( const double  a,
const tuple< T... > &  x 
)
constexpr

return a tuple of values defined by division of a by the elements of x

Template Parameters
Tthe types stored in the tuple x
Parameters
athe numerator
xa tuple of denominator values

Definition at line 512 of file tuple.hpp.

◆ operator/() [2/5]

template<typename S , typename T , int m, int... n, typename = std::enable_if_t<std::is_arithmetic_v<S> || is_dual_number<S>::value>>
constexpr SERAC_HOST_DEVICE auto serac::operator/ ( const tensor< T, m, n... > &  A,
scale 
)
constexpr

divide a tensor by a scalar

Template Parameters
Sthe scalar value type. Must be arithmetic (e.g. float, double, int) or a dual number
Tthe underlying type of the tensor (righthand) argument
nintegers describing the tensor shape
Parameters
[in]AThe tensor of numerators
[in]scaleThe denominator

Definition at line 90 of file tuple_tensor_dual_functions.hpp.

◆ operator/() [3/5]

template<typename... S, typename... T>
constexpr SERAC_HOST_DEVICE auto serac::operator/ ( const tuple< S... > &  x,
const tuple< T... > &  y 
)
constexpr

return a tuple of values defined by elementwise division of x by y

Template Parameters
Sthe types stored in the tuple x
Tthe types stored in the tuple y
Parameters
xa tuple of values
ya tuple of values

Definition at line 469 of file tuple.hpp.

◆ operator/() [4/5]

template<typename... T>
constexpr SERAC_HOST_DEVICE auto serac::operator/ ( const tuple< T... > &  x,
const double  a 
)
constexpr

return a tuple of values defined by elementwise division of x by a

Template Parameters
Tthe types stored in the tuple y
Parameters
xa tuple of numerator values
aa denominator

Definition at line 524 of file tuple.hpp.

◆ operator/() [5/5]

template<typename S , typename T , int m, int... n, typename = std::enable_if_t<std::is_arithmetic_v<S> || is_dual_number<S>::value>>
constexpr SERAC_HOST_DEVICE auto serac::operator/ ( scale,
const tensor< T, m, n... > &  A 
)
constexpr

divide a scalar by each element in a tensor

Template Parameters
Sthe scalar value type. Must be arithmetic (e.g. float, double, int) or a dual number
Tthe underlying type of the tensor (righthand) argument
nintegers describing the tensor shape
Parameters
[in]scaleThe numerator
[in]AThe tensor of denominators

Definition at line 71 of file tuple_tensor_dual_functions.hpp.

◆ operator<()

bool serac::operator< ( const ElemInfo x,
const ElemInfo y 
)
inline

operator for sorting lexicographically by {global_row, global_col}

Parameters
xthe ElemInfo on the left
ythe ElemInfo on the right

Definition at line 40 of file dof_numbering.hpp.

◆ operator<<() [1/3]

template<typename... T>
auto& serac::operator<< ( std::ostream &  out,
const serac::tuple< T... > &  A 
)

print a tuple of values

Template Parameters
Tthe types stored in the tuple
Parameters
outthe ostream to write the output to
Athe tuple of values

Definition at line 637 of file tuple.hpp.

◆ operator<<() [2/3]

template<typename T , int m, int... n>
auto& serac::operator<< ( std::ostream &  out,
const tensor< T, m, n... > &  A 
)

recursively serialize the entries in a tensor to an ostream. Output format uses braces and comma separators to mimic C syntax for multidimensional array initialization.

Parameters
[in]outthe std::ostream to write to (e.g. std::cout or std::ofstream)
[in]AThe tensor to write out

Definition at line 1621 of file tensor.hpp.

◆ operator<<() [3/3]

auto& serac::operator<< ( std::ostream &  out,
zero   
)
inline

Write a zero out to an output stream.

Parameters
[in]outthe std::ostream to write to (e.g. std::cout or std::ofstream)

Definition at line 1636 of file tensor.hpp.

◆ outer() [1/5]

template<typename S , typename T , int m, int n>
constexpr SERAC_HOST_DEVICE auto serac::outer ( const tensor< S, m > &  A,
const tensor< T, n > &  B 
)
constexpr

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Note
this overload implements the case where both arguments are vectors

Definition at line 647 of file tensor.hpp.

◆ outer() [2/5]

template<typename T , int m>
constexpr SERAC_HOST_DEVICE auto serac::outer ( const tensor< T, m > &  A,
double  B 
)
constexpr

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Note
this overload implements the case where the left argument is a tensor, and the right argument is a scalar

Definition at line 613 of file tensor.hpp.

◆ outer() [3/5]

template<typename T , int n>
constexpr SERAC_HOST_DEVICE auto serac::outer ( const tensor< T, n > &  ,
zero   
)
constexpr

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Note
this overload implements the case where the left argument is a tensor, and the right argument is zero

Definition at line 637 of file tensor.hpp.

◆ outer() [4/5]

template<typename T , int n>
constexpr SERAC_HOST_DEVICE auto serac::outer ( double  A,
tensor< T, n >  B 
)
constexpr

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Note
this overload implements the case where the left argument is a scalar, and the right argument is a tensor

Definition at line 599 of file tensor.hpp.

◆ outer() [5/5]

template<typename T , int n>
constexpr SERAC_HOST_DEVICE auto serac::outer ( zero  ,
const tensor< T, n > &   
)
constexpr

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Note
this overload implements the case where the left argument is zero, and the right argument is a tensor

Definition at line 627 of file tensor.hpp.

◆ parent_to_physical()

template<Family f, typename T , int q, int dim>
SERAC_HOST_DEVICE void serac::parent_to_physical ( tensor< T, q > &  qf_input,
const tensor< double, dim, dim, q > &  jacobians 
)

transform information in the parent space (i.e. values and derivatives w.r.t {xi, eta, zeta}) into the physical space (i.e. values and derivatives w.r.t. {x, y, z})

Template Parameters
fthe element family, used to determine which kind of transformation to apply
Tthe types of quantities to be transformed
qhow many values need to be transformed
dimthe spatial dimension
Parameters
qf_inputthe values to be transformed from parent to physical space
jacobiansthe jacobians of the isoparametric map from parent to physical space of each quadrature point

Definition at line 247 of file finite_element.hpp.

◆ physical_to_parent()

template<Family f, typename T , int q, int dim>
SERAC_HOST_DEVICE void serac::physical_to_parent ( tensor< T, q > &  qf_output,
const tensor< double, dim, dim, q > &  jacobians 
)

transform information in the physical space (i.e. sources and fluxes w.r.t {x, y, z}) back to the parent space (i.e. values and derivatives w.r.t. {xi, eta, zeta}). Note: this also multiplies by the outputs by the determinant of the quadrature point Jacobian.

Template Parameters
fthe element family, used to determine which kind of transformation to apply
Tthe types of quantities to be transformed
qhow many values need to be transformed
dimthe spatial dimension
Parameters
qf_outputthe values to be transformed from physical back to parent space
jacobiansthe jacobians of the isoparametric map from parent to physical space of each quadrature point

Definition at line 288 of file finite_element.hpp.

◆ plus_equals_helper()

template<typename... T, int... i>
constexpr SERAC_HOST_DEVICE void serac::plus_equals_helper ( tuple< T... > &  x,
const tuple< T... > &  y,
std::integer_sequence< int, i... >   
)
constexpr

A helper function for the += operator of tuples.

Template Parameters
Tthe types stored in the tuples x and y
iinteger sequence used to index the tuples
Parameters
xtuple of values to be incremented
ytuple of increment values

Definition at line 343 of file tuple.hpp.

◆ plus_helper()

template<typename... S, typename... T, int... i>
constexpr SERAC_HOST_DEVICE auto serac::plus_helper ( const tuple< S... > &  x,
const tuple< T... > &  y,
std::integer_sequence< int, i... >   
)
constexpr

A helper function for the + operator of tuples.

Template Parameters
Sthe types stored in the tuple x
Tthe types stored in the tuple y
iThe integer sequence to i
Parameters
xtuple of values
ytuple of values
Returns
the returned tuple sum

Definition at line 314 of file tuple.hpp.

◆ powers()

template<int n, typename T >
constexpr SERAC_HOST_DEVICE tensor<T, n> serac::powers ( x)
constexpr

compute the first n powers of x

Template Parameters
nhow many powers to compute
Parameters
[in]xthe number to be raised to varying powers

Definition at line 389 of file polynomials.hpp.

◆ print() [1/2]

template<int m, int... n>
SERAC_HOST_DEVICE void serac::print ( const tensor< double, m, n... > &  A)

print a tensor using printf, so that it is suitable for use inside cuda kernels.

Parameters
[in]AThe tensor to write out

Definition at line 1654 of file tensor.hpp.

◆ print() [2/2]

SERAC_HOST_DEVICE void serac::print ( double  value)
inline

print a double using printf, so that it is suitable for use inside cuda kernels. (used in final recursion of printf(tensor<...>))

Parameters
[in]valueThe value to write out

Definition at line 1647 of file tensor.hpp.

◆ print_helper()

template<typename... T, std::size_t... i>
auto& serac::print_helper ( std::ostream &  out,
const serac::tuple< T... > &  A,
std::integer_sequence< size_t, i... >   
)

helper used to implement printing a tuple of values

Template Parameters
Tthe types stored in the tuple
ia list of indices used to acces each element of the tuple
Parameters
outthe ostream to write the output to
Athe tuple of values

Definition at line 622 of file tuple.hpp.

◆ printRunInfo()

void serac::printRunInfo ( )

Outputs basic run information to the screen.

Note: Command line options are handled in infrastructure/cli.cpp

Definition at line 192 of file about.cpp.

◆ promote_each_to_dual_when()

template<bool dualify, typename T , int n>
SERAC_HOST_DEVICE auto serac::promote_each_to_dual_when ( const tensor< T, n > &  x)

a function that optionally (decided at compile time) converts a list of values to their dual types

Template Parameters
dualifyspecify whether or not the input should be made into its dual type
Tthe type of the values passed in
nhow many values were passed in
Parameters
xthe values to be promoted

Definition at line 223 of file tuple_tensor_dual_functions.hpp.

◆ promote_to_dual_when()

template<bool dualify, typename T >
SERAC_HOST_DEVICE auto serac::promote_to_dual_when ( const T &  x)

a function that optionally (decided at compile time) converts a value to its dual type

Template Parameters
dualifyspecify whether or not the value should be made into its dual type
Tthe type of the value passed in
Parameters
xthe values to be promoted

Definition at line 204 of file tuple_tensor_dual_functions.hpp.

◆ relative_error()

template<typename T , int... n>
double serac::relative_error ( tensor< T, n... >  A,
tensor< T, n... >  B 
)

computes the relative error (in the frobenius norm) between two tensors of the same shape

Template Parameters
Tthe datatype stored in each tensor
nthe dimensions of each tensor
Parameters
Athe left argument
Bthe right argument
Returns
norm(A - B) / norm(A)

Definition at line 1390 of file tensor.hpp.

◆ sameFiniteElementSpace()

bool serac::sameFiniteElementSpace ( const mfem::FiniteElementSpace &  left,
const mfem::FiniteElementSpace &  right 
)

Check if two finite element spaces are the same.

Parameters
left
right
Returns
Bool which is true if the spaces are the same, otherwise false

Definition at line 123 of file finite_element_vector.cpp.

◆ single_quadrature_point_test()

template<typename MaterialType , typename StateType , typename... functions>
auto serac::single_quadrature_point_test ( double  t_max,
size_t  num_steps,
const MaterialType  material,
const StateType  initial_state,
const functions...  f 
)

This function takes a material model (and associate state variables), subjects it to a time history of stimuli, described by functions ... f, and returns the outputs at each step. This is intended to be used for testing materials, to ensure their response is in agreement with known data (analytic or experimental).

Template Parameters
MaterialTypethe type of the material model under test
StateTypethe associated state variables to be provided to the material
functionsa variadic list of callables
Parameters
t_maxthe final time value for
num_stepsthe number of timesteps to be
materialan instance of a material model under test
initial_statethe initial conditions for materials that exhibit hysteresis
fthe functions (e.g. std::function, lambdas, etc) that are used to generate the inputs to the material model at each timestep
Returns
a std::vector of tuples of the form: ( time, state(t), f(t) ... , output(t) ) evaluated at each step

Definition at line 103 of file material_verification_tools.hpp.

◆ size() [1/2]

constexpr SERAC_HOST_DEVICE int serac::size ( const double &  )
constexpr

overload of size() for double, we say a double "stores" 1 value

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 1860 of file tensor.hpp.

◆ size() [2/2]

template<typename T , int... n>
constexpr SERAC_HOST_DEVICE int serac::size ( const tensor< T, n... > &  )
constexpr

returns the total number of stored values in a tensor

Template Parameters
Tthe datatype stored in the tensor
nthe extents of each dimension
Returns
the total number of values stored in the tensor

Definition at line 1851 of file tensor.hpp.

◆ solve_lower_triangular() [1/2]

template<typename T , int n, int... m>
constexpr SERAC_HOST_DEVICE auto serac::solve_lower_triangular ( const tensor< T, n, n > &  L,
const tensor< T, n, m... > &  b 
)
constexpr

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Note
For the case when no permutation of the rows is needed.

Definition at line 1499 of file tensor.hpp.

◆ solve_lower_triangular() [2/2]

template<typename T , int n, int... m>
constexpr SERAC_HOST_DEVICE auto serac::solve_lower_triangular ( const tensor< T, n, n > &  L,
const tensor< T, n, m... > &  b,
const tensor< int, n > &  P 
)
constexpr

Solves a lower triangular system Ly = b.

L must be lower triangular and normalized such that the diagonal entries are unity. This is not checked in the function, so failure to obey this will produce meaningless results.

Parameters
[in]LA lower triangular matrix
[in]bThe right hand side
[in]PA list of indices to index into b in a permuted fashion.
Returns
y the solution vector

Definition at line 1480 of file tensor.hpp.

◆ solve_scalar_equation()

template<typename function , typename... ParamTypes>
auto serac::solve_scalar_equation ( function &&  f,
double  x0,
double  lower_bound,
double  upper_bound,
ScalarSolverOptions  options,
ParamTypes...  params 
)

Solves a nonlinear scalar-valued equation and gives derivatives of solution to parameters.

Template Parameters
functionFunction object type for the nonlinear equation to solve
...ParamTypesTypes of the (optional) parameters to the nonlinear function
Parameters
fNonlinear function of which a root is sought. Must have the form $f(x, p_1, p_2, ...)$, where $x$ is the independent variable, and the $p_i$ are optional parameters (scalars or tensors of arbitrary order).
x0Initial guess of root. If x0 is outside the search interval, the initial guess will be changed to the midpoint of the search interval.
lower_boundLower bound of interval to search for root.
upper_boundUpper bound of interval to search for root.
optionsOptions controlling behavior of solver.
...paramsOptional parameters to the nonlinear function.
Returns
a tuple (x, status) where x is the root, and status is a SolverStatus object reporting the status of the solution procedure. If any of the parameters are dual number-valued, x will be dual containing the corresponding directional derivative of the root. Otherwise, x will be a double containing the root. For example, if one gives the function as $f(x, p)$, where $p$ is a dual<double> with p.gradient = 1, then the x.gradient will be $dx/dp$.

The solver uses Newton's method, safeguarded by bisection. If the Newton update would take the next iterate out of the search interval, or the absolute value of the residual is not decreasing fast enough, bisection will be used to compute the next iterate. The bounds of the search interval are updated automatically to maintain a bracket around the root. If the sign of the residual is the same at both lower_bound and upper_bound, the solver aborts.

Definition at line 571 of file tuple_tensor_dual_functions.hpp.

◆ solve_upper_triangular()

template<typename T , int n, int... m>
constexpr SERAC_HOST_DEVICE auto serac::solve_upper_triangular ( const tensor< T, n, n > &  U,
const tensor< T, n, m... > &  y 
)
constexpr

Solves an upper triangular system Ux = y.

U must be upper triangular. This is not checked, so failure to obey this will produce meaningless results.

Parameters
[in]UAn upper triangular matrix
[in]yThe right hand side
Returns
x the solution vector

Definition at line 1520 of file tensor.hpp.

◆ squared_norm() [1/2]

template<typename T , int m>
constexpr SERAC_HOST_DEVICE auto serac::squared_norm ( const isotropic_tensor< T, m, m > &  I)
constexpr

compute the squared Frobenius norm (tr(dot(transpose(I), I))) of an isotropic tensor

Template Parameters
Tthe types stored in the isotropic tensor
mthe number of rows and columns in I
Parameters
Ithe isotropic tensor to compute the squared norm of

Definition at line 337 of file isotropic_tensor.hpp.

◆ squared_norm() [2/2]

template<typename T , int m>
constexpr SERAC_HOST_DEVICE auto serac::squared_norm ( const tensor< T, m > &  A)
constexpr

Returns the squared Frobenius norm of the tensor.

Parameters
[in]AThe tensor to obtain the squared norm from

Definition at line 1009 of file tensor.hpp.

◆ squish()

void serac::squish ( mfem::Mesh &  mesh)

a transformation from the unit disk/sphere (in L1 norm) to a unit disk/sphere (in L2 norm)

Parameters
meshThe mesh to transform

Definition at line 50 of file mesh_utils.cpp.

◆ sym() [1/2]

template<typename T , int m>
constexpr SERAC_HOST_DEVICE auto serac::sym ( const isotropic_tensor< T, m, m > &  I)
constexpr

return the symmetric part of an isotropic tensor

Template Parameters
Tthe types stored in the isotropic tensor
mthe number of rows and columns in I
Parameters
Ithe isotropic tensor to symmetrize
Returns
a copy of I (isotropic matrices are already symmetric)

Definition at line 243 of file isotropic_tensor.hpp.

◆ sym() [2/2]

template<typename T , int n>
constexpr SERAC_HOST_DEVICE auto serac::sym ( const tensor< T, n, n > &  A)
constexpr

Returns the symmetric part of a square matrix.

Parameters
[in]AThe matrix to obtain the symmetric part of
Returns
(1/2) * (A + A^T)

Definition at line 1088 of file tensor.hpp.

◆ SymmetricIdentity()

template<int m>
constexpr SERAC_HOST_DEVICE auto serac::SymmetricIdentity ( )
constexpr

a helper function for creating the rank-4 isotropic tensor defined by: d(sym(A)_{ij}) / d(A_{kl})

Template Parameters
mthe dimension

Definition at line 383 of file isotropic_tensor.hpp.

◆ tensor() [1/2]

template<typename T , int n1>
serac::tensor ( const T(&)  data[n1]) -> tensor< T, n1 >

class template argument deduction guide for type tensor.

Note
this lets users write
tensor A = {{0.0, 1.0, 2.0}};
tensor(const T(&data)[n1]) -> tensor< T, n1 >
class template argument deduction guide for type tensor.
instead of explicitly writing the template parameters
tensor< double, 3 > A = {{1.0, 2.0, 3.0}};

◆ tensor() [2/2]

template<typename T , int n1, int n2>
serac::tensor ( const T(&)  data[n1][n2]) -> tensor< T, n1, n2 >

class template argument deduction guide for type tensor.

Note
this lets users write
tensor A = {{{1.0, 2.0, 3.0}, {4.0, 5.0, 6.0}, {7.0, 8.0, 9.0}}};
instead of explicitly writing the template parameters
tensor< double, 3, 3 > A = {{{1.0, 2.0, 3.0}, {4.0, 5.0, 6.0}, {7.0, 8.0, 9.0}}};

◆ tensor_with_shape()

template<typename T , int... n>
constexpr SERAC_HOST_DEVICE auto serac::tensor_with_shape ( std::integer_sequence< int, n... >  )
constexpr

Creates a tensor given the dimensions in a std::integer_sequence.

See also
std::integer_sequence
Template Parameters
nThe parameter pack of integer dimensions

Definition at line 283 of file tensor.hpp.

◆ tr() [1/2]

template<typename T , int m>
constexpr SERAC_HOST_DEVICE auto serac::tr ( const isotropic_tensor< T, m, m > &  I)
constexpr

calculate the trace of an isotropic tensor

Template Parameters
Tthe types stored in the isotropic tensor
mthe number of rows and columns in I
Parameters
Ithe isotropic tensor to compute the trace of
Returns
the sum of the diagonal entries of I

Definition at line 270 of file isotropic_tensor.hpp.

◆ tr() [2/2]

template<typename T , int n>
constexpr SERAC_HOST_DEVICE auto serac::tr ( const tensor< T, n, n > &  A)
constexpr

Returns the trace of a square matrix.

Parameters
[in]AThe matrix to compute the trace of
Returns
The sum of the elements on the main diagonal

Definition at line 1073 of file tensor.hpp.

◆ transpose() [1/2]

template<typename T , int m>
constexpr SERAC_HOST_DEVICE auto serac::transpose ( const isotropic_tensor< T, m, m > &  I)
constexpr

return the transpose of an isotropic tensor

Template Parameters
Tthe types stored in the isotropic tensor
mthe number of rows and columns in I
Parameters
Ithe isotropic tensor to compute the trace of
Returns
a copy of I (isotropic matrices are symmetric)

Definition at line 284 of file isotropic_tensor.hpp.

◆ transpose() [2/2]

template<typename T , int m, int n>
constexpr SERAC_HOST_DEVICE auto serac::transpose ( const tensor< T, m, n > &  A)
constexpr

Returns the transpose of the matrix.

Parameters
[in]AThe matrix to obtain the transpose of

Definition at line 1199 of file tensor.hpp.

◆ tuple()

template<typename... T>
serac::tuple ( T...  ) -> tuple< T... >

Class template argument deduction rule for tuples.

Template Parameters
TThe variadic template parameter for tuple types

◆ type()

template<int i, typename... T>
constexpr SERAC_HOST_DEVICE auto serac::type ( const tuple< T... > &  values)
constexpr

a function intended to be used for extracting the ith type from a tuple.

Note
type<i>(my_tuple) returns a value, whereas get<i>(my_tuple) returns a reference
Template Parameters
ithe index of the tuple to query
Tthe types stored in the tuple
Parameters
valuesthe tuple of values
Returns
a copy of the ith entry of the input

Definition at line 274 of file tuple.hpp.

◆ unary_minus_helper()

template<typename... T, int... i>
constexpr SERAC_HOST_DEVICE auto serac::unary_minus_helper ( const tuple< T... > &  x,
std::integer_sequence< int, i... >   
)
constexpr

A helper function for the - operator of tuples.

Template Parameters
Tthe types stored in the tuple y
iThe integer sequence to i
Parameters
xtuple of values
Returns
the returned tuple difference

Definition at line 428 of file tuple.hpp.

◆ uniaxial_stress_test()

template<typename MaterialType , typename StateType , typename... parameter_types>
auto serac::uniaxial_stress_test ( double  t_max,
size_t  num_steps,
const MaterialType  material,
const StateType  initial_state,
std::function< double(double)>  epsilon_xx,
const parameter_types...  parameter_functions 
)

Drive the material model thorugh a uniaxial tension experiment.

Drives material model through specified axial displacement gradient history. The time elaspses from 0 up to t_max. Currently only implemented for isotropic materials (or orthotropic materials with the principal axes aligned with the coordinate directions).

Parameters
t_maxupper limit of the time interval.
num_stepsThe number of discrete time points at which the response is sampled (uniformly spaced). This is inclusive of the point at time zero.
materialThe material model to use
initial_stateThe state variable collection for this material, set to the desired initial condition.
epsilon_xxA function describing the desired axial displacement gradient as a function of time. (NB axial displacement gradient is equivalent to engineering strain).
parameter_functionsPack of functions that return each parameter as a function of time. Leave empty if the material has no parameters.

Definition at line 42 of file material_verification_tools.hpp.

◆ version()

std::string serac::version ( bool  add_SHA = true)

Returns a string for the version of Serac.

Parameters
[in]add_SHAboolean for whether to add the Git SHA to the version if available
Returns
string value of the version of Serac

Definition at line 211 of file about.cpp.

◆ visit()

template<typename Visitor , typename Variant >
constexpr decltype(auto) serac::visit ( Visitor  visitor,
Variant &&  v 
)
constexpr

Applies a functor to the active variant element.

Parameters
[in]visitorThe functor to apply
[in]vThe variant to apply the functor to
See also
std::visit

Definition at line 365 of file variant.hpp.

Variable Documentation

◆ NoQData

std::shared_ptr< QuadratureData< Nothing > > serac::NoQData

a single instance of a QuadratureData container of Nothings, since they are all interchangeable

these values exist to serve as default arguments for materials without material state

Definition at line 18 of file quadrature_data.cpp.