Matrix Free Solver 1.0.0
A matrix free solver for the Advection Diffusion Reaction problem implemented with deal.II
Loading...
Searching...
No Matches
DTR Class Reference

Class managing the differential problem. More...

#include <DTR.hpp>

Classes

class  DiffusionCoefficient
 
class  DirichletBC1
 
class  DirichletBC2
 
class  ExactSolution
 
class  ForcingTerm
 
class  NeumannBC1
 
class  NeumannBC2
 
class  ReactionCoefficient
 
class  TransportCoefficient
 

Public Member Functions

 DTR (const unsigned int &r_, std::ofstream &dimension_time_file)
 Constructor with a file stream for timing information.
 
 DTR (const unsigned int &r_)
 Constructor without a file stream for timing information.
 
void setup (unsigned int n_initial_refinements=8)
 Initialization of the system.
 
void assemble ()
 Assembly of the system matrix and right-hand side vector.
 
void solve ()
 Solution of the linear system.
 
void output () const
 Output of the solution to a file.
 
double compute_error (const VectorTools::NormType &norm_type) const
 Compute the error of the solution.
 
 DTR (const unsigned int &r_, std::ofstream &dimension_time_file)
 
 DTR (const unsigned int &r_)
 
void setup (unsigned int n_initial_refinements=8)
 
void assemble ()
 
void solve ()
 
void output () const
 
double compute_error (const VectorTools::NormType &norm_type) const
 

Static Public Attributes

static constexpr unsigned int dim = 2
 Physical dimension (1D, 2D, 3D)
 

Protected Attributes

const std::string mesh_file_name
 Path to the mesh file.
 
const unsigned int r
 Polynomial degree.
 
const unsigned int mpi_size
 Number of MPI processes.
 
const unsigned int mpi_rank
 Rank of this MPI process.
 
problem_data::DiffusionCoefficient< dimdiffusion_coefficient
 Diffusion coefficient.
 
problem_data::ReactionCoefficient< dimreaction_coefficient
 Reaction coefficient.
 
problem_data::TransportCoefficient< dimtransport_coefficient
 Transport coefficient.
 
problem_data::ForcingTerm< dimforcing_term
 Forcing term.
 
problem_data::DirichletBC1< dimdirichletBC1
 Dirichlet boundary conditions for the left and bottom boundaries.
 
problem_data::DirichletBC2< dimdirichletBC2
 Dirichlet boundary conditions for the right and top boundaries.
 
problem_data::NeumannBC1< dimneumannBC1
 Neumann boundary conditions for the right and top boundaries.
 
problem_data::NeumannBC2< dimneumannBC2
 Neumann boundary conditions for the left and bottom boundaries.
 
parallel::fullydistributed::Triangulation< dimmesh
 Triangulation object for managing the mesh.
 
std::unique_ptr< FiniteElement< dim > > fe
 Finite element space.
 
std::unique_ptr< Quadrature< dim > > quadrature
 Quadrature formula for integration.
 
std::unique_ptr< Quadrature< dim - 1 > > quadrature_boundary
 Quadrature formula for boundary integration.
 
DoFHandler< dimdof_handler
 DoF handler for managing degrees of freedom.
 
TrilinosWrappers::SparseMatrix system_matrix
 System matrix.
 
TrilinosWrappers::MPI::Vector system_rhs
 System right-hand side vector.
 
TrilinosWrappers::MPI::Vector solution
 Solution vector.
 
ConditionalOStream pcout
 Parallel output stream.
 
ConditionalOStream time_details
 Output stream for timing details.
 
IndexSet locally_owned_dofs
 Index set for locally owned degrees of freedom.
 
double setup_time
 Time taken for setup.
 
DiffusionCoefficient diffusion_coefficient
 
ReactionCoefficient reaction_coefficient
 
TransportCoefficient transport_coefficient
 
ForcingTerm forcing_term
 
DirichletBC1 dirichletBC1
 
DirichletBC2 dirichletBC2
 
NeumannBC1 neumannBC1
 
NeumannBC2 neumannBC2
 

Detailed Description

Class managing the differential problem.

This class handles the setup, assembly, solution, and output of a differential problem using the deal.II library. It supports parallel computation using MPI.

Class managing the differential problem.

Constructor & Destructor Documentation

◆ DTR() [1/4]

DTR::DTR ( const unsigned int & r_,
std::ofstream & dimension_time_file )

Constructor with a file stream for timing information.

Parameters
r_Polynomial degree of the finite element basis functions.
dimension_time_fileOutput file stream for logging timing information.

◆ DTR() [2/4]

DTR::DTR ( const unsigned int & r_)

Constructor without a file stream for timing information.

Parameters
r_Polynomial degree of the finite element basis functions.

◆ DTR() [3/4]

DTR::DTR ( const unsigned int & r_,
std::ofstream & dimension_time_file )
inline

◆ DTR() [4/4]

DTR::DTR ( const unsigned int & r_)
inline

Member Function Documentation

◆ assemble() [1/2]

void DTR::assemble ( )

Assembly of the system matrix and right-hand side vector.

◆ assemble() [2/2]

