SolutionTransferOperator< dim, Number > Class Template Reference

Developer Documentation: MeltPoolDG::CutUtil::SolutionTransferOperator< dim, Number > Class Template Reference
Developer Documentation
MeltPoolDG::CutUtil::SolutionTransferOperator< dim, Number > Class Template Reference

Operator for the solution transfer in moving boundary/interface simulations. More...

#include <solution_transfer.hpp>

Collaboration diagram for MeltPoolDG::CutUtil::SolutionTransferOperator< dim, Number >:
[legend]

Public Types

using VectorType = dealii::LinearAlgebra::distributed::Vector< Number >
 

Public Member Functions

 SolutionTransferOperator (const GhostPenaltyData< Number > &ghost_penalty_in, const bool is_two_phase, const int verbosity=0)
 Constructor.
 
void reinit (dealii::DoFHandler< dim > &cut_dof_handler, dealii::Triangulation< dim > &tria, const VectorType &cut_solution, const dealii::NonMatching::MeshClassifier< dim > &mesh_classifier_old, const dealii::NonMatching::MeshClassifier< dim > &mesh_classifier, const std::function< void(VectorType &)> &reinit_cut_vector, const std::function< void()> &setup_dof_system, const AttachDoFHandlerAndVectorsType< dim, VectorType > &attach_vectors={})
 Reinit function for the solution transfer according to the new immersed interface position.
 
void reinit (dealii::DoFHandler< dim > &cut_dof_handler, dealii::Triangulation< dim > &tria, const std::vector< const VectorType * > &cut_solutions, const dealii::NonMatching::MeshClassifier< dim > &mesh_classifier_old, const dealii::NonMatching::MeshClassifier< dim > &mesh_classifier, const std::function< void(VectorType &)> &reinit_cut_vector, const std::function< void()> &setup_dof_system, const AttachDoFHandlerAndVectorsType< dim, VectorType > &attach_vectors={})
 Same as above but with multiple cut solution vectors given by cut_solutions.
 
const std::vector< VectorType > & get_updated_solutions () const
 Getter function for multiple transferred solution vectors (const. version).
 
std::vector< VectorType > & get_updated_solutions ()
 Getter function for multiple transferred solution vectors (non-const. version).
 
const VectorTypeget_updated_solution () const
 Getter function for the transferred solution vector (const. version).
 
VectorTypeget_updated_solution ()
 Getter function for the transferred solution vector (non-const. version).
 

Private Member Functions

void transfer_solution_constant_dofs (dealii::DoFHandler< dim > &cut_dof_handler, dealii::Triangulation< dim > &tria, const std::vector< const VectorType * > &cut_solutions, const dealii::NonMatching::MeshClassifier< dim > &mesh_classifier_old, const dealii::NonMatching::MeshClassifier< dim > &mesh_classifier, const std::function< void(VectorType &)> &reinit_cut_vector, const std::function< void()> &setup_dof_system, const AttachDoFHandlerAndVectorsType< dim, VectorType > &attach_vectors={})
 Update FE-index and distribute DoFs according to the new state with the moved interface.
 
VectorType mark_dofs_for_gp_extrapolation (const dealii::DoFHandler< dim > &cut_dof_handler, const dealii::NonMatching::MeshClassifier< dim > &mesh_classifier, const dealii::NonMatching::MeshClassifier< dim > &mesh_classifier_old) const
 Mark the unknown DoFs, which need to be ghost-penalty extrapolated.
 
dealii::AffineConstraints< Number > create_constraints_gp_extrapolation (const dealii::DoFHandler< dim > &cut_dof_handler, const VectorType &flags_dofs_gp_extrapolation) const
 Create constraints for the known DoFs that do not need to be ghost-penalty extrapolated.
 
void extrapolate_solution_new_dofs (const dealii::DoFHandler< dim > &cut_dof_handler, const dealii::NonMatching::MeshClassifier< dim > &mesh_classifier, const dealii::NonMatching::MeshClassifier< dim > &mesh_classifier_old, const std::function< void(VectorType &)> &reinit_vector)
 Assemble and solve system for ghost-penalty extrapolation, apply constraints.
 

Private Attributes

std::vector< VectorTypenew_solutions
 Collection of extrapolated solution vectors.
 
unsigned int fe_degree
 Finite element degree.
 
unsigned int n_components_per_phase
 
bool is_dg
 Boolean indicator whether DG is used.
 
const GhostPenaltyData< Number > ghost_penalty
 Ghost-penalty parameters for stabilization of cut elements.
 
