AdvectionDiffusionOperation< dim, number > Class Template Reference
|
Developer Documentation
|
#include <advection_diffusion_operation.hpp>
Public Member Functions | |
| AdvectionDiffusionOperation (const ScratchData< dim, dim, number > &scratch_data_in, const std::map< dealii::types::boundary_id, std::shared_ptr< dealii::Function< dim > > > &dirichlet_bc_in, const AdvectionDiffusionData< number > &advec_diff_data_in, const TimeIntegration::TimeIterator< number > &time_iterator, const unsigned int advec_diff_dof_idx_in, const unsigned int advec_diff_hanging_nodes_dof_idx_in, const unsigned int advec_diff_quad_idx_in) | |
| void | set_initial_condition (const dealii::Function< dim > &initial_field_function) override |
| Set the initial condition for the advected field. | |
| virtual void | set_advection_velocity (const VectorType &advection_velocity, const unsigned int velocity_dof_idx) final |
| Provide the advection velocity from an existing vector. | |
| virtual void | set_advection_velocity_function (const std::shared_ptr< dealii::Function< dim, number > > &advection_velocity) final |
| Provide the advection velocity via a (possibly time-dependent) function. | |
| void | set_inflow_outflow_bc (const std::map< dealii::types::boundary_id, std::shared_ptr< dealii::Function< dim > > > inflow_outflow_bc_) |
| Set inflow/outflow boundary data (matrix-free mode only). | |
| void | setup_constraints (ScratchData< dim, dim, number > &mutable_scratch_data, const PeriodicBoundaryConditions< dim > &periodic_bc, const std::map< dealii::types::boundary_id, std::shared_ptr< dealii::Function< dim > > > &dirichlet_bc_in) final |
| Build and merge Dirichlet, hanging-node, and periodic constraints into an AffineConstraints object. | |
| void | reinit () override |
| Allocate and (re)initialize vectors and the underlying operator. | |
| void | init_time_advance () override |
| Prepare a time step: commit history, update constraints/BCs, build RHS, compute predictor. | |
| void | solve (const bool do_finish_time_step=true) override |
| Solve the linear system for the current time step. | |
| void | attach_vectors (std::vector< dealii::LinearAlgebra::distributed::Vector< number > * > &vectors) override |
| Register internal solution vectors for adaptive mesh refinement. | |
| void | attach_output_vectors (GenericDataOut< dim, number > &data_out) const override |
Attach output fields to a GenericDataOut object. | |
| const dealii::LinearAlgebra::distributed::Vector< number > & | get_advected_field () const override |
| Get the current advected field (const). | |
| dealii::LinearAlgebra::distributed::Vector< number > & | get_advected_field () override |
| Get the current advected field (mutable). | |
| const dealii::LinearAlgebra::distributed::Vector< number > & | get_advected_field_old () const override |
| Get the most recent old advected field (const). | |
| dealii::LinearAlgebra::distributed::Vector< number > & | get_advected_field_old () override |
| Get the most recent old advected field (mutable). | |
| dealii::LinearAlgebra::distributed::Vector< number > & | get_user_rhs () override |
| Get a mutable reference to the user-supplied RHS vector. | |
| const dealii::LinearAlgebra::distributed::Vector< number > & | get_user_rhs () const override |
| Get a const reference to the user-supplied RHS vector. | |
Public Member Functions inherited from MeltPoolDG::LevelSet::AdvectionDiffusionOperationBase< dim, number > | |
| virtual | ~AdvectionDiffusionOperationBase ()=default |
| virtual void | finish_time_advance () |
Private Types | |
| using | VectorType = dealii::LinearAlgebra::distributed::Vector< number > |
| using | BlockVectorType = dealii::LinearAlgebra::distributed::BlockVector< number > |
| using | SparseMatrixType = dealii::TrilinosWrappers::SparseMatrix |
Private Member Functions | |
| void | create_operator () |
| Instantiate and configure the underlying operator and preconditioner. | |
| void | create_inflow_outflow_constraints () |
| Build inflow constraints (matrix-free mode) and pass indices to the operator. | |
| void | commit_solution_history_and_compute_predictor () |
| Compute the predictor solution for the current time step and commit time history. | |
Private Attributes | |
| const ScratchData< dim, dim, number > & | scratch_data |
| Read-only access to FE, DoFHandlers, quadratures, MF data, timers, etc. | |
| const std::map< dealii::types::boundary_id, std::shared_ptr< dealii::Function< dim > > > & | dirichlet_bc |
| Dirichlet BC map provided at construction. | |
| std::unique_ptr< AdvectionDiffusionOperator< dim, number > > | advec_diff_operator |
| Concrete advection–diffusion operator. | |
| const TimeIntegration::TimeIterator< number > & | time_iterator |
| Time iterator reference. | |
| const unsigned int | advec_diff_dof_idx = 0 |
| const unsigned int | advec_diff_quad_idx = 0 |
| const unsigned int | advec_diff_hanging_nodes_dof_idx = dealii::numbers::invalid_unsigned_int |
| std::shared_ptr< dealii::Function< dim, number > > | advection_velocity_function = nullptr |
| Optional velocity function (alternative to advection_velocity). | |
| const dealii::LinearAlgebra::distributed::Vector< number > * | advection_velocity = nullptr |
| Optional pointer to an externally provided velocity vector. | |
| unsigned int | velocity_dof_idx = dealii::numbers::invalid_unsigned_int |
| DoFHandler index corresponding to advection_velocity. | |
| TimeIntegration::SolutionHistory< VectorType > | solution_history |
| History of solution vectors used by the predictor and time integrator. | |
| std::unique_ptr< Predictor< VectorType, number > > | predictor |
| Predictor used to extrapolate the solution for the current step. | |
| VectorType | solution_advected_field_extrapolated |
| Extrapolated advected field from the predictor. | |
| Preconditioner< dim, VectorType, number > | preconditioner |
| Preconditioner wrapper (matrix-based or matrix-free). | |
| VectorType | rhs |
| System right-hand side. | |
| VectorType | user_rhs |
| User-supplied right-hand side (added to the system RHS). | |
| bool | update_ghosts = false |
| Whether we updated ghost values for the old solution in init_time_advance(). | |
| std::map< dealii::types::boundary_id, std::shared_ptr< dealii::Function< dim > > > | inflow_outflow_bc |
| Inflow/outflow boundary data: boundary id → Dirichlet value function. | |
| std::pair< std::vector< unsigned int >, std::vector< number > > | inflow_constraints_indices_and_values |
| Indices/values used to enforce inflow constraints in matrix-free mode. | |
Additional Inherited Members | |
Public Attributes inherited from MeltPoolDG::LevelSet::AdvectionDiffusionOperationBase< dim, number > | |
| AdvectionDiffusionData< number > | advec_diff_data |
Protected Attributes inherited from MeltPoolDG::LevelSet::AdvectionDiffusionOperationBase< dim, number > | |
| bool | ready_for_time_advance = false |
| determine whether solution vectors are prepared for time advance | |
Member Typedef Documentation
◆ BlockVectorType
|
private |
◆ SparseMatrixType
|
private |
◆ VectorType
|
private |
Constructor & Destructor Documentation
◆ AdvectionDiffusionOperation()
| MeltPoolDG::LevelSet::AdvectionDiffusionOperation< dim, number >::AdvectionDiffusionOperation | ( | const ScratchData< dim, dim, number > & | scratch_data_in, |
| const std::map< dealii::types::boundary_id, std::shared_ptr< dealii::Function< dim > > > & | dirichlet_bc_in, | ||
| const AdvectionDiffusionData< number > & | advec_diff_data_in, | ||
| const TimeIntegration::TimeIterator< number > & | time_iterator, | ||
| const unsigned int | advec_diff_dof_idx_in, | ||
| const unsigned int | advec_diff_hanging_nodes_dof_idx_in, | ||
| const unsigned int | advec_diff_quad_idx_in | ||
| ) |
Member Function Documentation
◆ attach_output_vectors()
|
overridevirtual |
Attach output fields to a GenericDataOut object.
Adds the current advected field and the user-supplied RHS for visualization/output.
- Parameters
-
data_out Output aggregator.
Implements MeltPoolDG::LevelSet::AdvectionDiffusionOperationBase< dim, number >.
◆ attach_vectors()
|
overridevirtual |
Register internal solution vectors for adaptive mesh refinement.
- Parameters
-
vectors Vector of pointers to which internal solution vectors are appended.
Implements MeltPoolDG::LevelSet::AdvectionDiffusionOperationBase< dim, number >.
◆ commit_solution_history_and_compute_predictor()
|
private |
Compute the predictor solution for the current time step and commit time history.
◆ create_inflow_outflow_constraints()
|
private |
Build inflow constraints (matrix-free mode) and pass indices to the operator.
Collects face-DoF indices where \( \boldsymbol{n}\cdot\boldsymbol{u} \le 0 \) and associates them with values from inflow_outflow_bc.
- Note
- No-op if inflow_outflow_bc is empty.
◆ create_operator()
|
private |
Instantiate and configure the underlying operator and preconditioner.
Requires a valid advection velocity (vector or function) to be set.
◆ get_advected_field() [1/2]
|
overridevirtual |
Get the current advected field (const).
Implements MeltPoolDG::LevelSet::AdvectionDiffusionOperationBase< dim, number >.
◆ get_advected_field() [2/2]
|
overridevirtual |
Get the current advected field (mutable).
Implements MeltPoolDG::LevelSet::AdvectionDiffusionOperationBase< dim, number >.
◆ get_advected_field_old() [1/2]
|
overridevirtual |
Get the most recent old advected field (const).
Implements MeltPoolDG::LevelSet::AdvectionDiffusionOperationBase< dim, number >.
◆ get_advected_field_old() [2/2]
|
overridevirtual |
Get the most recent old advected field (mutable).
Implements MeltPoolDG::LevelSet::AdvectionDiffusionOperationBase< dim, number >.
◆ get_user_rhs() [1/2]
|
overridevirtual |
Get a const reference to the user-supplied RHS vector.
Implements MeltPoolDG::LevelSet::AdvectionDiffusionOperationBase< dim, number >.
◆ get_user_rhs() [2/2]
|
overridevirtual |
Get a mutable reference to the user-supplied RHS vector.
Implements MeltPoolDG::LevelSet::AdvectionDiffusionOperationBase< dim, number >.
◆ init_time_advance()
|
overridevirtual |
Prepare a time step: commit history, update constraints/BCs, build RHS, compute predictor.
Sets up the step according to the current TimeIterator and the configured predictor. May create inflow/outflow constraints (matrix-free).
Implements MeltPoolDG::LevelSet::AdvectionDiffusionOperationBase< dim, number >.
◆ reinit()
|
overridevirtual |
Allocate and (re)initialize vectors and the underlying operator.
Initializes solution history vectors, right-hand-side, and preconditioner state. Must be called after velocity and constraints are set.
Implements MeltPoolDG::LevelSet::AdvectionDiffusionOperationBase< dim, number >.
◆ set_advection_velocity()
|
finalvirtual |
Provide the advection velocity from an existing vector.
- Parameters
-
advection_velocity Vector with velocity DoFs (compatible partitioning). velocity_dof_idx DoFHandler index in ScratchDatafor this vector.
- Note
- Mutually exclusive with set_advection_velocity_function(). One of them must be called before reinit() / init_time_advance() / solve().
Reimplemented from MeltPoolDG::LevelSet::AdvectionDiffusionOperationBase< dim, number >.
◆ set_advection_velocity_function()
|
finalvirtual |
Provide the advection velocity via a (possibly time-dependent) function.
- Parameters
-
advection_velocity Shared pointer to a dealii::Function returning a vector field.
- Note
- Mutually exclusive with set_advection_velocity(). One of them must be called before reinit() / init_time_advance() / solve().
Reimplemented from MeltPoolDG::LevelSet::AdvectionDiffusionOperationBase< dim, number >.
◆ set_inflow_outflow_bc()
| void MeltPoolDG::LevelSet::AdvectionDiffusionOperation< dim, number >::set_inflow_outflow_bc | ( | const std::map< dealii::types::boundary_id, std::shared_ptr< dealii::Function< dim > > > | inflow_outflow_bc_ | ) |
Set inflow/outflow boundary data (matrix-free mode only).
When provided, the operator enforces inflow constraints at faces where \( \boldsymbol{n}\cdot\boldsymbol{u} \le 0 \) using the supplied boundary functions. Outflow is left unconstrained.
- Parameters
-
inflow_outflow_bc_ Map of boundary id to scalar boundary function.
- Note
- Only supported when the linear solver runs in matrix-free mode.
◆ set_initial_condition()
|
overridevirtual |
Set the initial condition for the advected field.
Interpolates initial_field_function into the current solution, distributes constraints, and initializes the most recent "old" state.
- Parameters
-
initial_field_function Function describing the initial state.
Implements MeltPoolDG::LevelSet::AdvectionDiffusionOperationBase< dim, number >.
◆ setup_constraints()
|
finalvirtual |
Build and merge Dirichlet, hanging-node, and periodic constraints into an AffineConstraints object.
Populates constraints for the selected DoFHandler indices on mutable_scratch_data. Periodic constraints are merged into the Dirichlet set when applicable.
- Parameters
-
mutable_scratch_data ScratchData container to be modified. periodic_bc Periodic boundary condition descriptor. dirichlet_bc_in Dirichlet BC map (may override constructor map if time-dependent).
Implements MeltPoolDG::LevelSet::AdvectionDiffusionOperationBase< dim, number >.
◆ solve()
|
overridevirtual |
Solve the linear system for the current time step.
Dispatches to matrix-free or matrix-based path depending on configuration, applies preconditioner, enforces constraints, prints diagnostics, and optionally finalizes the time step.
- Parameters
-
do_finish_time_step If true, performs post-processing and advances the time integrator state.
Implements MeltPoolDG::LevelSet::AdvectionDiffusionOperationBase< dim, number >.
Member Data Documentation
◆ advec_diff_dof_idx
|
private |
◆ advec_diff_hanging_nodes_dof_idx
|
private |
◆ advec_diff_operator
|
private |
Concrete advection–diffusion operator.
User-configured via AdvectionDiffusionData; created in create_operator().
◆ advec_diff_quad_idx
|
private |
◆ advection_velocity
|
private |
Optional pointer to an externally provided velocity vector.
◆ advection_velocity_function
|
private |
Optional velocity function (alternative to advection_velocity).
◆ dirichlet_bc
|
private |
Dirichlet BC map provided at construction.
◆ inflow_constraints_indices_and_values
|
private |
Indices/values used to enforce inflow constraints in matrix-free mode.
The first vector holds local indices into the partitioner; the second stores the corresponding boundary values.
◆ inflow_outflow_bc
|
private |
Inflow/outflow boundary data: boundary id → Dirichlet value function.
◆ preconditioner
|
private |
Preconditioner wrapper (matrix-based or matrix-free).
◆ predictor
|
private |
Predictor used to extrapolate the solution for the current step.
◆ rhs
|
private |
System right-hand side.
◆ scratch_data
|
private |
Read-only access to FE, DoFHandlers, quadratures, MF data, timers, etc.
◆ solution_advected_field_extrapolated
|
private |
Extrapolated advected field from the predictor.
◆ solution_history
|
private |
History of solution vectors used by the predictor and time integrator.
◆ time_iterator
|
private |
Time iterator reference.
◆ update_ghosts
|
private |
Whether we updated ghost values for the old solution in init_time_advance().
◆ user_rhs
|
private |
User-supplied right-hand side (added to the system RHS).
◆ velocity_dof_idx
|
private |
DoFHandler index corresponding to advection_velocity.
The documentation for this class was generated from the following files:
- include/meltpooldg/level_set/advection_diffusion_operation.hpp
- source/level_set/advection_diffusion_operation.cpp
Generated by
Public Member Functions inherited from