20 #include "libmesh/meshfunction_solution_transfer.h" 22 #include "libmesh/system.h" 23 #include "libmesh/numeric_vector.h" 24 #include "libmesh/mesh_function.h" 25 #include "libmesh/node.h" 43 unsigned int to_var_num = to_var.
number();
51 unsigned int to_sys_num = to_sys->
number();
57 serialized_solution->init(from_sys->
n_dofs(),
false,
SERIAL);
61 from_sys->
solution->localize(*serialized_solution);
67 for (
const auto & node : to_sys->
get_mesh().local_node_ptr_range())
68 to_sys->
solution->set(node->dof_number(to_sys_num, to_var_num, 0), from_func(*node));
FEFamily family
The type of finite element.
This is the EquationSystems class.
const EquationSystems & get_equation_systems() const
const Parallel::Communicator & comm() const
The libMesh namespace provides an interface to certain functionality in the library.
MeshFunctionSolutionTransfer(const libMesh::Parallel::Communicator &comm)
const MeshBase & get_mesh() const
dof_id_type n_dofs() const
virtual bool is_serial() const
unsigned int number() const
This class defines the notion of a variable in the system.
Manages consistently variables, degrees of freedom, and coefficient vectors.
std::unique_ptr< NumericVector< Number > > solution
Data structure to hold solution values.
virtual void init() override
Override the FunctionBase::init() member function.
virtual void transfer(const Variable &from_var, const Variable &to_var) override
Transfer the values of a variable to another.
virtual void update()
Update the local values to reflect the solution on neighboring processors.
virtual ~MeshFunctionSolutionTransfer()
static std::unique_ptr< NumericVector< T > > build(const Parallel::Communicator &comm, SolverPackage solver_package=libMesh::default_solver_package(), ParallelType parallel_type=AUTOMATIC)
Builds a NumericVector on the processors in communicator comm using the linear solver package specifi...
Base class for objects that allow transferring variable values between different systems with differe...
This class provides function-like objects for data distributed over a mesh.
unsigned int number() const
const DofMap & get_dof_map() const
const FEType & type() const