void DTR::assemble ( )

◆ compute_error() [1/2]

double DTR::compute_error ( const VectorTools::NormType & norm_type) const

Compute the error of the solution.

This function computes the error of the numerical solution with respect to an exact solution.

Parameters
norm_typeThe type of norm to use for error computation.
Returns
The computed error.

◆ compute_error() [2/2]

double DTR::compute_error ( const VectorTools::NormType & norm_type) const

◆ output() [1/2]

void DTR::output ( ) const

Output of the solution to a file.

This function writes the solution to a VTK file for visualization.

◆ output() [2/2]

void DTR::output ( ) const

◆ setup() [1/2]

void DTR::setup ( unsigned int n_initial_refinements = 8)

Initialization of the system.

This function sets up the triangulation, DoF handler, and system matrices.

Parameters
n_initial_refinementsNumber of initial mesh refinements.

◆ setup() [2/2]

void DTR::setup ( unsigned int n_initial_refinements = 8)

◆ solve() [1/2]

void DTR::solve ( )

Solution of the linear system.

◆ solve() [2/2]

void DTR::solve ( )

Member Data Documentation

◆ diffusion_coefficient [1/2]

problem_data::DiffusionCoefficient<dim> DTR::diffusion_coefficient
protected

Diffusion coefficient.

◆ diffusion_coefficient [2/2]

DiffusionCoefficient DTR::diffusion_coefficient
protected

◆ dim

static constexpr unsigned int DTR::dim = 2
staticconstexpr

Physical dimension (1D, 2D, 3D)

◆ dirichletBC1 [1/2]

problem_data::DirichletBC1<dim> DTR::dirichletBC1
protected

Dirichlet boundary conditions for the left and bottom boundaries.

◆ dirichletBC1 [2/2]

DirichletBC1 DTR::dirichletBC1
protected

◆ dirichletBC2 [1/2]

problem_data::DirichletBC2<dim> DTR::dirichletBC2
protected

Dirichlet boundary conditions for the right and top boundaries.

◆ dirichletBC2 [2/2]

DirichletBC2 DTR::dirichletBC2
protected

◆ dof_handler

DoFHandler< dim > DTR::dof_handler
protected

DoF handler for managing degrees of freedom.

◆ fe

std::unique_ptr< FiniteElement< dim > > DTR::fe
protected

Finite element space.

◆ forcing_term [1/2]

problem_data::ForcingTerm<dim> DTR::forcing_term
protected

Forcing term.

◆ forcing_term [2/2]

ForcingTerm DTR::forcing_term
protected

◆ locally_owned_dofs

IndexSet DTR::locally_owned_dofs
protected

Index set for locally owned degrees of freedom.

◆ mesh

parallel::fullydistributed::Triangulation< dim > DTR::mesh
protected

Triangulation object for managing the mesh.

◆ mesh_file_name

const std::string DTR::mesh_file_name
protected

Path to the mesh file.

◆ mpi_rank

const unsigned int DTR::mpi_rank
protected

Rank of this MPI process.

◆ mpi_size

const unsigned int DTR::mpi_size
protected

Number of MPI processes.

◆ neumannBC1 [1/2]

problem_data::NeumannBC1<dim> DTR::neumannBC1
protected

Neumann boundary conditions for the right and top boundaries.

◆ neumannBC1 [2/2]

NeumannBC1 DTR::neumannBC1
protected

◆ neumannBC2 [1/2]

problem_data::NeumannBC2<dim> DTR::neumannBC2
protected

Neumann boundary conditions for the left and bottom boundaries.

◆ neumannBC2 [2/2]

NeumannBC2 DTR::neumannBC2
protected

◆ pcout

ConditionalOStream DTR::pcout
protected

Parallel output stream.

◆ quadrature

std::unique_ptr< Quadrature< dim > > DTR::quadrature
protected

Quadrature formula for integration.

◆ quadrature_boundary

std::unique_ptr< Quadrature< dim - 1 > > DTR::quadrature_boundary
protected

Quadrature formula for boundary integration.

◆ r

const unsigned int DTR::r
protected

Polynomial degree.

◆ reaction_coefficient [1/2]

problem_data::ReactionCoefficient<dim> DTR::reaction_coefficient
protected

Reaction coefficient.

◆ reaction_coefficient [2/2]

ReactionCoefficient DTR::reaction_coefficient
protected

◆ setup_time

double DTR::setup_time
protected

Time taken for setup.

◆ solution

TrilinosWrappers::MPI::Vector DTR::solution
protected

Solution vector.

◆ system_matrix

TrilinosWrappers::SparseMatrix DTR::system_matrix
protected

System matrix.

◆ system_rhs

TrilinosWrappers::MPI::Vector DTR::system_rhs
protected

System right-hand side vector.

◆ time_details

ConditionalOStream DTR::time_details
protected

Output stream for timing details.

◆ transport_coefficient [1/2]

problem_data::TransportCoefficient<dim> DTR::transport_coefficient
protected

Transport coefficient.

◆ transport_coefficient [2/2]

TransportCoefficient DTR::transport_coefficient
protected

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