OperationTypeErasure< dim, number > Class Template Reference

Developer Documentation: MeltPoolDG::CompressibleFlow::OperationTypeErasure< dim, number > Class Template Reference
Developer Documentation
MeltPoolDG::CompressibleFlow::OperationTypeErasure< dim, number > Class Template Reference

Common interface class for compressible flow operation classes based on the type erasure idiom. More...

#include <operation_type_erasure.hpp>

Classes

struct  OperationConcept
 Abstract base class defining the interface for compressible flow operations. More...
 
struct  OperationModel
 Concrete implementation of OperationConcept using a specific compressible flow operation type. More...
 

Public Types

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

Public Member Functions

 OperationTypeErasure ()=default
 Default constructor.
 
template<typename OperationType >
 OperationTypeErasure (std::unique_ptr< OperationType > &&operation)
 Constructor, takes ownership of the passed unique pointer.
 
void solve (const number current_time, const number time_step)
 Solves the compressible Navier-Stokes equations for a single time step.
 
void distribute_dofs (dealii::DoFHandler< dim > &dof_handler) const
 Distribute the degrees of freedom to the passed dof handler object.
 
void reinit ()
 Set up the required internal data structures.
 
void attach_output_vectors (GenericDataOut< dim, number > &data_out) const
 Attach the solution to the passed data out object.
 
number compute_time_step_size (const bool do_print=false) const
 Compute the maximum time step size.
 
void set_initial_condition (const dealii::Function< dim > &function)
 Set the solution vector to the passed initial flow field state.
 
void set_boundary_conditions (const std::shared_ptr< SimulationCaseBase< dim, number > > &simulation_case, const std::string &operation_name)
 Set the boundary conditions.
 
void set_body_force (std::unique_ptr< dealii::Function< dim > > body_force_in)
 Set a body force, e.g. gravity, specified by the passed function.
 
void add_external_force (std::shared_ptr< ExternalFlowForce< dim, number > > external_force_residuum, std::shared_ptr< ExternalFlowForceJacobian< dim, number > > external_force_jacobian=nullptr)
 
const dealii::DoFHandler< dim > & get_dof_handler () const
 Get a constant reference to the DoFHandler used in the current operation.
 
const VectorTypeget_solution () const
 Get a constant reference to the solution vector.
 
VectorTypeget_solution ()
 Get a reference to the solution vector.
 
bool is_initialized () const
 Check if the compressible flow operation is initialized,.
 
void clear ()
 Delete the compressible flow operation object stored in this class.
 

Private Attributes

std::unique_ptr< OperationConceptoperation_pimpl
 

Detailed Description

template<int dim, typename number>
class MeltPoolDG::CompressibleFlow::OperationTypeErasure< dim, number >

Common interface class for compressible flow operation classes based on the type erasure idiom.

Member Typedef Documentation

◆ VectorType

template<int dim, typename number >
using MeltPoolDG::CompressibleFlow::OperationTypeErasure< dim, number >::VectorType = dealii::LinearAlgebra::distributed::Vector<number>

Constructor & Destructor Documentation

◆ OperationTypeErasure() [1/2]

template<int dim, typename number >
MeltPoolDG::CompressibleFlow::OperationTypeErasure< dim, number >::OperationTypeErasure ( )
default

Default constructor.

◆ OperationTypeErasure() [2/2]

template<int dim, typename number >
template<typename OperationType >
MeltPoolDG::CompressibleFlow::OperationTypeErasure< dim, number >::OperationTypeErasure ( std::unique_ptr< OperationType > &&  operation)
inlineexplicit

Constructor, takes ownership of the passed unique pointer.

Parameters
operationUnique pointer to an operation object for a specific type of compressible flow operation.

Member Function Documentation

◆ add_external_force()

template<int dim, typename number >
void MeltPoolDG::CompressibleFlow::OperationTypeErasure< dim, number >::add_external_force ( std::shared_ptr< ExternalFlowForce< dim, number > >  external_force_residuum,
std::shared_ptr< ExternalFlowForceJacobian< dim, number > >  external_force_jacobian = nullptr 
)

◆ attach_output_vectors()

template<int dim, typename number >
void MeltPoolDG::CompressibleFlow::OperationTypeErasure< dim, number >::attach_output_vectors ( GenericDataOut< dim, number > &  data_out) const
inline

Attach the solution to the passed data out object.

