Serac
0.1
Serac is an implicit thermal strucural mechanics simulation code.
|
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 i th 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::ostream s | |
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 zero s 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 zero s 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 zero s 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 zero & | get (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 n th 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 Nothing s, since they are all interchangeable More... | |
std::shared_ptr< QuadratureData< Empty > > | EmptyQData |
a single instance of a QuadratureData container of Empty s, 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. | |
Accelerator functionality.
The Serac namespace
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.
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
T1 | the first argument to the outer product |
T2 | the second argument to the outer product |
Definition at line 1741 of file tensor.hpp.
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>
T | The scalar type of the tensor |
n1 | The first dimension |
n2 | The second dimension |
Definition at line 273 of file tensor.hpp.
|
strong |
Solver types supported by AMGX.
Definition at line 128 of file solver_config.hpp.
|
strong |
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.
|
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.
|
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.
|
strong |
this enum describes which way to enforce the time-varying constraint u(t) == U(t)
Definition at line 59 of file solver_config.hpp.
|
strong |
The type of a finite element basis function.
Definition at line 33 of file finite_element_vector.hpp.
|
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.
|
strong |
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.
|
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.
|
strong |
Nonlinear solver method indicator.
Definition at line 115 of file solver_config.hpp.
|
strong |
The type of preconditioner to be used.
Definition at line 166 of file solver_config.hpp.
|
strong |
Timestep method of a solver.
Definition at line 24 of file solver_config.hpp.
std::string serac::about | ( | ) |
SERAC_HOST_DEVICE auto serac::abs | ( | dual< gradient_type > | x | ) |
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.
trial_fes | the trial finite element space |
test_fes | the 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.
|
constexpr |
return the antisymmetric part of an isotropic tensor
T | the types stored in the isotropic tensor |
m | the number of rows and columns in I |
zero
(isotropic matrices are symmetric, so the antisymmetric part is identically zero) Definition at line 256 of file isotropic_tensor.hpp.
|
constexpr |
Returns the antisymmetric part of a square matrix.
[in] | A | The matrix to obtain the antisymmetric part of |
Definition at line 1105 of file tensor.hpp.
|
constexpr |
a helper function for creating the rank-4 isotropic tensor defined by: d(antisym(A)_{ij}) / d(A_{kl})
m | the dimension |
Definition at line 394 of file isotropic_tensor.hpp.
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
lambda | a callable type |
T | the types of arguments to be passed in to f |
f | the callable object |
args | a tuple of arguments |
e.g. foo(bar, baz) is equivalent to apply(foo, serac::tuple(bar,baz));
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
lambda | a callable type |
T | the types of arguments to be passed in to f |
f | the callable object |
args | a tuple of arguments |
e.g. foo(bar, baz) is equivalent to apply(foo, serac::tuple(bar,baz));
SERAC_HOST_DEVICE auto serac::apply_helper | ( | lambda | f, |
const tuple< T... > & | args, | ||
std::integer_sequence< int, i... > | |||
) |
SERAC_HOST_DEVICE auto serac::apply_helper | ( | lambda | f, |
tuple< T... > & | args, | ||
std::integer_sequence< int, i... > | |||
) |
double serac::avg | ( | const FiniteElementVector & | fe_vector | ) |
Find the average value of a finite element vector across all dofs.
fe_vector | The state variable to compute the average of |
Definition at line 89 of file finite_element_vector.cpp.
SERAC_HOST_DEVICE tensor<T, n> serac::Bernstein | ( | T | s | ) |
Bernstein Polynomials on the domain [0, 1].
n | how many entries to compute |
[in] | s | where to evaluate the polynomials |
Definition at line 467 of file polynomials.hpp.
serac::binary_comparator_overload | ( | ) |
implement operator< for dual numbers
implement operator> for dual numbers
implement operator== for dual numbers
|
inline |
count the number of boundary elements of each geometry in a mesh
mesh | the mesh to count |
Definition at line 83 of file geometry.hpp.
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.
radial_divisions | number of elements in the radial direction |
angular_divisions | number of elements in the theta direction |
vertical_divisions | number of elements in the z-direction |
inner_radius | the radius of the inner wall of the cylinder |
outer_radius | the radius of the outer wall of the cylinder |
height | the height of the top surface of the cylinder |
Definition at line 358 of file mesh_utils.cpp.
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
[in] | approx_number_of_elements | Approximate number of elements |
Definition at line 107 of file mesh_utils.cpp.
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.
[in] | elements_in_x | the number of elements in the x-direction |
[in] | elements_in_y | the number of elements in the y-direction |
[in] | elements_in_z | the number of elements in the z-direction |
[in] | size_x | Overall size in the x-direction |
[in] | size_y | Overall size in the y-direction |
[in] | size_z | Overall size in the z-direction |
Definition at line 149 of file mesh_utils.cpp.
mfem::Mesh serac::buildCylinderMesh | ( | int | radial_refinement, |
int | elements_lengthwise, | ||
double | radius, | ||
double | height | ||
) |
Constructs a 3D MFEM mesh of a cylinder.
[in] | radial_refinement | the number of times to apply uniform mesh refinement to the cross section |
[in] | elements_lengthwise | the number of elements in the z-direction |
[in] | radius | the radius of the cylinder |
[in] | height | the number of elements in the z-direction |
Definition at line 156 of file mesh_utils.cpp.
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
[in] | approx_number_of_elements | The appoximate number of elements |
Definition at line 74 of file mesh_utils.cpp.
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.
[in] | radial_refinement | the number of times to apply uniform mesh refinement to the cross section |
[in] | elements_lengthwise | the number of elements in the z-direction |
[in] | inner_radius | inner radius the radius of the cylindrical shell |
[in] | outer_radius | ouer radius the radius of the cylindrical shell |
[in] | height | the number of elements in the z-direction |
[in] | total_angle | the angle in radians over which to generate the portion of an extruded cylinder |
[in] | sectors | the number of starting sectors in the hollow cylinder |
Definition at line 350 of file mesh_utils.cpp.
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.
linear_opts | The options to configure the linear solver and preconditioner |
comm | The MPI communicator for the supplied HypreParMatrix and HypreParVectors |
Definition at line 205 of file equation_solver.cpp.
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.
[in] | mesh_file | The mesh file to open |
Definition at line 19 of file mesh_utils.cpp.
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.
block_operator | The block system of HypreParMatrices |
Definition at line 72 of file equation_solver.cpp.
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.
nonlinear_opts | The options to configure the nonlinear solution scheme |
comm | The MPI communicator for the supplied nonlinear operators and HypreParVectors |
Definition at line 156 of file equation_solver.cpp.
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.
preconditioner | The preconditioner type to be built |
print_level | The print level for the constructed preconditioner |
comm | The communicator for the underlying operator and HypreParVectors |
Definition at line 305 of file equation_solver.cpp.
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.
[in] | elements_in_x | the number of elements in the x-direction |
[in] | elements_in_y | the number of elements in the y-direction |
[in] | size_x | Overall size in the x-direction |
[in] | size_y | Overall size in the y-direction |
Definition at line 144 of file mesh_utils.cpp.
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.
[in] | radial_refinement | the number of times to apply uniform mesh refinement to the cross section |
[in] | inner_radius | inner radius the radius of the cylindrical shell |
[in] | outer_radius | ouer radius the radius of the cylindrical shell |
[in] | total_angle | the angle in radians over which to generate the portion of an extruded cylinder |
[in] | sectors | the number of starting sectors in the hollow cylinder |
Definition at line 344 of file mesh_utils.cpp.
|
constexpr |
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 1789 of file tensor.hpp.
|
constexpr |
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 1780 of file tensor.hpp.
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.
Definition at line 1832 of file tensor.hpp.
|
constexpr |
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 1818 of file tensor.hpp.
|
constexpr |
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 1796 of file tensor.hpp.
|
constexpr |
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 1806 of file tensor.hpp.
|
constexpr |
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 1770 of file tensor.hpp.
|
constexpr |
Chebyshev polynomials of the first kind Satisfying: T_n(cos(t)) == cos(n*t)
n | how many entries to compute |
[in] | x | where to evaluate the polynomials |
Definition at line 407 of file polynomials.hpp.
SERAC_HOST_DEVICE tensor<T, n> serac::ChebyshevU | ( | T | x | ) |
Chebyshev polynomials of the second kind Satisfying: sin(t) U_n(cos(t)) == sin((n+1)*t)
n | how many entries to compute |
[in] | x | where to evaluate the polynomials |
Definition at line 428 of file polynomials.hpp.
|
constexpr |
replace all entries in a tensor satisfying |x| < 1.0e-10 by literal zero
[in] | A | The tensor to "chop" |
Definition at line 1670 of file tensor.hpp.
|
inline |
attempt to characterize which FiniteElementSpaces mfem::FaceRestriction actually works with
fes | the finite element space in question |
Definition at line 109 of file dof_numbering.hpp.
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")
Q | a parameter controlling the number of quadrature points an element |
function_space | the polynomial order and kind of function space used to interpolate |
geom | the element geometry |
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.
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.
state | The numerical solution |
exact_solution | The exact solution to measure error against |
state
and exact_solution
Definition at line 104 of file finite_element_state.cpp.
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.
state | The numerical solution |
exact_solution | The exact solution to measure error against |
state
and exact_solution
Definition at line 99 of file finite_element_state.cpp.
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:
i1 | the index of contraction for the left operand |
i2 | the index of contraction for the right operand |
S | the datatype stored in the left operand |
m | leading dimension of the left operand |
n | the trailing dimensions of the left operand |
T | the datatype stored in the right operand |
p | the number of rows in the right operand |
q | the number of columns in the right operand |
A | the left operand |
B | the right operand |
Definition at line 1317 of file tensor.hpp.
|
inline |
mfem will frequently encode {sign, index} into a single int32_t. This function decodes those values.
i | an integer that mfem has encoded to contain two separate pieces of information |
Definition at line 78 of file dof_numbering.hpp.
void serac::defineInputFileSchema | ( | axom::inlet::Inlet & | inlet | ) |
|
constexpr |
Obtains the identity matrix of the specified dimension.
Definition at line 1183 of file tensor.hpp.
|
constexpr |
compute the determinant of an isotropic tensor
T | the types stored in the isotropic tensor |
m | the number of rows and columns in I |
I | the isotropic tensor to compute the determinant of |
Definition at line 311 of file isotropic_tensor.hpp.
|
constexpr |
Returns the determinant of a matrix.
[in] | A | The matrix to obtain the determinant of |
Definition at line 1215 of file tensor.hpp.
|
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.
A | Input matrix |
Definition at line 1238 of file tensor.hpp.
|
constexpr |
Calculates the deviator of a matrix (rank-2 tensor)
[in] | A | The 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.
|
constexpr |
Returns a square diagonal matrix by specifying the diagonal entries.
[in] | d | a list of diagonal entries |
Definition at line 1155 of file tensor.hpp.
|
constexpr |
Returns an array containing the diagonal entries of a square matrix.
[in] | D | the matrix to extract the diagonal entries from |
Definition at line 1169 of file tensor.hpp.
|
constexpr |
Returns a square matrix (rank-2 tensor) containing the diagonal entries of the input square matrix with zeros in the off-diagonal positions.
[in] | A | The 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.
|
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:
Definition at line 42 of file differentiate_wrt.hpp.
|
constexpr |
a function for querying the ith dimension of a tensor
i | which dimension to query |
T | the datatype stored in the tensor |
n | the tensor extents |
Definition at line 1874 of file tensor.hpp.
|
constexpr |
Returns the dimension of an element geometry.
[in] | g | The Geometry to retrieve the dimension of |
Definition at line 49 of file geometry.hpp.
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
dot product between an isotropic and (nonisotropic) tensor
S | the types stored in isotropic tensor |
T | the types stored in tensor |
m | the number of rows and columns in I |
n | the trailing dimensions of A |
I | the left operand |
A | the (full) right operand |
Definition at line 203 of file isotropic_tensor.hpp.
|
constexpr |
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 746 of file tensor.hpp.
|
constexpr |
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 760 of file tensor.hpp.
|
constexpr |
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 776 of file tensor.hpp.
|
constexpr |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
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.
|
constexpr |
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 876 of file tensor.hpp.
|
constexpr |
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 810 of file tensor.hpp.
|
constexpr |
this function contracts over the "middle" index of the two tensor arguments
S | the underlying type of the tensor (lefthand) argument |
T | the underlying type of the tensor (righthand) argument |
n | integers describing the tensor shape |
[in] | A | The lefthand tensor |
[in] | B | The righthand tensor |
Definition at line 708 of file tensor.hpp.
|
constexpr |
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 842 of file tensor.hpp.
|
constexpr |
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 826 of file tensor.hpp.
|
constexpr |
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 858 of file tensor.hpp.
|
constexpr |
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 726 of file tensor.hpp.
|
constexpr |
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 736 of file tensor.hpp.
|
constexpr |
double-dot product between an isotropic and (nonisotropic) tensor
S | the types stored in isotropic tensor |
T | the types stored in tensor |
m | the number of rows and columns in I, A |
I | the left operand |
A | the (full) right operand |
Definition at line 229 of file isotropic_tensor.hpp.
|
constexpr |
double-dot product between an isotropic and (nonisotropic) tensor
S | the types stored in isotropic tensor |
T | the types stored in tensor |
m | the dimension of each extent of I |
I | the left operand |
A | the (full) right operand |
Definition at line 466 of file isotropic_tensor.hpp.
|
constexpr |
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 984 of file tensor.hpp.
|
constexpr |
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 966 of file tensor.hpp.
|
constexpr |
double dot product, contracting over the two "middle" indices
S | the underlying type of the tensor (lefthand) argument |
T | the underlying type of the tensor (righthand) argument |
m | first dimension of A |
n | second dimension of A |
p | third dimension of A, first dimensions of B |
q | fourth dimension of A, second dimensions of B |
[in] | A | The lefthand tensor |
[in] | B | The righthand tensor |
Definition at line 946 of file tensor.hpp.
serac::dual | ( | double | , |
T | |||
) | -> dual< T > |
class template argument deduction guide for type dual
.
auto serac::eigenvalues | ( | const serac::tensor< T, size, size > & | A | ) |
compute the eigenvalues of a symmetric matrix A
T | either double or a serac::dual type |
size | the dimensions of the matrix |
A | the matrix |
Definition at line 722 of file tuple_tensor_dual_functions.hpp.
|
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)
g | the element geometry |
q | the number of quadrature points per dimension |
Definition at line 141 of file finite_element.hpp.
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.
[in] | error | True if the program should return an error code |
Definition at line 44 of file terminator.cpp.
|
constexpr |
|
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.
[in] | A | The matrix to factorize |
Definition at line 359 of file tuple_tensor_dual_functions.hpp.
serac::FilterView | ( | Iter | , |
Iter | , | ||
Pred && | |||
) | -> FilterView< Iter, Pred > |
Deduction guide - iterator and lambda types must be deduced, so this mitigates a "builder" function.
Iter | Iterator for the view |
Pred | Predicate for the view |
auto serac::find_root | ( | function && | f, |
tensor< double, n > | x0 | ||
) |
Finds a root of a vector-valued nonlinear function.
Uses Newton-Raphson iteration.
function | Type for the functor object |
n | Vector dimension of the equation |
f | A callable representing the function of which a root is sought. Must take an n-vector argument and return an n-vector |
x0 | Initial guess for root. Must be an n-vector. |
f
. Definition at line 692 of file tuple_tensor_dual_functions.hpp.
std::vector<tensor<double, d> > serac::gather | ( | const mfem::Vector & | coordinates, |
mfem::Array< int > | ids | ||
) |
gather vertex coordinates for a list of vertices
coordinates | mfem's 1D list of vertex coordinates |
ids | the list of vertex indices to gather |
Definition at line 39 of file domain.cpp.
|
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.
n | how many entries to compute |
[in] | x | where to evaluate the polynomials |
Definition at line 558 of file polynomials.hpp.
|
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} ]
n | how many entries to compute |
[in] | x | where to evaluate the polynomials |
Definition at line 595 of file polynomials.hpp.
|
constexpr |
The positions of Gauss-Legendre points for different geometries.
n | The 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.
|
constexpr |
The weights associated with each Gauss-Legendre point.
n | The 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.
|
constexpr |
Lagrange Interpolating polynomials for nodes at Gauss-Lobatto points on the interval [0, 1].
n | how many entries to compute |
[in] | x | where to evaluate the polynomials |
Definition at line 494 of file polynomials.hpp.
|
constexpr |
Derivatives of the Lagrange Interpolating polynomials for nodes at Gauss-Lobatto points on the interval [0, 1].
n | how many entries to compute |
[in] | x | where to evaluate the polynomials |
Definition at line 521 of file polynomials.hpp.
|
constexpr |
The positions (in 1D space) of Gauss-Lobatto points.
n | The number of points |
[in] | a | The left endpoint of the interval |
[in] | b | The right endpoint of the interval |
Definition at line 28 of file polynomials.hpp.
|
constexpr |
Returns the Gauss-Legendre quadrature rule for an element and order.
The | shape of the element to produce a quadrature rule for |
Q | the number of quadrature points per dimension |
Definition at line 45 of file quadrature.hpp.
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
geom | the element geometry |
Q | a parameter that controls the number of quadrature points |
test | the kind of test functions used in the integral |
trials | the trial space(s) of the integral's inputs |
lambda_type | a callable object that implements the q-function concept |
s | an object used to pass around test/trial information |
integral | the Integral object to initialize |
qf | the quadrature function |
Definition at line 276 of file integral.hpp.
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
geom | the element geometry |
Q | a parameter that controls the number of quadrature points |
test | the kind of test functions used in the integral |
trials | the trial space(s) of the integral's inputs |
lambda_type | a callable object that implements the q-function concept |
qpt_data_type | any quadrature point data needed by the material model |
s | an object used to pass around test/trial information |
integral | the Integral object to initialize |
qf | the quadrature function |
qdata | the values of any quadrature point data for the material |
Definition at line 186 of file integral.hpp.
|
inline |
create an mfem::ParFiniteElementSpace from one of serac's tag types: H1, Hcurl, L2
function_space | a tag type containing the kind of function space and polynomial order |
mesh | the mesh on which the space is defined |
Definition at line 103 of file functional.hpp.
|
inline |
count the number of elements of each geometry in a mesh
mesh | the mesh to count |
Definition at line 70 of file geometry.hpp.
|
constexpr |
|
constexpr |
|
constexpr |
Returns the variant member of specified type.
Returns the variant member at the provided index.
T | The type of the element to retrieve |
T0 | The first member type of the variant |
T1 | The second member type of the variant |
[in] | v | The variant to return the element of |
T0
or T1
Definition at line 338 of file variant.hpp.
|
constexpr |
get the gradient of type tensor
(note: since its stored type is not a dual number, the derivative term is identically zero)
Definition at line 1755 of file tensor.hpp.
|
constexpr |
Retrieves a gradient tensor from a tensor of dual numbers.
[in] | arg | The tensor of dual numbers |
Definition at line 506 of file tuple_tensor_dual_functions.hpp.
|
inline |
Retrieves the gradient component of a double (which is nothing)
Definition at line 1747 of file tensor.hpp.
SERAC_HOST_DEVICE auto serac::get_gradient | ( | dual< serac::tuple< T... >> | arg | ) |
Retrieves the gradient components of a set of dual numbers.
[in] | arg | The set of numbers to retrieve gradients from |
Definition at line 310 of file tuple_tensor_dual_functions.hpp.
T* serac::get_if | ( | variant< T0, T1 > * | v | ) |
Returns the member of requested type if it's active, otherwise nullptr
.
T | The type to check for |
[in] | v | The variant to check/retrieve from |
Definition at line 398 of file variant.hpp.
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.
[in] | tuple_of_values | The tuple of numbers to retrieve values from |
dual
numbers or doubles Definition at line 299 of file tuple_tensor_dual_functions.hpp.
SERAC_HOST_DEVICE auto serac::get_value | ( | const tensor< dual< T >, n... > & | arg | ) |
Retrieves a value tensor from a tensor of dual numbers.
[in] | arg | The tensor of dual numbers |
Definition at line 494 of file tuple_tensor_dual_functions.hpp.
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.
T1 | the first type of the tuple stored in the tensor |
T2 | the second type of the tuple stored in the tensor |
n | the number of entries in the input argument |
[in] | input | The tensor of dual numbers |
Definition at line 284 of file tuple_tensor_dual_functions.hpp.
std::pair< int, int > serac::getMPIInfo | ( | MPI_Comm | comm = MPI_COMM_WORLD | ) |
Returns the number of processes and rank for an MPI communicator.
comm | The MPI communicator to initialize with |
Definition at line 26 of file initialize.cpp.
std::string serac::gitSHA | ( | ) |
bool serac::holds_alternative | ( | const variant< T0, T1 > & | v | ) |
Checks whether a variant's active member is of a certain type.
T | The type to check for |
[in] | v | The variant to check |
Definition at line 381 of file variant.hpp.
|
constexpr |
return the identity matrix of the specified size
m | the number of rows and columns |
Definition at line 61 of file isotropic_tensor.hpp.
|
constexpr |
given a list of types, this function returns the index that corresponds to the type dual_vector
.
T | a list of types, containing at most 1 differentiate_wrt_this |
e.g.
Definition at line 49 of file functional.hpp.
std::pair< int, int > serac::initialize | ( | int | argc, |
char * | argv[], | ||
MPI_Comm | comm = MPI_COMM_WORLD |
||
) |
Initializes MPI, signal handling, and logging.
argc | The number of command-line arguments |
argv | The command-line arguments, as C-strings |
comm | The MPI communicator to initialize with |
Definition at line 40 of file initialize.cpp.
|
constexpr |
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 684 of file tensor.hpp.
|
constexpr |
this function contracts over all indices of the two tensor arguments
S | the underlying type of the tensor (lefthand) argument |
T | the underlying type of the tensor (righthand) argument |
m | the number of rows |
n | the number of columns |
[in] | A | The lefthand tensor |
[in] | B | The righthand tensor |
Definition at line 668 of file tensor.hpp.
|
constexpr |
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 697 of file tensor.hpp.
double serac::innerProduct | ( | const FiniteElementVector & | vec1, |
const FiniteElementVector & | vec2 | ||
) |
Find the inner prodcut between two finite element vectors across all dofs.
vec1 | The first vector |
vec2 | The second vector |
Definition at line 132 of file finite_element_vector.cpp.
|
constexpr |
return the inverse of an isotropic tensor
T | the types stored in the isotropic tensor |
m | the number of rows and columns in I |
I | the isotropic tensor to compute the inverse of |
Definition at line 298 of file isotropic_tensor.hpp.
|
constexpr |
Inverts a matrix.
[in] | A | The matrix to invert |
Definition at line 1564 of file tensor.hpp.
|
constexpr |
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 1582 of file tensor.hpp.
|
constexpr |
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 1606 of file tensor.hpp.
|
constexpr |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
TODO: compare performance of this hardcoded implementation to just using inv() directly
Definition at line 474 of file tuple_tensor_dual_functions.hpp.
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.
n | The height of the tensor |
A | The square rank 2 tensor |
tolerance | The tolerance to check for symmetry |
Definition at line 1404 of file tensor.hpp.
|
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.
A | The matrix to test for positive definiteness |
Definition at line 1424 of file tensor.hpp.
|
inline |
return whether or not the underlying function space is Hcurl or not
fes | the finite element space in question |
Definition at line 88 of file dof_numbering.hpp.
|
inline |
return whether or not the underlying function space is L2 or not
fes | the finite element space in question |
Definition at line 98 of file dof_numbering.hpp.
|
constexpr |
a function for querying the first dimension of a tensor
T | the datatype stored in the tensor |
m | the first dimension of the tensor |
n | the trailing dimensions of the tensor |
Definition at line 1889 of file tensor.hpp.
SERAC_HOST_DEVICE tensor<T, n> serac::Legendre | ( | T | x | ) |
Legendre Polynomials, orthogonal on the domain (-1, 1) with unit weight function.
n | how many entries to compute |
[in] | x | where to evaluate the polynomials |
Definition at line 448 of file polynomials.hpp.
|
constexpr |
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 1538 of file tensor.hpp.
|
constexpr |
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 1554 of file tensor.hpp.
|
constexpr |
Solves Ax = b for x using Gaussian elimination with partial pivoting.
[in] | A | The coefficient matrix A |
[in] | b | The righthand side vector b |
Definition at line 420 of file tuple_tensor_dual_functions.hpp.
|
constexpr |
Constructs a tensor of dual numbers from a tensor of values.
[in] | A | The tensor of values |
Definition at line 339 of file tuple_tensor_dual_functions.hpp.
|
constexpr |
Promote a tuple of values to their corresponding dual types.
T0 | the first type of the tuple argument |
T1 | the first type of the tuple argument |
args | the values to be promoted |
example:
Definition at line 183 of file tuple_tensor_dual_functions.hpp.
|
constexpr |
promote a tensor value to dual number with a one_hot_t< i, N, tensor > gradient type
i | the index where the non-serac::zero derivative term appears |
N | how many entries in the gradient type |
arg | the value to be promoted |
Definition at line 154 of file tuple_tensor_dual_functions.hpp.
|
constexpr |
promote a double value to dual number with a one_hot_t< i, N, double > gradient type
i | the index where the non-serac::zero derivative term appears |
N | how many entries in the gradient type |
arg | the value to be promoted |
Definition at line 137 of file tuple_tensor_dual_functions.hpp.
|
constexpr |
take a tuple of values, and promote the n
th one to a one-hot dual number of the appropriate type
n | the index of the tuple argument to be made into a dual number |
T | the types of the values in the tuple |
args | the values to be promoted |
Definition at line 269 of file tuple_tensor_dual_functions.hpp.
|
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.
lambda_type | The type of the functor |
[in] | f | The functor to generate the tensor values from |
auto
parameters. Definition at line 300 of file tensor.hpp.
|
constexpr |
Creates a tensor of requested dimension by subsequent calls to a functor.
n1 | The dimension of the tensor |
lambda_type | The type of the functor |
[in] | f | The functor to generate the tensor values from |
n1
arguments of type int
auto
parameters. Definition at line 319 of file tensor.hpp.
|
constexpr |
Creates a tensor of requested dimension by subsequent calls to a functor.
n1 | The first dimension of the tensor |
n2 | The second dimension of the tensor |
lambda_type | The type of the functor |
[in] | f | The functor to generate the tensor values from |
n1
x n2
arguments of type int
auto
parameters. Definition at line 343 of file tensor.hpp.
|
constexpr |
Creates a tensor of requested dimension by subsequent calls to a functor.
n1 | The first dimension of the tensor |
n2 | The second dimension of the tensor |
n3 | The third dimension of the tensor |
lambda_type | The type of the functor |
[in] | f | The functor to generate the tensor values from |
n1
x n2
x n3
arguments of type int
auto
parameters. Definition at line 370 of file tensor.hpp.
|
constexpr |
Creates a tensor of requested dimension by subsequent calls to a functor.
n1 | The first dimension of the tensor |
n2 | The second dimension of the tensor |
n3 | The third dimension of the tensor |
n4 | The fourth dimension of the tensor |
lambda_type | The type of the functor |
[in] | f | The functor to generate the tensor values from |
n1
x n2
x n3
x n4
arguments of type int
auto
parameters. Definition at line 400 of file tensor.hpp.
SERAC_HOST_DEVICE tuple<T...> serac::make_tuple | ( | const T &... | args | ) |
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
s | a function signature type containing test/trial space informationa type containing a function signature |
Q | a parameter that controls the number of quadrature points |
dim | the dimension of the domain |
lambda_type | a callable object that implements the q-function concept |
domain | the domain of integration |
qf | the quadrature function |
argument_indices | the indices of trial space arguments used in the Integral |
Definition at line 328 of file integral.hpp.
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
s | a function signature type containing test/trial space informationa type containing a function signature |
Q | a parameter that controls the number of quadrature points |
dim | the dimension of the domain |
lambda_type | a callable object that implements the q-function concept |
qpt_data_type | any quadrature point data needed by the material model |
domain | the domain of integration |
qf | the quadrature function |
qdata | the values of any quadrature point data for the material |
argument_indices | the indices of trial space arguments used in the Integral |
Definition at line 239 of file integral.hpp.
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)
T | the data type stored in each element of the matrix |
A | the matrix to compute the square root of |
dot(B, B) == A
Definition at line 1278 of file tensor.hpp.
double serac::max | ( | const FiniteElementVector & | fe_vector | ) |
Find the max value of a finite element vector across all dofs.
fe_vector | The state variable to compute a max of |
Definition at line 100 of file finite_element_vector.cpp.
SERAC_HOST_DEVICE auto serac::max | ( | dual< gradient_type > | a, |
double | b | ||
) |
double serac::min | ( | const FiniteElementVector & | fe_vector | ) |
Find the min value of a finite element vector across all dofs.
fe_vector | The state variable to compute a min of |
Definition at line 108 of file finite_element_vector.cpp.
SERAC_HOST_DEVICE auto serac::min | ( | dual< gradient_type > | a, |
double | b | ||
) |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
double serac::norm | ( | const FiniteElementState & | state, |
const double | p = 2 |
||
) |
Find the Lp norm of a finite element state across all dofs.
state | The state variable to compute a norm of |
p | The order norm to compute |
Definition at line 86 of file finite_element_state.cpp.
|
constexpr |
compute the Frobenius norm (sqrt(tr(dot(transpose(I), I)))) of an isotropic tensor
T | the types stored in the isotropic tensor |
m | the number of rows and columns in I |
I | the isotropic tensor to compute the norm of |
Definition at line 324 of file isotropic_tensor.hpp.
SERAC_HOST_DEVICE auto serac::norm | ( | const tensor< T, n... > & | A | ) |
Returns the Frobenius norm of the tensor.
[in] | A | The tensor to obtain the norm from |
Definition at line 1045 of file tensor.hpp.
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,.
[in] | A | The tensor to normalize |
Definition at line 1062 of file tensor.hpp.
|
constexpr |
return the number of quadrature points in a Gauss-Legendre rule with parameter "Q"
g | the element geometry |
Q | the number of quadrature points per dimension |
Definition at line 25 of file geometry.hpp.
operator determining inequality by {global_row, global_col}
Definition at line 50 of file dof_numbering.hpp.
|
constexpr |
|
constexpr |
multiply a tensor by a scalar value
S | the scalar value type. Must be arithmetic (e.g. float, double, int) or a dual number |
T | the underlying type of the tensor (righthand) argument |
n | integers describing the tensor shape |
[in] | A | The tensor to be scaled |
[in] | scale | The scaling factor |
Definition at line 52 of file tuple_tensor_dual_functions.hpp.
|
constexpr |
|
constexpr |
|
constexpr |
multiply a tensor by a scalar value
S | the scalar value type. Must be arithmetic (e.g. float, double, int) or a dual number |
T | the underlying type of the tensor (righthand) argument |
n | integers describing the tensor shape |
[in] | scale | The scaling factor |
[in] | A | The tensor to be scaled |
Definition at line 33 of file tuple_tensor_dual_functions.hpp.
|
constexpr |
scalar multiplication
S | the type of the left operand, scale |
T | the type of the isotropic tensor |
m | the number of rows and columns in the isotropic tensor |
scale | the value that multiplies each entry of I (from the left) |
I | the isotropic tensor being scaled |
Definition at line 77 of file isotropic_tensor.hpp.
|
constexpr |
scalar multiplication
S | the type of the left operand, scale |
T | the type of the isotropic tensor |
m | the dimension of each rank-4 isotropic tensor |
scale | the value that multiplies each entry of I (from the left) |
I | the isotropic tensor being scaled |
Definition at line 410 of file isotropic_tensor.hpp.
|
constexpr |
sum of isotropic and (nonisotropic) tensor
S | the type of the left isotropic tensor |
T | the type of the right tensor |
m | the number of rows and columns in each tensor |
I | the left operand |
A | the (full) right operand |
Definition at line 132 of file isotropic_tensor.hpp.
|
constexpr |
return the sum of two tensors
S | the underlying type of the lefthand argument |
T | the underlying type of the righthand argument |
n | integers describing the tensor shape |
[in] | A | The lefthand operand |
[in] | B | The righthand operand |
Definition at line 425 of file tensor.hpp.
|
constexpr |
|
constexpr |
addition of isotropic tensors
S | the type of the left isotropic tensor |
T | the type of the right isotropic tensor |
m | the number of rows and columns in each isotropic tensor |
I1 | the left operand |
I2 | the right operand |
Definition at line 100 of file isotropic_tensor.hpp.
|
constexpr |
addition of isotropic tensors
S | the type of the left isotropic tensor |
T | the type of the right isotropic tensor |
m | the dimension of each rank-4 isotropic tensor |
I1 | the left operand |
I2 | the right operand |
Definition at line 433 of file isotropic_tensor.hpp.
|
constexpr |
compound assignment (+) on tensors
S | the underlying type of the tensor (lefthand) argument |
T | the underlying type of the tensor (righthand) argument |
n | integers describing the tensor shape |
[in] | A | The lefthand tensor |
[in] | B | The righthand tensor |
Definition at line 477 of file tensor.hpp.
|
constexpr |
compound assignment (+) on tensors
T | the underlying type of the tensor argument |
[in] | A | The lefthand tensor |
[in] | B | The righthand tensor |
Definition at line 536 of file tensor.hpp.
|
constexpr |
compound assignment (+) on tensors
T | the underlying type of the tensor argument |
[in] | A | The lefthand tensor |
[in] | B | The righthand tensor |
Definition at line 548 of file tensor.hpp.
|
constexpr |
compound assignment (+) on tensors
T | the underlying type of the tensor argument |
[in] | A | The lefthand tensor |
[in] | B | The righthand tensor |
Definition at line 521 of file tensor.hpp.
|
constexpr |
compound assignment (+) on tensors
T | the underlying type of the tensor argument |
[in] | A | The lefthand tensor |
[in] | B | The righthand tensor |
Definition at line 506 of file tensor.hpp.
|
constexpr |
compound assignment (+) between a tensor and zero (no-op)
T | the underlying type of the tensor (righthand) argument |
n | integers describing the tensor shape |
[in] | A | The lefthand tensor |
Definition at line 560 of file tensor.hpp.
|
constexpr |
|
constexpr |
difference of isotropic and (nonisotropic) tensor
S | the type of the left isotropic tensor |
T | the type of the right tensor |
m | the number of rows and columns in each tensor |
I | the left operand |
A | the (full) right operand |
Definition at line 167 of file isotropic_tensor.hpp.
|
constexpr |
return the difference of two tensors
S | the underlying type of the lefthand argument |
T | the underlying type of the righthand argument |
n | integers describing the tensor shape |
[in] | A | The lefthand operand |
[in] | B | The righthand operand |
Definition at line 459 of file tensor.hpp.
|
constexpr |
return the unary negation of a tensor
T | the underlying type of the righthand argument |
n | integers describing the tensor shape |
[in] | A | The tensor to negate |
Definition at line 441 of file tensor.hpp.
|
constexpr |
|
constexpr |
|
constexpr |
difference of isotropic tensors
S | the type of the left isotropic tensor |
T | the type of the right isotropic tensor |
m | the number of rows and columns in each isotropic tensor |
I1 | the left operand |
I2 | the right operand |
Definition at line 116 of file isotropic_tensor.hpp.
|
constexpr |
difference of isotropic tensors
S | the type of the left isotropic tensor |
T | the type of the right isotropic tensor |
m | the dimension of each rank-4 isotropic tensor |
I1 | the left operand |
I2 | the right operand |
Definition at line 449 of file isotropic_tensor.hpp.
|
constexpr |
compound assignment (-) on tensors
S | the underlying type of the tensor (lefthand) argument |
T | the underlying type of the tensor (righthand) argument |
n | integers describing the tensor shape |
[in] | A | The lefthand tensor |
[in] | B | The righthand tensor |
Definition at line 574 of file tensor.hpp.
|
constexpr |
compound assignment (-) between a tensor and zero (no-op)
T | the underlying type of the tensor (righthand) argument |
n | integers describing the tensor shape |
[in] | A | The lefthand tensor |
Definition at line 589 of file tensor.hpp.
|
constexpr |
|
constexpr |
|
constexpr |
divide a tensor by a scalar
S | the scalar value type. Must be arithmetic (e.g. float, double, int) or a dual number |
T | the underlying type of the tensor (righthand) argument |
n | integers describing the tensor shape |
[in] | A | The tensor of numerators |
[in] | scale | The denominator |
Definition at line 90 of file tuple_tensor_dual_functions.hpp.
|
constexpr |
|
constexpr |
|
constexpr |
divide a scalar by each element in a tensor
S | the scalar value type. Must be arithmetic (e.g. float, double, int) or a dual number |
T | the underlying type of the tensor (righthand) argument |
n | integers describing the tensor shape |
[in] | scale | The numerator |
[in] | A | The tensor of denominators |
Definition at line 71 of file tuple_tensor_dual_functions.hpp.
operator for sorting lexicographically by {global_row, global_col}
Definition at line 40 of file dof_numbering.hpp.
auto& serac::operator<< | ( | std::ostream & | out, |
const serac::tuple< T... > & | A | ||
) |
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.
[in] | out | the std::ostream to write to (e.g. std::cout or std::ofstream) |
[in] | A | The tensor to write out |
Definition at line 1621 of file tensor.hpp.
|
inline |
Write a zero out to an output stream.
[in] | out | the std::ostream to write to (e.g. std::cout or std::ofstream) |
Definition at line 1636 of file tensor.hpp.
|
constexpr |
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 647 of file tensor.hpp.
|
constexpr |
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 613 of file tensor.hpp.
|
constexpr |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
zero
Definition at line 637 of file tensor.hpp.
|
constexpr |
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 599 of file tensor.hpp.
|
constexpr |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
zero
, and the right argument is a tensor Definition at line 627 of file tensor.hpp.
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})
f | the element family, used to determine which kind of transformation to apply |
T | the types of quantities to be transformed |
q | how many values need to be transformed |
dim | the spatial dimension |
qf_input | the values to be transformed from parent to physical space |
jacobians | the jacobians of the isoparametric map from parent to physical space of each quadrature point |
Definition at line 247 of file finite_element.hpp.
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.
f | the element family, used to determine which kind of transformation to apply |
T | the types of quantities to be transformed |
q | how many values need to be transformed |
dim | the spatial dimension |
qf_output | the values to be transformed from physical back to parent space |
jacobians | the jacobians of the isoparametric map from parent to physical space of each quadrature point |
Definition at line 288 of file finite_element.hpp.
|
constexpr |
|
constexpr |
|
constexpr |
compute the first n powers of x
n | how many powers to compute |
[in] | x | the number to be raised to varying powers |
Definition at line 389 of file polynomials.hpp.
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.
[in] | A | The tensor to write out |
Definition at line 1654 of file tensor.hpp.
|
inline |
print a double using printf
, so that it is suitable for use inside cuda kernels. (used in final recursion of printf(tensor<...>))
[in] | value | The value to write out |
Definition at line 1647 of file tensor.hpp.
auto& serac::print_helper | ( | std::ostream & | out, |
const serac::tuple< T... > & | A, | ||
std::integer_sequence< size_t, i... > | |||
) |
void serac::printRunInfo | ( | ) |
Outputs basic run information to the screen.
Note: Command line options are handled in infrastructure/cli.cpp
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
dualify | specify whether or not the input should be made into its dual type |
T | the type of the values passed in |
n | how many values were passed in |
x | the values to be promoted |
Definition at line 223 of file tuple_tensor_dual_functions.hpp.
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
dualify | specify whether or not the value should be made into its dual type |
T | the type of the value passed in |
x | the values to be promoted |
Definition at line 204 of file tuple_tensor_dual_functions.hpp.
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
T | the datatype stored in each tensor |
n | the dimensions of each tensor |
A | the left argument |
B | the right argument |
Definition at line 1390 of file tensor.hpp.
bool serac::sameFiniteElementSpace | ( | const mfem::FiniteElementSpace & | left, |
const mfem::FiniteElementSpace & | right | ||
) |
Check if two finite element spaces are the same.
left | |
right |
Definition at line 123 of file finite_element_vector.cpp.
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).
MaterialType | the type of the material model under test |
StateType | the associated state variables to be provided to the material |
functions | a variadic list of callables |
t_max | the final time value for |
num_steps | the number of timesteps to be |
material | an instance of a material model under test |
initial_state | the initial conditions for materials that exhibit hysteresis |
f | the functions (e.g. std::function, lambdas, etc) that are used to generate the inputs to the material model at each timestep |
Definition at line 103 of file material_verification_tools.hpp.
|
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.
|
constexpr |
returns the total number of stored values in a tensor
T | the datatype stored in the tensor |
n | the extents of each dimension |
Definition at line 1851 of file tensor.hpp.
|
constexpr |
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 1499 of file tensor.hpp.
|
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.
[in] | L | A lower triangular matrix |
[in] | b | The right hand side |
[in] | P | A list of indices to index into b in a permuted fashion. |
Definition at line 1480 of file tensor.hpp.
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.
function | Function object type for the nonlinear equation to solve |
...ParamTypes | Types of the (optional) parameters to the nonlinear function |
f | Nonlinear 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). |
x0 | Initial guess of root. If x0 is outside the search interval, the initial guess will be changed to the midpoint of the search interval. |
lower_bound | Lower bound of interval to search for root. |
upper_bound | Upper bound of interval to search for root. |
options | Options controlling behavior of solver. |
...params | Optional parameters to the nonlinear function. |
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.
|
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.
[in] | U | An upper triangular matrix |
[in] | y | The right hand side |
Definition at line 1520 of file tensor.hpp.
|
constexpr |
compute the squared Frobenius norm (tr(dot(transpose(I), I))) of an isotropic tensor
T | the types stored in the isotropic tensor |
m | the number of rows and columns in I |
I | the isotropic tensor to compute the squared norm of |
Definition at line 337 of file isotropic_tensor.hpp.
|
constexpr |
Returns the squared Frobenius norm of the tensor.
[in] | A | The tensor to obtain the squared norm from |
Definition at line 1009 of file tensor.hpp.
void serac::squish | ( | mfem::Mesh & | mesh | ) |
a transformation from the unit disk/sphere (in L1 norm) to a unit disk/sphere (in L2 norm)
mesh | The mesh to transform |
Definition at line 50 of file mesh_utils.cpp.
|
constexpr |
return the symmetric part of an isotropic tensor
T | the types stored in the isotropic tensor |
m | the number of rows and columns in I |
I | the isotropic tensor to symmetrize |
Definition at line 243 of file isotropic_tensor.hpp.
|
constexpr |
Returns the symmetric part of a square matrix.
[in] | A | The matrix to obtain the symmetric part of |
Definition at line 1088 of file tensor.hpp.
|
constexpr |
a helper function for creating the rank-4 isotropic tensor defined by: d(sym(A)_{ij}) / d(A_{kl})
m | the dimension |
Definition at line 383 of file isotropic_tensor.hpp.
serac::tensor | ( | const T(&) | data[n1] | ) | -> tensor< T, n1 > |
class template argument deduction guide for type tensor
.
serac::tensor | ( | const T(&) | data[n1][n2] | ) | -> tensor< T, n1, n2 > |
class template argument deduction guide for type tensor
.
|
constexpr |
Creates a tensor given the dimensions in a std::integer_sequence
.
n | The parameter pack of integer dimensions |
Definition at line 283 of file tensor.hpp.
|
constexpr |
calculate the trace of an isotropic tensor
T | the types stored in the isotropic tensor |
m | the number of rows and columns in I |
I | the isotropic tensor to compute the trace of |
Definition at line 270 of file isotropic_tensor.hpp.
|
constexpr |
Returns the trace of a square matrix.
[in] | A | The matrix to compute the trace of |
Definition at line 1073 of file tensor.hpp.
|
constexpr |
return the transpose of an isotropic tensor
T | the types stored in the isotropic tensor |
m | the number of rows and columns in I |
I | the isotropic tensor to compute the trace of |
Definition at line 284 of file isotropic_tensor.hpp.
|
constexpr |
Returns the transpose of the matrix.
[in] | A | The matrix to obtain the transpose of |
Definition at line 1199 of file tensor.hpp.
serac::tuple | ( | T... | ) | -> tuple< T... > |
Class template argument deduction rule for tuples.
T | The variadic template parameter for tuple types |
|
constexpr |
a function intended to be used for extracting the ith type from a tuple.
i | the index of the tuple to query |
T | the types stored in the tuple |
values | the tuple of values |
|
constexpr |
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).
t_max | upper limit of the time interval. |
num_steps | The number of discrete time points at which the response is sampled (uniformly spaced). This is inclusive of the point at time zero. |
material | The material model to use |
initial_state | The state variable collection for this material, set to the desired initial condition. |
epsilon_xx | A function describing the desired axial displacement gradient as a function of time. (NB axial displacement gradient is equivalent to engineering strain). |
parameter_functions | Pack 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.
std::string serac::version | ( | bool | add_SHA = true | ) |
|
constexpr |
Applies a functor to the active variant element.
[in] | visitor | The functor to apply |
[in] | v | The variant to apply the functor to |
Definition at line 365 of file variant.hpp.
std::shared_ptr< QuadratureData< Nothing > > serac::NoQData |
a single instance of a QuadratureData container of Nothing
s, 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.