LifeV
|
HyperbolicSolver Implements an hyperbolic solver. More...
#include <HyperbolicSolver.hpp>
Protected Attributes | |
const UInt | M_me |
MPI process identifier. More... | |
MapEpetra | M_localMap |
Local map. More... | |
Displayer | M_displayer |
Parallel displayer. More... | |
const data_Type & | M_data |
Data for Darcy solvers. More... | |
Function_Type | M_source |
Source function. More... | |
Function_Type | M_mass |
Mass function, it does not depend on time. More... | |
bchandlerPtr_Type | M_BCh |
Bondary conditions handler. More... | |
bool | M_setBC |
Flag if the boundary conditions are setted or not. More... | |
Function_Type | M_initialSolution |
Function of initial solution. More... | |
fluxPtr_Type | M_numericalFlux |
Class of type AbstractNumericalFlux for local flux computations. More... | |
FESpace< Mesh, MapEpetra > & | M_FESpace |
Finite element space. More... | |
vectorPtr_Type | M_rhs |
Right hand side. More... | |
vectorPtr_Type | M_u |
Solution at current time step. More... | |
vectorPtr_Type | M_uOld |
Solution at previous time step. More... | |
vectorPtr_Type | M_globalFlux |
Computed numerical flux. More... | |
VectorElemental | M_localFlux |
Auxiliary vector for local fluxes. More... | |
std::vector< MatrixElemental > | M_elmatMass |
Vector of all local mass matrices, possibly with mass function. More... | |
Public Types | |
typedef std::function< Real(const Real &, const Real &, const Real &, const Real &, const UInt &) > | Function_Type |
typedef HyperbolicData< Mesh > | data_Type |
typedef BCHandler | bchandler_Type |
typedef std::shared_ptr< bchandler_Type > | bchandlerPtr_Type |
typedef SolverType::vector_type | vector_Type |
typedef std::shared_ptr< vector_Type > | vectorPtr_Type |
typedef Epetra_Comm | comm_Type |
typedef std::shared_ptr< comm_Type > | commPtr_Type |
typedef AbstractNumericalFlux< Mesh, SolverType > | flux_Type |
typedef std::shared_ptr< flux_Type > | fluxPtr_Type |
typedef Real | ghostData_Type |
typedef std::vector< ghostData_Type > | ghostDataContainer_Type |
typedef std::map< UInt, ghostDataContainer_Type > | buffer_Type |
typedef std::map< ID, ghostData_Type > | ghostDataMap_Type |
Constructors & Destructor | |
HyperbolicSolver (const data_Type &dataFile, FESpace< Mesh, MapEpetra > &fESpace, MapEpetra &ghostMap, bchandler_Type &bcHandler, commPtr_Type &comm) | |
Full constructor for the class. More... | |
HyperbolicSolver (const data_Type &dataFile, FESpace< Mesh, MapEpetra > &fESpace, MapEpetra &ghostMap, commPtr_Type &comm) | |
Constructor for the class without the definition of the boundary handler. More... | |
virtual | ~HyperbolicSolver () |
Virtual destructor. More... | |
Methods | |
void | setup () |
Setup the local mass matrices. More... | |
void | solveOneTimeStep () |
Solve one time step of the hyperbolic problem. More... | |
Real | CFL () |
Compute the global CFL condition. More... | |
Set Methos | |
void | setInitialSolution (const Function_Type &initialSolution) |
Set the initial solution for the computation. More... | |
void | setBoundaryCondition (bchandler_Type &bcHandler) |
Set the boundary conditions. More... | |
void | setSourceTerm (const Function_Type &source) |
Set the source term. More... | |
void | setMassTerm (const Function_Type &mass) |
Set the mass function term. More... | |
void | setNumericalFlux (const flux_Type &flux) |
Set the numerical flux. More... | |
void | setSolution (const vectorPtr_Type &solution) |
Set the solution vector. More... | |
Get Methods | |
const vectorPtr_Type & | solution () const |
Returns the solution vector. More... | |
bool | isBoundaryConditionSet () const |
Return if the bounday conditions is setted or not. More... | |
bchandlerPtr_Type & | boundaryConditionHandler () |
Return the boundary conditions handler. More... | |
MapEpetra const & | map () const |
Return the Epetra local map. More... | |
Displayer const & | getDisplayer () const |
Return the displayer. More... | |
Displayer & | getDisplayer () |
Returns displayer. More... | |
Protected Methods | |
void | localReconstruct (const UInt &Elem) |
Reconstruct locally the solution. More... | |
void | localEvolve (const UInt &iElem) |
Compute the local contribute. More... | |
void | localAverage (const UInt &iElem) |
Apply the flux limiters locally. More... | |
Private Constructors | |
HyperbolicSolver (const HyperbolicSolver< Mesh, SolverType > &) | |
Inhibited copy constructor. More... | |
Private Operators | |
HyperbolicSolver & | operator= (const HyperbolicSolver< Mesh, SolverType > &) |
Inhibited assign operator. More... | |
HyperbolicSolver Implements an hyperbolic solver.
This class implements an hyperbolic solver.
This class solves a general hyperbolic scalar equation in the conservative form: find such that
with prescribed inflow boundary conditions on
We have . Since this solver can be used coupled with an elliptic solver, the Neumann and Robin boundary are trated as outflow boundary, while the Dirichlet boundary is automatically dedived into outflow boundary and inflow boundary. This choice is due to the general form of the flux function .
Introducing a conforming triangolation of the domain , we write the strong formulation in a weak form in each element : give a test function
integrating by part the integral with the divergence we find
The Discontinuous Galerkin formulation of the problem is given approximating with a discontinuous finite element space , while the numerical flux at the boundaries is approximated using a suitable numerical scheme obtaining .
Summing on all the elements , the finite element problem reads: find such that
Each time step and mesh size are coupled via condition at step , using esplicit Euler scheme we find the relation between and satysfying .
A general form for computing the condition is
where
Local approximation for the flux function and the computation of are in NumericalFlux.hpp file.
Implement the forcing term and implement high order finite elements.
When we will pass to Trilinos >= 10.6 use Epetra wrapper for LAPACK functions.
Definition at line 122 of file HyperbolicSolver.hpp.
typedef std::function< Real ( const Real&, const Real&, const Real&, const Real&, const UInt& ) > Function_Type |
Definition at line 132 of file HyperbolicSolver.hpp.
typedef HyperbolicData< Mesh > data_Type |
Definition at line 134 of file HyperbolicSolver.hpp.
typedef BCHandler bchandler_Type |
Definition at line 136 of file HyperbolicSolver.hpp.
typedef std::shared_ptr< bchandler_Type > bchandlerPtr_Type |
Definition at line 137 of file HyperbolicSolver.hpp.
typedef SolverType::vector_type vector_Type |
Definition at line 139 of file HyperbolicSolver.hpp.
typedef std::shared_ptr< vector_Type > vectorPtr_Type |
Definition at line 140 of file HyperbolicSolver.hpp.
typedef Epetra_Comm comm_Type |
Definition at line 142 of file HyperbolicSolver.hpp.
typedef std::shared_ptr< comm_Type > commPtr_Type |
Definition at line 143 of file HyperbolicSolver.hpp.
typedef AbstractNumericalFlux<Mesh, SolverType> flux_Type |
Definition at line 145 of file HyperbolicSolver.hpp.
typedef std::shared_ptr< flux_Type > fluxPtr_Type |
Definition at line 146 of file HyperbolicSolver.hpp.
typedef Real ghostData_Type |
Definition at line 148 of file HyperbolicSolver.hpp.
typedef std::vector< ghostData_Type > ghostDataContainer_Type |
Definition at line 149 of file HyperbolicSolver.hpp.
typedef std::map< UInt, ghostDataContainer_Type > buffer_Type |
Definition at line 150 of file HyperbolicSolver.hpp.
typedef std::map< ID, ghostData_Type > ghostDataMap_Type |
Definition at line 151 of file HyperbolicSolver.hpp.
HyperbolicSolver | ( | const data_Type & | dataFile, |
FESpace< Mesh, MapEpetra > & | fESpace, | ||
MapEpetra & | ghostMap, | ||
bchandler_Type & | bcHandler, | ||
commPtr_Type & | comm | ||
) |
Full constructor for the class.
dataFile | Data for the problem. |
fESpace | Discontinuous finite element space. |
bcHandler | Boundary conditions for the problem. |
comm | Shared pointer of the Epetra communicator. |
Definition at line 421 of file HyperbolicSolver.hpp.
HyperbolicSolver | ( | const data_Type & | dataFile, |
FESpace< Mesh, MapEpetra > & | fESpace, | ||
MapEpetra & | ghostMap, | ||
commPtr_Type & | comm | ||
) |
Constructor for the class without the definition of the boundary handler.
dataFile | Data for the problem. |
fESpace | Discontinuous finite element space. |
comm | Shared pointer of the Epetra communicator. |
Definition at line 458 of file HyperbolicSolver.hpp.
|
virtual |
Virtual destructor.
Definition at line 493 of file HyperbolicSolver.hpp.
|
private |
Inhibited copy constructor.
void setup | ( | ) |
Setup the local mass matrices.
Definition at line 506 of file HyperbolicSolver.hpp.
void solveOneTimeStep | ( | ) |
Solve one time step of the hyperbolic problem.
Definition at line 575 of file HyperbolicSolver.hpp.
Real CFL | ( | ) |
Compute the global CFL condition.
Definition at line 629 of file HyperbolicSolver.hpp.
void setInitialSolution | ( | const Function_Type & | initialSolution | ) |
Set the initial solution for the computation.
Compute the initial solution as an interpolation on the analytical initial solution.
initialSolution | The initial solution function. |
Definition at line 760 of file HyperbolicSolver.hpp.
|
inline |
Set the boundary conditions.
bcHandler | Boundary condition handler for the problem. |
Definition at line 216 of file HyperbolicSolver.hpp.
|
inline |
Set the source term.
Definition at line 227 of file HyperbolicSolver.hpp.
|
inline |
Set the mass function term.
It does not depend on time. The default setted source term is .
mass | Mass term for the problem. |
Definition at line 237 of file HyperbolicSolver.hpp.
|
inline |
Set the numerical flux.
flux | The numerical flux class |
Definition at line 246 of file HyperbolicSolver.hpp.
|
inline |
Set the solution vector.
solution | Constant vector_type reference of the solution. |
Definition at line 256 of file HyperbolicSolver.hpp.
|
inline |
Returns the solution vector.
Definition at line 272 of file HyperbolicSolver.hpp.
|
inline |
Return if the bounday conditions is setted or not.
Definition at line 282 of file HyperbolicSolver.hpp.
|
inline |
Return the boundary conditions handler.
Definition at line 291 of file HyperbolicSolver.hpp.
|
inline |
Return the Epetra local map.
Definition at line 301 of file HyperbolicSolver.hpp.
|
inline |
Return the displayer.
Useful for parallel print in programs.
Definition at line 311 of file HyperbolicSolver.hpp.
|
inline |
Returns displayer.
Definition at line 320 of file HyperbolicSolver.hpp.
|
protected |
Reconstruct locally the solution.
Definition at line 784 of file HyperbolicSolver.hpp.
|
protected |
Compute the local contribute.
Definition at line 795 of file HyperbolicSolver.hpp.
|
protected |
Apply the flux limiters locally.
Definition at line 998 of file HyperbolicSolver.hpp.
|
private |
Inhibited assign operator.
|
protected |
MPI process identifier.
Definition at line 344 of file HyperbolicSolver.hpp.
|
protected |
Local map.
Definition at line 347 of file HyperbolicSolver.hpp.
|
protected |
Parallel displayer.
Definition at line 350 of file HyperbolicSolver.hpp.
|
protected |
Data for Darcy solvers.
Definition at line 353 of file HyperbolicSolver.hpp.
|
protected |
Source function.
Definition at line 356 of file HyperbolicSolver.hpp.
|
protected |
Mass function, it does not depend on time.
Definition at line 359 of file HyperbolicSolver.hpp.
|
protected |
Bondary conditions handler.
Definition at line 362 of file HyperbolicSolver.hpp.
|
protected |
Flag if the boundary conditions are setted or not.
Definition at line 365 of file HyperbolicSolver.hpp.
|
protected |
Function of initial solution.
Definition at line 368 of file HyperbolicSolver.hpp.
|
protected |
Class of type AbstractNumericalFlux for local flux computations.
Definition at line 371 of file HyperbolicSolver.hpp.
Finite element space.
Definition at line 374 of file HyperbolicSolver.hpp.
|
protected |
Right hand side.
Definition at line 377 of file HyperbolicSolver.hpp.
|
protected |
Solution at current time step.
Definition at line 380 of file HyperbolicSolver.hpp.
|
protected |
Solution at previous time step.
Definition at line 383 of file HyperbolicSolver.hpp.
|
protected |
Computed numerical flux.
Definition at line 386 of file HyperbolicSolver.hpp.
|
protected |
Auxiliary vector for local fluxes.
Definition at line 389 of file HyperbolicSolver.hpp.
|
protected |
Vector of all local mass matrices, possibly with mass function.
Definition at line 392 of file HyperbolicSolver.hpp.