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"
26#include "libmesh/variable.h"
44 unsigned int to_var_num = to_var.
number();
52 unsigned int to_sys_num = to_sys->
number();
58 serialized_solution->init(from_sys->
n_dofs(),
false,
SERIAL);
62 from_sys->
solution->localize(*serialized_solution);
68 for (
const auto & node : to_sys->
get_mesh().local_node_ptr_range())
69 to_sys->
solution->set(node->dof_number(to_sys_num, to_var_num, 0), from_func(*node));
This is the EquationSystems class.
FEFamily family
The type of finite element.
virtual bool is_serial() const
MeshFunctionSolutionTransfer(const libMesh::Parallel::Communicator &comm)
virtual void transfer(const Variable &from_var, const Variable &to_var) override
Transfer the values of a variable to another.
virtual ~MeshFunctionSolutionTransfer()
This class provides function-like objects for data distributed over a mesh.
virtual void init() override
Override the FunctionBase::init() member function.
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...
const Parallel::Communicator & comm() const
Base class for objects that allow transferring variable values between different systems with differe...
Manages consistently variables, degrees of freedom, and coefficient vectors.
dof_id_type n_dofs() const
std::unique_ptr< NumericVector< Number > > solution
Data structure to hold solution values.
virtual void update()
Update the local values to reflect the solution on neighboring processors.
const DofMap & get_dof_map() const
unsigned int number() const
const EquationSystems & get_equation_systems() const
const MeshBase & get_mesh() const
This class defines the notion of a variable in the system.
unsigned int number() const
const FEType & type() const
The libMesh namespace provides an interface to certain functionality in the library.