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)
56 mooseAssert(
_tr[i],
"Function not provided");
57 p(i) =
_tr[i]->value(0.0, pt);
62 std::unique_ptr<libMesh::PeriodicBoundaryBase>
65 return std::make_unique<FunctionPeriodicBoundary>(*
this, t);
68 std::array<const Function *, 3>
70 const std::vector<std::string> & names)
72 std::array<const Function *, 3> functions;
77 const_cast<Function *
>(functions[i])->initialSetup();
Base class for function objects.
virtual std::unique_ptr< libMesh::PeriodicBoundaryBase > clone(TransformationType t) const override
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
const std::array< const Function *, 3 > _tr
Pointers to translation functions in each dimension.
void swap(std::vector< T > &data, const std::size_t idx0, const std::size_t idx1, const libMesh::Parallel::Communicator &comm)
Swap function for serial or distributed vector of data.
Periodic boundary for calculation periodic BC on domains where the translation is given by Function o...
boundary_id_type pairedboundary
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
const unsigned int _dim
The dimension of the problem (says which of _tr and _inv_tr are active)
virtual Function & getFunction(const std::string &name, const THREAD_ID tid=0)
boundary_id_type myboundary
virtual unsigned int dimension() const
Returns MeshBase::mesh_dimension(), (not MeshBase::spatial_dimension()!) of the underlying libMesh me...
Threads::spin_mutex parsed_function_mutex
IntRange< T > make_range(T beg, T end)
virtual MooseMesh & mesh() override
static std::array< const Function *, 3 > getFunctions(FEProblemBase &problem, const std::vector< std::string > &names)
virtual libMesh::Point get_corresponding_pos(const libMesh::Point &pt) const override
Get the translation based on point 'pt'.
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...
auto index_range(const T &sizable)