Parameters
data_outObject to which the solution vector is attached.

◆ clear()

template<int dim, typename number >
void MeltPoolDG::CompressibleFlow::OperationTypeErasure< dim, number >::clear ( )
inline

Delete the compressible flow operation object stored in this class.

◆ compute_time_step_size()

template<int dim, typename number >
number MeltPoolDG::CompressibleFlow::OperationTypeErasure< dim, number >::compute_time_step_size ( const bool  do_print = false) const
inline

Compute the maximum time step size.

The maximum time step size arises from the convective and viscous time step limits. It is optionally printed to the console.

Parameters
do_printIf true, the time step limit is printed to the console.

◆ distribute_dofs()

template<int dim, typename number >
void MeltPoolDG::CompressibleFlow::OperationTypeErasure< dim, number >::distribute_dofs ( dealii::DoFHandler< dim > &  dof_handler) const
inline

Distribute the degrees of freedom to the passed dof handler object.

Parameters
dof_handlerDof handler object used for the compressible flow solver.

◆ get_dof_handler()

template<int dim, typename number >
const dealii::DoFHandler< dim > & MeltPoolDG::CompressibleFlow::OperationTypeErasure< dim, number >::get_dof_handler ( ) const
inline

Get a constant reference to the DoFHandler used in the current operation.

Returns
A constant reference to the dealii::DoFHandler object.

◆ get_solution() [1/2]

template<int dim, typename number >
VectorType & MeltPoolDG::CompressibleFlow::OperationTypeErasure< dim, number >::get_solution ( )
inline

Get a reference to the solution vector.

Returns
A reference to the solution vector.

◆ get_solution() [2/2]

template<int dim, typename number >
const VectorType & MeltPoolDG::CompressibleFlow::OperationTypeErasure< dim, number >::get_solution ( ) const
inline

Get a constant reference to the solution vector.

Returns
A constant reference to the solution vector.

◆ is_initialized()

template<int dim, typename number >
bool MeltPoolDG::CompressibleFlow::OperationTypeErasure< dim, number >::is_initialized ( ) const
inline

Check if the compressible flow operation is initialized,.

Check that the current object holds a valid pointer to any compressible flow operation object.

Returns
True if object holds a valid preconditioner object.

◆ reinit()

template<int dim, typename number >
void MeltPoolDG::CompressibleFlow::OperationTypeErasure< dim, number >::reinit ( )
inline

Set up the required internal data structures.

After a call to this function the solve() function of the class can be utilized.

◆ set_body_force()

template<int dim, typename number >
void MeltPoolDG::CompressibleFlow::OperationTypeErasure< dim, number >::set_body_force ( std::unique_ptr< dealii::Function< dim > >  body_force_in)
inline

Set a body force, e.g. gravity, specified by the passed function.

Parameters
body_force_inFunction specifying the body force.
Note
The function simply passes the parameters to the corresponding operator function.

◆ set_boundary_conditions()

template<int dim, typename number >
void MeltPoolDG::CompressibleFlow::OperationTypeErasure< dim, number >::set_boundary_conditions ( const std::shared_ptr< SimulationCaseBase< dim, number > > &  simulation_case,
const std::string &  operation_name 
)
inline

Set the boundary conditions.

Parameters
simulation_casedealii::Pointer to the considered simulation case class.
operation_nameString for the name of the considered operation.
Note
The function simply passes the parameters to the corresponding operation function.

◆ set_initial_condition()

template<int dim, typename number >
void MeltPoolDG::CompressibleFlow::OperationTypeErasure< dim, number >::set_initial_condition ( const dealii::Function< dim > &  function)
inline

Set the solution vector to the passed initial flow field state.

Parameters
functionInitial condition of the flow field.

◆ solve()

template<int dim, typename number >
void MeltPoolDG::CompressibleFlow::OperationTypeErasure< dim, number >::solve ( const number  current_time,
const number  time_step 
)
inline

Solves the compressible Navier-Stokes equations for a single time step.

Parameters
current_timeCurrent time at t^n.
time_stepCurrent time step size.

Member Data Documentation

◆ operation_pimpl

template<int dim, typename number >
std::unique_ptr<OperationConcept> MeltPoolDG::CompressibleFlow::OperationTypeErasure< dim, number >::operation_pimpl
private

Pointer to the actual compressible flow operation object to which the function calls are forwarded.


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