22 const std::vector<std::string> & fn_names,
23 const std::vector<std::string> & inv_fn_names)
24 :
libMesh::PeriodicBoundaryBase(),
25 _dim(fn_names.size()),
26 _tr(getFunctions(feproblem, fn_names)),
27 _inv_tr(getFunctions(feproblem, inv_fn_names))
29 mooseAssert(fn_names.size() == inv_fn_names.size(),
"Size mismatch");
33 mooseError(
"Transform function has to have the same dimension as the problem being solved.");
38 :
libMesh::PeriodicBoundaryBase(o),
40 _tr(t == INVERSE ? o._inv_tr : o._tr),
41 _inv_tr(t == INVERSE ? o._tr : o._inv_tr)
54 for (
const auto i : make_range(
_dim))
56 mooseAssert(
_tr[i],
"Function not provided");
57 p(i) =
_tr[i]->value(0.0, pt);
62std::unique_ptr<libMesh::PeriodicBoundaryBase>
65 return std::make_unique<FunctionPeriodicBoundary>(*
this, t);
68std::array<const Function *, 3>
70 const std::vector<std::string> & names)
72 std::array<const Function *, 3> functions;
73 for (
const auto i : index_range(functions))
77 const_cast<Function *
>(functions[i])->initialSetup();
Threads::spin_mutex parsed_function_mutex
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
virtual MooseMesh & mesh() override
virtual Function & getFunction(const std::string &name, const THREAD_ID tid=0)
Periodic boundary for calculation periodic BC on domains where the translation is given by Function o...
virtual libMesh::Point get_corresponding_pos(const libMesh::Point &pt) const override
Get the translation based on point 'pt'.
const unsigned int _dim
The dimension of the problem (says which of _tr and _inv_tr are active)
static std::array< const Function *, 3 > getFunctions(FEProblemBase &problem, const std::vector< std::string > &names)
FunctionPeriodicBoundary(FEProblemBase &subproblem, const std::vector< std::string > &fn_names, const std::vector< std::string > &inv_fn_names)
Initialize the periodic with the functions and inverse functions, one for each dimension needed.
virtual std::unique_ptr< libMesh::PeriodicBoundaryBase > clone(TransformationType t) const override
const std::array< const Function *, 3 > _tr
Pointers to translation functions in each dimension.
Base class for function objects.
virtual unsigned int dimension() const
Returns MeshBase::mesh_dimension(), (not MeshBase::spatial_dimension()!) of the underlying libMesh me...
boundary_id_type myboundary
boundary_id_type pairedboundary
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...