HArD::Core3D
Hybrid Arbitrary Degree::Core 3D - Library to implement 3D schemes with vertex, edge, face and cell polynomials as unknowns
Loading...
Searching...
No Matches
Classes | Typedefs | Functions
HHO3D

Class providing helper methods and assemble and solve routines for general 3D HHO schemes. More...

Classes

class  HHO3D
 

Typedefs

typedef std::function< Eigen::MatrixXd(Cell *, ElementQuad &)> MatrixFType
 type for the global operator as a function of a Cell and an ElementQuad
 
typedef std::function< Eigen::VectorXd(Cell *, ElementQuad &)> VectorFType
 type for the load vector as a function of a Cell and an ElementQuad
 

Functions

 HHO3D::HHO3D (HybridCore &, const size_t, const size_t, const bool use_threads=true, size_t doeT=0, size_t doeF=0)
 Class constructor: initialises the model by providing a HybridCore object, and the exact solution and boundary conditions of the model.
 
void HHO3D::assemble ()
 A general assemble routine that calculates the statically condensed matrices required by solve.
 
UVector HHO3D::solve ()
 Solves the statically condensed system.
 
UVector HHO3D::neumann_solve ()
 Solves the system when the model is ill posed (not yet running)
 
double HHO3D::energy_norm (const UVector)
 Returns the energy norm of a given UVector.
 
void HHO3D::set_global_operator (const MatrixFType &)
 Set the global operator.
 
void HHO3D::set_load_vector (const VectorFType &)
 Set the load vector.
 
void HHO3D::plot (const std::string, const UVector &, const FType< double > &)
 Plot the numerical and exact solutions.
 
VectorFType HHO3D::standard_load_vector (const CellFType< double > &)
 Returns the standard load vector (f, v_T)_T with no Neumann boundary conditions.
 
VectorFType HHO3D::standard_load_vector (const CellFType< double > &, const CellFType< VectorRd > &, const BoundaryConditions &)
 Returns the standard load vector (f, v_T)_T.
 
VectorFType HHO3D::standard_load_vector (const CellFType< double > &, const FType< double > &, const BoundaryConditions &)
 Returns the standard load vector (f, v_T)_T.
 
void HHO3D::set_dirichlet (const FType< double > &, const size_t)
 Set the Dirichlet boundary conditions.
 
void HHO3D::set_dirichlet (const size_t)
 Set the Dirichlet boundary condition to zero.
 
Eigen::SparseMatrix< doubleHHO3D::get_SysMat ()
 Return the (statically condensed) matrix system.
 
double HHO3D::get_assembly_time () const
 CPU time to assemble the scheme.
 
double HHO3D::get_solving_time () const
 CPU time to solve the scheme.
 
double HHO3D::get_solving_error () const
 Residual after solving the scheme.
 

Detailed Description

Class providing helper methods and assemble and solve routines for general 3D HHO schemes.

Typedef Documentation

◆ MatrixFType

typedef std::function<Eigen::MatrixXd(Cell *, ElementQuad &)> MatrixFType

type for the global operator as a function of a Cell and an ElementQuad

The HHO3D class contains methods applicable to a general 3D HHO model. It contains assemble and solve routines usable by any scheme. The global operator and load vector are passed to the model through setters and are then accessible by assemble and solve. The class also contains helper methods for writing HHO schemes.

◆ VectorFType

typedef std::function<Eigen::VectorXd(Cell *, ElementQuad &)> VectorFType

type for the load vector as a function of a Cell and an ElementQuad

Function Documentation

◆ assemble()

void HHO3D::assemble ( )

A general assemble routine that calculates the statically condensed matrices required by solve.

◆ energy_norm()

double HHO3D::energy_norm ( const UVector  Xh)

Returns the energy norm of a given UVector.

◆ get_assembly_time()

double HHO3D::get_assembly_time ( ) const
inline

CPU time to assemble the scheme.

◆ get_solving_error()

double HHO3D::get_solving_error ( ) const
inline

Residual after solving the scheme.

◆ get_solving_time()

double HHO3D::get_solving_time ( ) const
inline

CPU time to solve the scheme.

◆ get_SysMat()

Eigen::SparseMatrix< double > HHO3D::get_SysMat ( )
inline

Return the (statically condensed) matrix system.

◆ HHO3D()

HHO3D::HHO3D ( HybridCore hho,
const size_t  L,
const size_t  K,
const bool  use_threads = true,
size_t  doeT = 0,
size_t  doeF = 0 
)

Class constructor: initialises the model by providing a HybridCore object, and the exact solution and boundary conditions of the model.

Parameters
hhoA reference to the HybridCore object containing mesh data
LCell polynomial degree
KFace polynomial degree
use_threadsOptional argument to indicate if threads should be used
doeTOptional argument to set cell quadrature degree. Default is L + K + 1
doeFOptional argument to set face quadrature degree. Default is 2 * K + 1

◆ neumann_solve()

UVector HHO3D::neumann_solve ( )

Solves the system when the model is ill posed (not yet running)

◆ plot()

void HHO3D::plot ( const std::string  plot_file,
const UVector sol,
const FType< double > &  exact_sol 
)

Plot the numerical and exact solutions.

Parameters
plot_filePlot file
solNumerical solution
exact_solExact solution

◆ set_dirichlet() [1/2]

void HHO3D::set_dirichlet ( const FType< double > &  f,
const size_t  n_dir_faces 
)

Set the Dirichlet boundary conditions.

Parameters
fFunction on the Dirichlet BC faces
n_dir_facesNumber of Dirichlet faces

◆ set_dirichlet() [2/2]

void HHO3D::set_dirichlet ( const size_t  n_dir_faces)

Set the Dirichlet boundary condition to zero.

Parameters
n_dir_facesNumber of Dirichlet faces

◆ set_global_operator()

void HHO3D::set_global_operator ( const MatrixFType AT)

Set the global operator.

◆ set_load_vector()

void HHO3D::set_load_vector ( const VectorFType bT)

Set the load vector.

◆ solve()

UVector HHO3D::solve ( )

Solves the statically condensed system.

◆ standard_load_vector() [1/3]

VectorFType HHO3D::standard_load_vector ( const CellFType< double > &  source)

Returns the standard load vector (f, v_T)_T with no Neumann boundary conditions.

Parameters
sourceSource term

◆ standard_load_vector() [2/3]

VectorFType HHO3D::standard_load_vector ( const CellFType< double > &  source,
const CellFType< VectorRd > &  f,
const BoundaryConditions BC 
)

Returns the standard load vector (f, v_T)_T.

Parameters
sourceSource term
fGradient to be dotted with the normal vector on each Neumann face
BCA reference to the BC to determine Neumann faces

◆ standard_load_vector() [3/3]

VectorFType HHO3D::standard_load_vector ( const CellFType< double > &  source,
const FType< double > &  f,
const BoundaryConditions BC 
)

Returns the standard load vector (f, v_T)_T.

Parameters
sourceSource term
fFunction on the Neumann BC faces
BCA reference to the BC to determine Neumann faces