const bool is_two_phase
 Boolean indicator whether a two-phase case is considered.
 
const unsigned int verbosity
 Verbosity level for output (0: nothing(=default), 1: something, 2: some more details)
 
dealii::ConditionalOStream pcout
 Stream object for conditional output.
 

Detailed Description

template<int dim, typename Number>
class MeltPoolDG::CutUtil::SolutionTransferOperator< dim, Number >

Operator for the solution transfer in moving boundary/interface simulations.

The operator transfers the solution vector between different function spaces at two consecutive time steps. It adapts the DoF layout to a moved interface position and extrapolates unknown new DoF values using ghost-penalty extrapolation.

The solution transfer works for both single- and two-phase cases, and for scalar as well as vector-valued solution fields.

Note
Currently, the solution transfer is limited to interface movements of less than one element length between two subsequent time steps.

Member Typedef Documentation

◆ VectorType

template<int dim, typename Number >
using MeltPoolDG::CutUtil::SolutionTransferOperator< dim, Number >::VectorType = dealii::LinearAlgebra::distributed::Vector<Number>

Constructor & Destructor Documentation

◆ SolutionTransferOperator()

template<int dim, typename Number >
MeltPoolDG::CutUtil::SolutionTransferOperator< dim, number >::SolutionTransferOperator ( const GhostPenaltyData< Number > &  ghost_penalty_in,
const bool  is_two_phase,
const int  verbosity = 0 
)

Constructor.

Parameters
ghost_penalty_inSet of ghost-penalty parameters for stabilization of cut elements.
is_two_phaseBoolean indicator whether a two-phase case is considered.
verbosityVerbosity level with default value 0.

Member Function Documentation

◆ create_constraints_gp_extrapolation()

template<int dim, typename number >
dealii::AffineConstraints< number > MeltPoolDG::CutUtil::SolutionTransferOperator< dim, number >::create_constraints_gp_extrapolation ( const dealii::DoFHandler< dim > &  cut_dof_handler,
const VectorType flags_dofs_gp_extrapolation 
) const
private

Create constraints for the known DoFs that do not need to be ghost-penalty extrapolated.

Parameters
cut_dof_handlerDoF-Handler of the considered field with non-fitted (cut) domain representation.
flags_dofs_gp_extrapolationA DoF vector in which the DoF values set to 1 indicate the degrees of freedom to be extrapolated. All other DoF values are set to 0.
Returns
A dealii::AffineConstraints object that contains the constraints for the DoFs that do not need to be extrapolated.

◆ extrapolate_solution_new_dofs()

template<int dim, typename number >
void MeltPoolDG::CutUtil::SolutionTransferOperator< dim, number >::extrapolate_solution_new_dofs ( const dealii::DoFHandler< dim > &  cut_dof_handler,
const dealii::NonMatching::MeshClassifier< dim > &  mesh_classifier,
const dealii::NonMatching::MeshClassifier< dim > &  mesh_classifier_old,
const std::function< void(VectorType &)> &  reinit_vector 
)
private

Assemble and solve system for ghost-penalty extrapolation, apply constraints.

Parameters
cut_dof_handlerDoF-Handler of the considered field with non-fitted (cut) domain representation.
mesh_classifier_oldMesh classifier object which corresponds to the old interface position.
mesh_classifierMesh classifier object which corresponds to the new (moved) interface position.
reinit_vectorA Lambda function for the vector reinitialization.

◆ get_updated_solution() [1/2]

template<int dim, typename Number >
VectorType & MeltPoolDG::CutUtil::SolutionTransferOperator< dim, Number >::get_updated_solution ( )
inline

Getter function for the transferred solution vector (non-const. version).

It is intended to be used in contexts where only a single solution vector is present.

Returns
A reference to the updated solution vector.
Exceptions
dealii::ExcMessageif there is not exactly one solution vector in the new_solutions container.

◆ get_updated_solution() [2/2]

template<int dim, typename Number >
const VectorType & MeltPoolDG::CutUtil::SolutionTransferOperator< dim, Number >::get_updated_solution ( ) const
inline

Getter function for the transferred solution vector (const. version).

It is intended to be used in contexts where only a single solution vector is present.

Returns
A constant reference to the updated solution vector.
Exceptions
dealii::ExcMessageif there is not exactly one solution vector in the new_solutions container.

◆ get_updated_solutions() [1/2]

template<int dim, typename Number >
std::vector< VectorType > & MeltPoolDG::CutUtil::SolutionTransferOperator< dim, Number >::get_updated_solutions ( )
inline

