27#ifndef LAPLACE_DG_HPP_
28#define LAPLACE_DG_HPP_
33#include "../source/DUBValues.hpp"
34#include "../source/DUB_FEM_handler.hpp"
35#include "../source/assemble_DG.hpp"
36#include "../source/face_handler_DG.hpp"
37#include "../source/model_DG.hpp"
38#include "../source/volume_handler_DG.hpp"
39#include "source/core_model.hpp"
40#include "source/geometry/mesh_handler.hpp"
41#include "source/init.hpp"
42#include "source/io/data_writer.hpp"
43#include "source/numerics/bc_handler.hpp"
44#include "source/numerics/linear_solver_handler.hpp"
45#include "source/numerics/preconditioner_handler.hpp"
46#include "source/numerics/tools.hpp"
60 : lifex::utils::FunctionDirichlet()
65 value(
const dealii::Point<lifex::dim> &
p,
66 const unsigned int = 0)
const override
69 return std::exp(
p[0] +
p[1]);
71 return std::exp(
p[0] +
p[1] +
p[2]);
83 : Function<lifex::
dim>()
88 value(
const dealii::Point<lifex::dim> &
p,
89 const unsigned int = 0)
const override
92 return -2 * std::exp(
p[0] +
p[1]);
94 return -3 * std::exp(
p[0] +
p[1] +
p[2]);
106 : Function<lifex::
dim>()
111 value(
const dealii::Point<lifex::dim> &
p,
112 const unsigned int component = 0)
const override
117 return std::exp(
p[0] +
p[1]);
119 return std::exp(
p[0] +
p[1]);
124 return std::exp(
p[0] +
p[1] +
p[2]);
126 return std::exp(
p[0] +
p[1] +
p[2]);
128 return std::exp(
p[0] +
p[1] +
p[2]);
160 template <
class basis>
168 this->
u_ex = std::make_shared<laplace_DG::ExactSolution>();
169 this->
grad_u_ex = std::make_shared<laplace_DG::GradExactSolution>();
170 this->
f_ex = std::make_shared<laplace_DG::RightHandSide>();
179 template <
class basis>
216 std::vector<lifex::types::global_dof_index>
dof_indices(
219 for (
const auto &cell : this->
dof_handler.active_cell_iterators())
221 if (cell->is_locally_owned())
229 this->
matrix.add(dof_indices,
V);
232 for (
const auto &edge : cell->face_indices())
241 if (!cell->at_boundary(edge))
248 const auto neighcell = cell->neighbor(edge);
264 cell_rhs_edge = this->
assemble->local_rhs_edge_dirichlet(
276 this->
matrix.compress(dealii::VectorOperation::add);
277 this->
rhs.compress(dealii::VectorOperation::add);
Class to solve the heat equation using the Discontinuous Galerkin method.
Class to solve the Laplace equation using the Discontinuous Galerkin method.
void assemble_system() override
Assembly of the linear system.
ExactSolution()
Constructor.
virtual double value(const dealii::Point< lifex::dim > &p, const unsigned int=0) const override
Evaluate the exact solution in a point.
Gradient of the exact solution.
virtual double value(const dealii::Point< lifex::dim > &p, const unsigned int component=0) const override
Evaluate the gradient of the exact solution in a point.
GradExactSolution()
Constructor.
virtual double value(const dealii::Point< lifex::dim > &p, const unsigned int=0) const override
Evaluate the source term in a point.
RightHandSide()
Constructor.
Class representing the resolution of problems using discontinuous Galerkin methods.
lifex::LinAlg::MPI::SparseMatrix matrix
Distributed matrix of the linear system.
double prm_stability_coeff
DG stabilty coefficient.
std::unique_ptr< AssembleDG< basis > > assemble
Matrix assembler.
DoFHandlerDG< basis > dof_handler
DoFHandler (internal use for useful already implemented methods).
std::shared_ptr< dealii::Function< lifex::dim > > f_ex
Known forcing term.
double prm_penalty_coeff
DG Penalty coefficient.
std::shared_ptr< dealii::Function< lifex::dim > > grad_u_ex
Pointer to exact gradient solution Function.
unsigned int dofs_per_cell
Number of degrees of freedom per cell.
std::shared_ptr< lifex::utils::FunctionDirichlet > u_ex
Pointer to exact solution function.
lifex::LinAlg::MPI::Vector rhs
Distributed right hand side vector of the linear system.