20 #include "libmesh/libmesh_config.h" 22 #ifdef LIBMESH_TRILINOS_HAVE_DTK 24 #include "libmesh/dtk_solution_transfer.h" 25 #include "libmesh/system.h" 27 #include "libmesh/ignore_warnings.h" 30 #include <Teuchos_RCP.hpp> 31 #include <Teuchos_GlobalMPISession.hpp> 32 #include <Teuchos_Ptr.hpp> 33 #include <Teuchos_DefaultMpiComm.hpp> 34 #include <Teuchos_OpaqueWrapper.hpp> 37 #include <DTK_MeshManager.hpp> 38 #include <DTK_MeshContainer.hpp> 39 #include <DTK_FieldManager.hpp> 40 #include <DTK_FieldContainer.hpp> 41 #include <DTK_FieldTools.hpp> 42 #include <DTK_CommTools.hpp> 43 #include <DTK_CommIndexer.hpp> 45 #include "libmesh/restore_warnings.h" 54 comm_default = Teuchos::rcp(
new Teuchos::MpiComm<int>(Teuchos::rcp(
new Teuchos::OpaqueWrapper<MPI_Comm>(
comm.
get()))));
63 libmesh_experimental();
80 auto [it, emplaced] =
dtk_maps.emplace(std::make_pair(from_es, to_es),
nullptr);
95 Teuchos::RCP<DataTransferKit::FieldManager<DTKAdapter::FieldContainerType>> to_values = to_adapter->
get_values_to_fill(to_var.
name());
97 it->second->apply(from_evaluator, to_values);
99 if (it->second->getMissedTargetPoints().size())
100 libMesh::out <<
"Warning: Some points were missed in the transfer of " << from_var.
name() <<
" to " << to_var.
name() <<
"!" << std::endl;
107 #endif // #ifdef LIBMESH_TRILINOS_HAVE_DTK This is the EquationSystems class.
Teuchos::RCP< DataTransferKit::FieldManager< MeshContainerType > > get_target_coords()
virtual ~DTKSolutionTransfer()
std::map< std::pair< EquationSystems *, EquationSystems * >, std::unique_ptr< shared_domain_map_type > > dtk_maps
The dtk shared domain maps for pairs of EquationSystems (from, to)
void update_variable_values(std::string var_name)
After computing values for a variable in this EquationSystems we need to take those values and put th...
const EquationSystems & get_equation_systems() const
DTKSolutionTransfer(const libMesh::Parallel::Communicator &comm)
const Parallel::Communicator & comm() const
The DTKAdapter is used with the DTKSolutionTransfer object to adapt libmesh data to the DTK interface...
std::map< EquationSystems *, std::unique_ptr< DTKAdapter > > adapters
The DTKAdapter associated with each EquationSystems.
The libMesh namespace provides an interface to certain functionality in the library.
This class defines the notion of a variable in the system.
RCP_Evaluator get_variable_evaluator(std::string var_name)
virtual void transfer(const Variable &from_var, const Variable &to_var) override
Transfer the values of a variable to another.
Teuchos::RCP< const Teuchos::Comm< int > > comm_default
COMM_WORLD for now.
Teuchos::RCP< EvaluatorType > RCP_Evaluator
Teuchos::RCP< DataTransferKit::MeshManager< MeshContainerType > > get_mesh_manager()
const MeshBase & get_mesh() const
unsigned int mesh_dimension() const
Base class for objects that allow transferring variable values between different systems with differe...
const std::string & name() const
Teuchos::RCP< DataTransferKit::FieldManager< FieldContainerType > > get_values_to_fill(std::string var_name)