templates.problem_template.problem_def

templates.problem_template.problem_def

Classes

Name Description
ProblemTemplate Template for an affine or non-linear reduced-order-model (ROM) problem.

ProblemTemplate

templates.problem_template.problem_def.ProblemTemplate()

Template for an affine or non-linear reduced-order-model (ROM) problem.

Methods

Name Description
bilinear_forms Import element-level bilinear (or Jacobian) forms from
domain Import domain information from domain.py in the local directory.
fom_operators Assemble (and cache) full-order operators (e.g. stiffness, mass)
fom_rhs Assemble (and cache) the full-order RHS vector consumed by
fom_solver Solve the high-fidelity model for one parameter point.
hyper_rom_operators_deim Compute operators (interpolation indices, projection matrices, …)
hyper_rom_operators_ecsw Compute operators (sampling matrices, weights, …) for the ECSW method.
hyper_rom_solver_deim Solve the DEIM hyper-reduced model.
hyper_rom_solver_ecm Solve the ECM hyper-reduced model.
hyper_rom_solver_ecsw Solve the ECSW hyper-reduced model.
linear_forms Import element-level linear / residual forms from linear_forms.py.
parameters Import a sampling-design generator from params.py. The helper
properties Import coefficient-generating functions (e.g. k(μ), q(β), …) from
reduced_operators Project FOM operators onto the reduced basis so rom_solver can work
rom_solver Solve the reduced-order model and reconstruct the high-dimensional
bilinear_forms
templates.problem_template.problem_def.ProblemTemplate.bilinear_forms()

Import element-level bilinear (or Jacobian) forms from bilinear_forms.py. Nothing is assembled here – we merely hand back the callables.

Example

from bilinear_forms import a1, a2 return [a1, a2]

domain
templates.problem_template.problem_def.ProblemTemplate.domain()

Import domain information from domain.py in the local directory. No geometry is built here – we simply delegate to domain_.

Example

from domain import domain_ return domain_()

Required keys (but not limited to) in the returned dict: * ‘mesh’, ‘basis’ * ‘free_dofs’, ‘dirichlet_dofs’, ‘dirichlet_value’

fom_operators
templates.problem_template.problem_def.ProblemTemplate.fom_operators(cls)

Assemble (and cache) full-order operators (e.g. stiffness, mass) used by fom_solver.

Parameters
Name Type Description Default
cls master_class object Runtime-state container injected by the master class. Provides simulation metadata such as cls.cur_itr (current sample), solver tolerances, logging utilities, etc. required
fom_rhs
templates.problem_template.problem_def.ProblemTemplate.fom_rhs(cls)

Assemble (and cache) the full-order RHS vector consumed by fom_solver and hyper-reduction routines.

Parameters
Name Type Description Default
cls master_class object Simulation context (see fom_operators docstring). required
fom_solver
templates.problem_template.problem_def.ProblemTemplate.fom_solver(cls, param)

Solve the high-fidelity model for one parameter point.

Called automatically by the master class when a simulation is run.

Parameters
Name Type Description Default
cls master_class object Contains run-time info such as cls.cur_itr. required
param ndarray or scalar Parameter vector/value μ at which to solve. required
Returns
Name Type Description
full_solution ndarray
hyper_rom_operators_deim
templates.problem_template.problem_def.ProblemTemplate.hyper_rom_operators_deim(
    cls,
    param,
)

Compute operators (interpolation indices, projection matrices, …) for the DEIM method.

Parameters
Name Type Description Default
cls master_class object – simulation context required
param ndarray or scalar – parameter vector/value μ required
hyper_rom_operators_ecsw
templates.problem_template.problem_def.ProblemTemplate.hyper_rom_operators_ecsw(
    cls,
    param,
)

Compute operators (sampling matrices, weights, …) for the ECSW method.

Parameters
Name Type Description Default
cls master_class object – simulation context required
param ndarray or scalar – parameter vector/value μ required
hyper_rom_solver_deim
templates.problem_template.problem_def.ProblemTemplate.hyper_rom_solver_deim(
    cls,
    param,
)

Solve the DEIM hyper-reduced model.

Called automatically by the master class when a DEIM-based simulation is executed.

Parameters
Name Type Description Default
cls master_class object – simulation context required
param ndarray or scalar – parameter vector/value μ required
hyper_rom_solver_ecm
templates.problem_template.problem_def.ProblemTemplate.hyper_rom_solver_ecm(
    cls,
    param,
)

Solve the ECM hyper-reduced model.

Called automatically by the master class when an ECM-based simulation is executed.

Parameters
Name Type Description Default
cls master_class object – simulation context required
param ndarray or scalar – parameter vector/value μ required
hyper_rom_solver_ecsw
templates.problem_template.problem_def.ProblemTemplate.hyper_rom_solver_ecsw(
    cls,
    param,
)

Solve the ECSW hyper-reduced model.

Called automatically by the master class when an ECSW-based simulation is executed.

Parameters
Name Type Description Default
cls master_class object – simulation context required
param ndarray or scalar – parameter vector/value μ required
linear_forms
templates.problem_template.problem_def.ProblemTemplate.linear_forms()

Import element-level linear / residual forms from linear_forms.py. No assembly happens here – we just return the callables.

Example

from linear_forms import f1, f2 return [f1, f2]

parameters
templates.problem_template.problem_def.ProblemTemplate.parameters(n_samples)

Import a sampling-design generator from params.py. The helper function constructs training / test parameter sets.

Example

from params import parameters return parameters(n_samples)

properties
templates.problem_template.problem_def.ProblemTemplate.properties()

Import coefficient-generating functions (e.g. k(μ), q(β), …) from properties.py located in the same folder.

Example

from properties import k_func, q_func return [k_func, q_func]

reduced_operators
templates.problem_template.problem_def.ProblemTemplate.reduced_operators(
    cls,
    param,
)

Project FOM operators onto the reduced basis so rom_solver can work in a low-dimensional space.

Parameters
Name Type Description Default
cls master_class object – simulation context required
param ndarray or scalar – parameter vector/value μ required
rom_solver
templates.problem_template.problem_def.ProblemTemplate.rom_solver(cls, param)

Solve the reduced-order model and reconstruct the high-dimensional field.

Called automatically by the master class during a simulation.

Parameters
Name Type Description Default
cls master_class object Gives access to run-time metadata (e.g. cls.cur_itr). required
param ndarray or scalar Parameter vector/value μ. required
Returns
Name Type Description
u_red u_red – parameter-scaled modal coefficients