Getter function for multiple transferred solution vectors (non-const. version).

Returns
A reference to the std::vector containing updated solution vectors.

◆ get_updated_solutions() [2/2]

template<int dim, typename Number >
const std::vector< VectorType > & MeltPoolDG::CutUtil::SolutionTransferOperator< dim, Number >::get_updated_solutions ( ) const
inline

Getter function for multiple transferred solution vectors (const. version).

Returns
A constant reference to the std::vector containing updated solution vectors.

◆ mark_dofs_for_gp_extrapolation()

template<int dim, typename number >
dealii::LinearAlgebra::distributed::Vector< number > MeltPoolDG::CutUtil::SolutionTransferOperator< dim, number >::mark_dofs_for_gp_extrapolation ( const dealii::DoFHandler< dim > &  cut_dof_handler,
const dealii::NonMatching::MeshClassifier< dim > &  mesh_classifier,
const dealii::NonMatching::MeshClassifier< dim > &  mesh_classifier_old 
) const
private

Mark the unknown DoFs, which need to be ghost-penalty extrapolated.

Parameters
cut_dof_handlerDoF-Handler of the considered field with non-fitted (cut) domain representation.
mesh_classifier_oldMesh classifier object which corresponds to the old interface position.
mesh_classifierMesh classifier object which corresponds to the new (moved) interface position.
Returns
A DoF vector in which the DoF values set to 1 indicate the degrees of freedom to be extrapolated. All other DoF values are set to 0.

◆ reinit() [1/2]

template<int dim, typename number >
void MeltPoolDG::CutUtil::SolutionTransferOperator< dim, number >::reinit ( dealii::DoFHandler< dim > &  cut_dof_handler,
dealii::Triangulation< dim > &  tria,
const std::vector< const VectorType * > &  cut_solutions,
const dealii::NonMatching::MeshClassifier< dim > &  mesh_classifier_old,
const dealii::NonMatching::MeshClassifier< dim > &  mesh_classifier,
const std::function< void(VectorType &)> &  reinit_cut_vector,
const std::function< void()> &  setup_dof_system,
const AttachDoFHandlerAndVectorsType< dim, VectorType > &  attach_vectors = {} 
)

Same as above but with multiple cut solution vectors given by cut_solutions.

1) Update FE-index and distribute DoFs according to new state with the moved interface. 2) Set up and solve system for ghost-penalty extrapolation to determine the values of the remaining undetermined DoFs.

Parameters
cut_dof_handlerDoF-Handler of the considered field with non-fitted (cut) domain representation.
triaTriangulation object.
cut_solutionsCollection of solution vectors which corresponds to the DoF-layout of the mesh_classifier_old.
mesh_classifier_oldMesh classifier object which corresponds to the old interface position.
mesh_classifierMesh classifier object which corresponds to the new (moved) interface position.
reinit_cut_vectorA Lambda function for the vector reinitialization.
setup_dof_systemSet up the dof system, this includes:
  • distribute DoFs on the new mesh
  • create partitioning for the new mesh
  • set up constraints on the new mesh
  • reinit the MatrixFree object for the new DoFs (ScratchData::build())
  • initialize all DoF vectors for the new DoF layout
attach_vectorsLambda function of type AttachDoFHandlerAndVectorsType, that attaches all DoFHandlers and their respective DoFVectors that ought to be reconstructed.

◆ reinit() [2/2]

template<int dim, typename number >
void MeltPoolDG::CutUtil::SolutionTransferOperator< dim, number >::reinit ( dealii::DoFHandler< dim > &  cut_dof_handler,
dealii::Triangulation< dim > &  tria,
const VectorType cut_solution,
const dealii::NonMatching::MeshClassifier< dim > &  mesh_classifier_old,
const dealii::NonMatching::MeshClassifier< dim > &  mesh_classifier,
const std::function< void(VectorType &)> &  reinit_cut_vector,
const std::function< void()> &  setup_dof_system,
const AttachDoFHandlerAndVectorsType< dim, VectorType > &  attach_vectors = {} 
)

Reinit function for the solution transfer according to the new immersed interface position.

1) Update FE-index and distribute DoFs according to new state with the moved interface. 2) Set up and solve system for ghost-penalty extrapolation to determine the values of the remaining undetermined DoFs

Parameters
cut_dof_handlerDoF-Handler of the considered field with non-fitted (cut) domain representation.
triaTriangulation object.
cut_solutionSolution vector which corresponds to the DoF-layout of the mesh_classifier_old.
mesh_classifier_oldMesh classifier object which corresponds to the old interface position.
mesh_classifierMesh classifier object which corresponds to the new (moved) interface position.
reinit_cut_vectorA Lambda function for the vector reinitialization.
setup_dof_systemSet up the dof system, this includes:
  • distribute DoFs on the new mesh
  • create partitioning for the new mesh
  • set up constraints on the new mesh
  • reinit the MatrixFree object for the new DoFs (ScratchData::build())
  • initialize all DoF vectors for the new DoF layout
attach_vectorsLambda function of type AttachDoFHandlerAndVectorsType, that attaches all DoFHandlers and their respective DoFVectors that ought to be reconstructed.
Exceptions
dealii::ExcMessageif the FECollection contains unsupported finite element types or if assumptions about the problem phase structure are violated.

◆ transfer_solution_constant_dofs()

template<int dim, typename number >
void MeltPoolDG::CutUtil::SolutionTransferOperator< dim, number >::transfer_solution_constant_dofs ( dealii::DoFHandler< dim > &  cut_dof_handler,
dealii::Triangulation< dim > &  tria,
const std::vector< const VectorType * > &  cut_solutions,
const dealii::NonMatching::MeshClassifier< dim > &  mesh_classifier_old,
const dealii::NonMatching::MeshClassifier< dim > &  mesh_classifier,
const std::function< void(VectorType &)> &  reinit_cut_vector,
const std::function< void()> &  setup_dof_system,
const AttachDoFHandlerAndVectorsType< dim, VectorType > &  attach_vectors = {} 
)
private

Update FE-index and distribute DoFs according to the new state with the moved interface.

Parameters
cut_dof_handlerDoF-Handler of the considered field with non-fitted (cut) domain representation.
triaTriangulation object.
cut_solutionsCollection of solution vectors which corresponds to the DoF-layout of the mesh_classifier_old.
mesh_classifier_oldMesh classifier object which corresponds to the old interface position.
mesh_classifierMesh classifier object which corresponds to the new (moved) interface position.
reinit_cut_vectorA Lambda function for the vector reinitialization.
setup_dof_systemSet up the dof system, this includes:
  • distribute DoFs on the new mesh
  • create partitioning for the new mesh
  • set up constraints on the new mesh
  • reinit the MatrixFree object for the new DoFs (ScratchData::build())
  • initialize all DoF vectors for the new DoF layout
attach_vectorsLambda function of type AttachDoFHandlerAndVectorsType, that attaches all DoFHandlers and their respective DoFVectors that ought to be reconstructed.

Member Data Documentation

◆ fe_degree

template<int dim, typename Number >
unsigned int MeltPoolDG::CutUtil::SolutionTransferOperator< dim, Number >::fe_degree
private

Finite element degree.

◆ ghost_penalty

template<int dim, typename Number >
const GhostPenaltyData<Number> MeltPoolDG::CutUtil::SolutionTransferOperator< dim, Number >::ghost_penalty
private

Ghost-penalty parameters for stabilization of cut elements.

◆ is_dg

template<int dim, typename Number >
bool MeltPoolDG::CutUtil::SolutionTransferOperator< dim, Number >::is_dg
private

Boolean indicator whether DG is used.

◆ is_two_phase

template<int dim, typename Number >
const bool MeltPoolDG::CutUtil::SolutionTransferOperator< dim, Number >::is_two_phase
private

Boolean indicator whether a two-phase case is considered.

◆ n_components_per_phase

template<int dim, typename Number >
unsigned int MeltPoolDG::CutUtil::SolutionTransferOperator< dim, Number >::n_components_per_phase
private

Components of the solution in one phase (for scalar-valued solutions: 1, for vector-valued solutions: >1)

◆ new_solutions

template<int dim, typename Number >
std::vector<VectorType> MeltPoolDG::CutUtil::SolutionTransferOperator< dim, Number >::new_solutions
private

Collection of extrapolated solution vectors.

◆ pcout

template<int dim, typename Number >
dealii::ConditionalOStream MeltPoolDG::CutUtil::SolutionTransferOperator< dim, Number >::pcout
private

Stream object for conditional output.

◆ verbosity

template<int dim, typename Number >
const unsigned int MeltPoolDG::CutUtil::SolutionTransferOperator< dim, Number >::verbosity
private

Verbosity level for output (0: nothing(=default), 1: something, 2: some more details)


The documentation for this class was generated from the following files: