HArD::Core2D
Hybrid Arbitrary Degree::Core 2D - Library to implement 2D schemes with edge and cell polynomials as unknowns
Classes | Typedefs | Functions
LEPNC

Implementations of the Locally Enriched Polytopal Non-Conforming method. More...

Classes

class  HArDCore2D::LEPNC_diffusion
 The LEPNC_diffusion class provides an implementation of the LEPNC method for the stationnary diffusion problem \(-div(K\nabla u)=f\). More...
 
class  HArDCore2D::LEPNC_StefanPME
 LEPNC scheme for diffusion equation \(u - \div(K \nabla(\zeta(u))) = f\). More...
 
class  HArDCore2D::LEPNC_StefanPME_Transient
 LEPNC scheme for diffusion equation \(\partial_t u - \div(K \nabla(\zeta(u))) = f\). More...
 
class  HArDCore2D::LEPNCCore
 

Typedefs

using HArDCore2D::LEPNC_diffusion::solution_function_type = std::function< double(double, double)>
 type for solution More...
 
using HArDCore2D::LEPNC_diffusion::source_function_type = std::function< double(double, double, Cell *)>
 type for source More...
 
using HArDCore2D::LEPNC_diffusion::grad_function_type = std::function< VectorRd(double, double, Cell *)>
 type for gradient More...
 
using HArDCore2D::LEPNC_diffusion::tensor_function_type = std::function< Eigen::Matrix2d(double, double, Cell *)>
 type for diffusion tensor More...
 
using HArDCore2D::LEPNC_StefanPME::solution_function_type = std::function< double(double, double)>
 type for solution More...
 
using HArDCore2D::LEPNC_StefanPME::source_function_type = std::function< double(double, double, Cell *)>
 type for source More...
 
using HArDCore2D::LEPNC_StefanPME::grad_function_type = std::function< VectorRd(double, double, Cell *)>
 type for gradient More...
 
using HArDCore2D::LEPNC_StefanPME::tensor_function_type = std::function< Eigen::Matrix2d(double, double, Cell *)>
 type for diffusion tensor More...
 
using HArDCore2D::LEPNC_StefanPME_Transient::solution_function_type = std::function< double(const double &, const VectorRd &)>
 type for solution More...
 
using HArDCore2D::LEPNC_StefanPME_Transient::source_function_type = std::function< double(const double &, const VectorRd &, const Cell *)>
 type for source More...
 
using HArDCore2D::LEPNC_StefanPME_Transient::grad_function_type = std::function< VectorRd(const double &, const VectorRd &, const Cell *)>
 type for gradient More...
 
using HArDCore2D::LEPNC_StefanPME_Transient::tensor_function_type = std::function< Eigen::Matrix2d(const double, const double, const Cell *)>
 type for diffusion tensor (does not depend on time) More...
 
using HArDCore2D::LEPNCCore::cell_basis_type = std::function< double(double, double)>
 type for cell basis More...
 
using HArDCore2D::LEPNCCore::cell_gradient_type = std::function< VectorRd(double, double)>
 type for gradients of cell basis More...
 

Functions

 HArDCore2D::LEPNC_diffusion::LEPNC_diffusion (LEPNCCore &nc, tensor_function_type kappa, size_t deg_kappa, source_function_type source, BoundaryConditions BC, solution_function_type exact_solution, grad_function_type grad_exact_solution, std::string solver_type, std::ostream &output=std::cout)
 Constructor of the class. More...
 
Eigen::VectorXd HArDCore2D::LEPNC_diffusion::solve ()
 Assemble and solve the scheme. More...
 
double HArDCore2D::LEPNC_diffusion::EnergyNorm (const Eigen::VectorXd Xh) const
 Discrete energy norm (associated to the diffusion operator) More...
 
double HArDCore2D::LEPNC_diffusion::get_assembly_time () const
 cpu time to assemble the scheme More...
 
double HArDCore2D::LEPNC_diffusion::get_solving_time () const
 cpu time to solve the scheme More...
 
double HArDCore2D::LEPNC_diffusion::get_solving_error () const
 residual after solving the scheme More...
 
double HArDCore2D::LEPNC_diffusion::get_itime (size_t idx) const
 various intermediate assembly times More...
 
 HArDCore2D::LEPNC_StefanPME::LEPNC_StefanPME (LEPNCCore &nc, tensor_function_type kappa, size_t deg_kappa, source_function_type source, BoundaryConditions BC, solution_function_type exact_solution, grad_function_type grad_exact_solution, TestCaseNonLinearity::nonlinearity_function_type zeta, double weight, std::string solver_type, std::ostream &output=std::cout)
 Constructor of the class. More...
 
Eigen::VectorXd HArDCore2D::LEPNC_StefanPME::solve ()
 Assemble and solve the scheme. More...
 
Eigen::VectorXd HArDCore2D::LEPNC_StefanPME::apply_nonlinearity (const Eigen::VectorXd &Y, const std::string type) const
 Compute non-linearity on vector (depends if weight=0, weight=1 or weight\in (0,1) ) More...
 
double HArDCore2D::LEPNC_StefanPME::L2_MassLumped (const Eigen::VectorXd Xh) const
 Mass-lumped L2 norm of a function given by a vector. More...
 
double HArDCore2D::LEPNC_StefanPME::EnergyNorm (const Eigen::VectorXd Xh) const
 Discrete energy norm (associated to the diffusion operator) More...
 
double HArDCore2D::LEPNC_StefanPME::get_assembly_time () const
 cpu time to assemble the scheme More...
 
double HArDCore2D::LEPNC_StefanPME::get_solving_time () const
 cpu time to solve the scheme More...
 
double HArDCore2D::LEPNC_StefanPME::get_solving_error () const
 residual after solving the scheme More...
 
double HArDCore2D::LEPNC_StefanPME::get_itime (size_t idx) const
 various intermediate assembly times More...
 
 HArDCore2D::LEPNC_StefanPME_Transient::LEPNC_StefanPME_Transient (LEPNCCore &nc, tensor_function_type kappa, size_t deg_kappa, source_function_type source, BoundaryConditions BC, solution_function_type exact_solution, grad_function_type grad_exact_solution, TestCaseNonLinearity::nonlinearity_function_type zeta, double weight, std::string solver_type, std::ostream &output=std::cout)
 Constructor of the class. More...
 
Eigen::VectorXd HArDCore2D::LEPNC_StefanPME_Transient::iterate (const double tps, const double dt, const Eigen::VectorXd Xn)
 Execute one time iteration. More...
 
Eigen::VectorXd HArDCore2D::LEPNC_StefanPME_Transient::apply_nonlinearity (const Eigen::VectorXd &Y, const std::string type) const
 Compute non-linearity on vector (depends if weight=0, weight=1 or weight\in (0,1) ) More...
 
double HArDCore2D::LEPNC_StefanPME_Transient::L2_MassLumped (const Eigen::VectorXd Xh) const
 Mass-lumped L2 norm of a function given by a vector. More...
 
double HArDCore2D::LEPNC_StefanPME_Transient::Lp_MassLumped (const Eigen::VectorXd Xh, double p) const
 Mass-lumped Lp norm of a function given by a vector. More...
 
double HArDCore2D::LEPNC_StefanPME_Transient::EnergyNorm (const Eigen::VectorXd Xh) const
 Discrete energy norm (associated to the diffusion operator) More...
 
double HArDCore2D::LEPNC_StefanPME_Transient::get_assembly_time () const
 cpu time to assemble the scheme More...
 
double HArDCore2D::LEPNC_StefanPME_Transient::get_solving_time () const
 cpu time to solve the scheme More...
 
double HArDCore2D::LEPNC_StefanPME_Transient::get_itime (size_t idx) const
 various intermediate assembly times More...
 
double HArDCore2D::LEPNC_StefanPME_Transient::get_solving_error () const
 residual after solving the scheme More...
 
size_t HArDCore2D::LEPNC_StefanPME_Transient::get_nb_newton () const
 number of Newton iterations More...
 
Eigen::MatrixXd HArDCore2D::LEPNC_StefanPME_Transient::get_MassT (size_t iT) const
 Mass matrix in cell iT. More...
 
 HArDCore2D::LEPNCCore::LEPNCCore (const Mesh *mesh_ptr, const size_t K, const size_t L, std::ostream &output=std::cout)
 Class constructor: initialise the LEPNCCore class, and creates non-conforming basis functions (and gradients) More...
 
const cell_basis_typeHArDCore2D::LEPNCCore::nc_basis (size_t iT, size_t i) const
 Return a reference to the i'th non-conforming basis function of the cell iT. More...
 
const cell_gradient_typeHArDCore2D::LEPNCCore::nc_gradient (size_t iT, size_t i) const
 Return a reference to the gradient of the i'th non-conforming basis function of the cell iT. More...
 
const VectorRd HArDCore2D::LEPNCCore::ml_node (size_t iT, size_t i) const
 Return the i'th nodal point in cell iT (for mass lumping) More...
 
const std::vector< Eigen::ArrayXd > HArDCore2D::LEPNCCore::nc_basis_quad (const size_t iT, const QuadratureRule quad) const
 Computes non-conforming basis functions at the given quadrature nodes. More...
 
const std::vector< Eigen::ArrayXXd > HArDCore2D::LEPNCCore::grad_nc_basis_quad (const size_t iT, const QuadratureRule quad) const
 Compute \((\nabla \phi_i^{nc})_{i\in I}\) at the quadrature nodes, where \((\phi_i^{nc})_{i\in I}\) are the cell basis functions. More...
 
Eigen::MatrixXd HArDCore2D::LEPNCCore::gram_matrix (const std::vector< Eigen::ArrayXd > &f_quad, const std::vector< Eigen::ArrayXd > &g_quad, const size_t &nrows, const size_t &ncols, const QuadratureRule &quad, const bool &sym, std::vector< double > L2weight={}) const
 
Eigen::MatrixXd HArDCore2D::LEPNCCore::gram_matrix (const std::vector< Eigen::ArrayXXd > &F_quad, const std::vector< Eigen::ArrayXXd > &G_quad, const size_t &nrows, const size_t &ncols, const QuadratureRule &quad, const bool &sym, std::vector< Eigen::Matrix2d > L2Weight={}) const
 Overloaded version of the previous one for vector-valued functions: the functions (F_i) and (G_j) are vector-valued functions. More...
 
template<typename Function >
Eigen::VectorXd HArDCore2D::LEPNCCore::nc_interpolate_moments (const Function &f, size_t doe) const
 Interpolates a continuous function on the degrees of freedom, using the moments on the basis functions. The first ones are the cell DOFs (DimPoly<Cell>(1) for each cell), the last ones are the edge DOFs (one for each edge) More...
 
template<typename Function >
Eigen::VectorXd HArDCore2D::LEPNCCore::nc_interpolate_ml (const Function &f, size_t doe) const
 Interpolates a continuous function on the degrees of freedom, using the moments on the basis functions associated to the edges and the nodal values (corresponding to mass-lumping) on the cell basis functions. The first ones are the cell DOFs (DimPoly<Cell>(1) for each cell), the last ones are the edge DOFs (one for each edge) More...
 
Eigen::VectorXd HArDCore2D::LEPNCCore::nc_restr (const Eigen::VectorXd &Xh, size_t iT) const
 Extract from a global vector Xh of unknowns the non-conforming unknowns corresponding to cell iT. More...
 
double HArDCore2D::LEPNCCore::nc_L2norm (const Eigen::VectorXd &Xh) const
 Compute L2 norm of a discrete function (given by coefficients on the basis functions) More...
 
double HArDCore2D::LEPNCCore::nc_L2norm_ml (const Eigen::VectorXd &Xh) const
 Compute L2 norm of the mass-lumped discrete function (given by coefficients on the basis functions) More...
 
double HArDCore2D::LEPNCCore::nc_H1norm (const Eigen::VectorXd &Xh) const
 Compute broken H1 norm of a discrete function (given by coefficients on the basis functions) More...
 
double HArDCore2D::LEPNCCore::nc_evaluate_in_cell (const Eigen::VectorXd XTF, size_t iT, double x, double y) const
 Evaluates a non-conforming discrete function in the cell iT at point (x,y) More...
 
Eigen::VectorXd HArDCore2D::LEPNCCore::nc_VertexValues (const Eigen::VectorXd Xh, const double weight=0)
 From a non-conforming discrete function, computes a vector of values at the vertices of the mesh. More...
 

Detailed Description

Implementations of the Locally Enriched Polytopal Non-Conforming method.

Locally Enriched Polytopal Non-Conforming method.

Typedef Documentation

◆ cell_basis_type

using HArDCore2D::LEPNCCore::cell_basis_type = std::function<double(double, double)>

type for cell basis

◆ cell_gradient_type

type for gradients of cell basis

◆ grad_function_type [1/3]

type for gradient

◆ grad_function_type [2/3]

type for gradient

◆ grad_function_type [3/3]

type for gradient

◆ solution_function_type [1/3]

type for solution

◆ solution_function_type [2/3]

type for solution

◆ solution_function_type [3/3]

type for solution

◆ source_function_type [1/3]

type for source

◆ source_function_type [2/3]

type for source

◆ source_function_type [3/3]

using HArDCore2D::LEPNC_StefanPME_Transient::source_function_type = std::function<double(const double&, const VectorRd&, const Cell*)>

type for source

◆ tensor_function_type [1/3]

using HArDCore2D::LEPNC_diffusion::tensor_function_type = std::function<Eigen::Matrix2d(double,double,Cell*)>

type for diffusion tensor

◆ tensor_function_type [2/3]

using HArDCore2D::LEPNC_StefanPME::tensor_function_type = std::function<Eigen::Matrix2d(double,double,Cell*)>

type for diffusion tensor

◆ tensor_function_type [3/3]

using HArDCore2D::LEPNC_StefanPME_Transient::tensor_function_type = std::function<Eigen::Matrix2d(const double, const double, const Cell*)>

type for diffusion tensor (does not depend on time)

Function Documentation

◆ apply_nonlinearity() [1/2]

Eigen::VectorXd HArDCore2D::LEPNC_StefanPME::apply_nonlinearity ( const Eigen::VectorXd &  Y,
const std::string  type 
) const

Compute non-linearity on vector (depends if weight=0, weight=1 or weight\in (0,1) )

◆ apply_nonlinearity() [2/2]

Eigen::VectorXd HArDCore2D::LEPNC_StefanPME_Transient::apply_nonlinearity ( const Eigen::VectorXd &  Y,
const std::string  type 
) const

Compute non-linearity on vector (depends if weight=0, weight=1 or weight\in (0,1) )

◆ EnergyNorm() [1/3]

double HArDCore2D::LEPNC_diffusion::EnergyNorm ( const Eigen::VectorXd  Xh) const

Discrete energy norm (associated to the diffusion operator)

◆ EnergyNorm() [2/3]

double HArDCore2D::LEPNC_StefanPME::EnergyNorm ( const Eigen::VectorXd  Xh) const

Discrete energy norm (associated to the diffusion operator)

◆ EnergyNorm() [3/3]

double HArDCore2D::LEPNC_StefanPME_Transient::EnergyNorm ( const Eigen::VectorXd  Xh) const

Discrete energy norm (associated to the diffusion operator)

◆ get_assembly_time() [1/3]

double HArDCore2D::LEPNC_diffusion::get_assembly_time ( ) const

cpu time to assemble the scheme

◆ get_assembly_time() [2/3]

double HArDCore2D::LEPNC_StefanPME::get_assembly_time ( ) const

cpu time to assemble the scheme

◆ get_assembly_time() [3/3]

double HArDCore2D::LEPNC_StefanPME_Transient::get_assembly_time ( ) const
inline

cpu time to assemble the scheme

◆ get_itime() [1/3]

double HArDCore2D::LEPNC_diffusion::get_itime ( size_t  idx) const

various intermediate assembly times

◆ get_itime() [2/3]

double HArDCore2D::LEPNC_StefanPME::get_itime ( size_t  idx) const

various intermediate assembly times

◆ get_itime() [3/3]

double HArDCore2D::LEPNC_StefanPME_Transient::get_itime ( size_t  idx) const
inline

various intermediate assembly times

◆ get_MassT()

Eigen::MatrixXd HArDCore2D::LEPNC_StefanPME_Transient::get_MassT ( size_t  iT) const
inline

Mass matrix in cell iT.

◆ get_nb_newton()

size_t HArDCore2D::LEPNC_StefanPME_Transient::get_nb_newton ( ) const
inline

number of Newton iterations

◆ get_solving_error() [1/3]

double HArDCore2D::LEPNC_diffusion::get_solving_error ( ) const

residual after solving the scheme

◆ get_solving_error() [2/3]

double HArDCore2D::LEPNC_StefanPME::get_solving_error ( ) const

residual after solving the scheme

◆ get_solving_error() [3/3]

double HArDCore2D::LEPNC_StefanPME_Transient::get_solving_error ( ) const
inline

residual after solving the scheme

◆ get_solving_time() [1/3]

double HArDCore2D::LEPNC_diffusion::get_solving_time ( ) const

cpu time to solve the scheme

◆ get_solving_time() [2/3]

double HArDCore2D::LEPNC_StefanPME::get_solving_time ( ) const

cpu time to solve the scheme

◆ get_solving_time() [3/3]

double HArDCore2D::LEPNC_StefanPME_Transient::get_solving_time ( ) const
inline

cpu time to solve the scheme

◆ grad_nc_basis_quad()

const std::vector< Eigen::ArrayXXd > HArDCore2D::LEPNCCore::grad_nc_basis_quad ( const size_t  iT,
const QuadratureRule  quad 
) const

Compute \((\nabla \phi_i^{nc})_{i\in I}\) at the quadrature nodes, where \((\phi_i^{nc})_{i\in I}\) are the cell basis functions.

Returns
Dnc_phi_quad[i]: array of size 2*nbq (where nbq=nb of quadrature nodes), with each column being \(\nabla \phi_i^{nc}\) at the corresponding quadrature node
Parameters
iTglobal index of the cell
quadquadrature rules in the cell

◆ gram_matrix() [1/2]

Eigen::MatrixXd HArDCore2D::LEPNCCore::gram_matrix ( const std::vector< Eigen::ArrayXd > &  f_quad,
const std::vector< Eigen::ArrayXd > &  g_quad,
const size_t &  nrows,
const size_t &  ncols,
const QuadratureRule quad,
const bool &  sym,
std::vector< double >  L2weight = {} 
) const

Create the matrix of L2 products of two families (f_i) and (g_j) of functions (this is not really a Gram matrix, unless the two families are the same)

Returns
The matrix \((\int f_i g_j)_{i=1\ldots nrows; j=1\ldots ncols}\)

Create the matrix of L2 products of two families (f_i) and (g_j) of functions (this is not really a Gram matrix, unless the two families are the same)

Parameters
f_quadValues of functions (f1,f2,...) at the quadrature nodes
g_quadValues of functions (g1,g2,...) at the quadrature nodes
nrowsNumber of rows of the matrix - typically number of functions f_i (but could be less)
ncolsNumber of columns of the matrix - typically number of functions g_j (but could be less)
quadQuadrature nodes for integration
symTrue if the matrix is pseudo-symmetric (that is, #f<=#g and f_i=g_i if i<=#f)
L2weightOptional weight for the L2 product. If provided, should be a std::vector<double> of the weight at the quadrature nodes

◆ gram_matrix() [2/2]

Eigen::MatrixXd HArDCore2D::LEPNCCore::gram_matrix ( const std::vector< Eigen::ArrayXXd > &  F_quad,
const std::vector< Eigen::ArrayXXd > &  G_quad,
const size_t &  nrows,
const size_t &  ncols,
const QuadratureRule quad,
const bool &  sym,
std::vector< Eigen::Matrix2d >  L2Weight = {} 
) const

Overloaded version of the previous one for vector-valued functions: the functions (F_i) and (G_j) are vector-valued functions.

Returns
The matrix \((\int F_i \cdot G_j)_{i=1\ldots nrows; j=1\ldots ncols}\)
Parameters
F_quadValues of functions (F1,F2,...) at the quadrature nodes
G_quadValues of functions (G1,G2,...) at the quadrature nodes
nrowsNumber of rows of the matrix - typically number of functions F_i (but could be less)
ncolsNumber of rows of the matrix - typically number of functions G_j (but could be less)
quadQuadrature nodes for integration
symTrue if the matrix is pseudo-symmetric (that is, #F<=#G and F_i=G_i if i<=#F)
L2WeightOptional weight for the L2 product. If provided, should be a std::vector<Eigen::Matrix2d> of the weight at the quadrature nodes

◆ iterate()

Eigen::VectorXd HArDCore2D::LEPNC_StefanPME_Transient::iterate ( const double  tps,
const double  dt,
const Eigen::VectorXd  Xn 
)

Execute one time iteration.

Parameters
tpscurrent time (for computing source)
dttime step
XnUnkown at previous time step

◆ L2_MassLumped() [1/2]

double HArDCore2D::LEPNC_StefanPME::L2_MassLumped ( const Eigen::VectorXd  Xh) const

Mass-lumped L2 norm of a function given by a vector.

◆ L2_MassLumped() [2/2]

double HArDCore2D::LEPNC_StefanPME_Transient::L2_MassLumped ( const Eigen::VectorXd  Xh) const

Mass-lumped L2 norm of a function given by a vector.

◆ LEPNC_diffusion()

HArDCore2D::LEPNC_diffusion::LEPNC_diffusion ( LEPNCCore nc,
tensor_function_type  kappa,
size_t  deg_kappa,
source_function_type  source,
BoundaryConditions  BC,
solution_function_type  exact_solution,
grad_function_type  grad_exact_solution,
std::string  solver_type,
std::ostream &  output = std::cout 
)

Constructor of the class.

Parameters
ncinstance of the core nonconforming class (with basis functions, etc.)
kappadiffusion tensor
deg_kappapolynomial degree of the diffusion tensor
sourcesource term
BCtype of boundary conditions
exact_solutionexact solution
grad_exact_solutiongradient of the exact solution
solver_typetype of solver to use for the global system (bicgstab at the moment)
outputoptional argument for output of messages

◆ LEPNC_StefanPME()

HArDCore2D::LEPNC_StefanPME::LEPNC_StefanPME ( LEPNCCore nc,
tensor_function_type  kappa,
size_t  deg_kappa,
source_function_type  source,
BoundaryConditions  BC,
solution_function_type  exact_solution,
grad_function_type  grad_exact_solution,
TestCaseNonLinearity::nonlinearity_function_type  zeta,
double  weight,
std::string  solver_type,
std::ostream &  output = std::cout 
)

Constructor of the class.

Parameters
ncinstance of the core nonconforming class (with basis functions, etc.)
kappadiffusion tensor
deg_kappapolynomial degree of the diffusion tensor
sourcesource term
BCtype of boundary conditions
exact_solutionexact solution
grad_exact_solutiongradient of the exact solution
zetafunction describing the nonlinearity
weightproportion of weight (between 0 and 1) of mass-lumping on the edges
solver_typetype of solver to use for the global system (bicgstab at the moment)
outputoptional argument for output of messages

◆ LEPNC_StefanPME_Transient()

HArDCore2D::LEPNC_StefanPME_Transient::LEPNC_StefanPME_Transient ( LEPNCCore nc,
tensor_function_type  kappa,
size_t  deg_kappa,
source_function_type  source,
BoundaryConditions  BC,
solution_function_type  exact_solution,
grad_function_type  grad_exact_solution,
TestCaseNonLinearity::nonlinearity_function_type  zeta,
double  weight,
std::string  solver_type,
std::ostream &  output = std::cout 
)

Constructor of the class.

Parameters
ncinstance of the core nonconforming class (with basis functions, etc.)
kappadiffusion tensor
deg_kappapolynomial degree of the diffusion tensor
sourcesource term
BCtype of boundary conditions
exact_solutionexact solution
grad_exact_solutiongradient of the exact solution
zetafunction describing the nonlinearity
weightproportion of weight (between 0 and 1) of mass-lumping on the edges
solver_typetype of solver to use for the global system (bicgstab at the moment)
outputoptional argument for output of messages

◆ LEPNCCore()

HArDCore2D::LEPNCCore::LEPNCCore ( const Mesh mesh_ptr,
const size_t  K,
const size_t  L,
std::ostream &  output = std::cout 
)

Class constructor: initialise the LEPNCCore class, and creates non-conforming basis functions (and gradients)

Parameters
mesh_ptrA pointer to the loaded mesh
KThe degree of the edge polynomials
LThe degree of the cell polynomials
outputOptional argument for specifying outputs of messages.

◆ Lp_MassLumped()

double HArDCore2D::LEPNC_StefanPME_Transient::Lp_MassLumped ( const Eigen::VectorXd  Xh,
double  p 
) const

Mass-lumped Lp norm of a function given by a vector.

◆ ml_node()

const VectorRd HArDCore2D::LEPNCCore::ml_node ( size_t  iT,
size_t  i 
) const
inline

Return the i'th nodal point in cell iT (for mass lumping)

Parameters
iTThe global region number of the cell
iThe index of the desired nodal point

◆ nc_basis()

const LEPNCCore::cell_basis_type & HArDCore2D::LEPNCCore::nc_basis ( size_t  iT,
size_t  i 
) const
inline

Return a reference to the i'th non-conforming basis function of the cell iT.

For i=DimPoly<Cell>(1) to nedge-1, nc_basis(iT,i) is the basis function associated with edge i (that is, product of all distances to all other edges, scaled to have an integral over edge i equal to 1). For i=0, ..., DimPoly<Cell>(1)-1 the basis function corresponds to 1, x, y, to which we subtract a linear combination of the basis functions corresponding to the edge in order to obtain basis functions with a zero integral on each edge

Parameters
iTThe global region number of the cell
iThe index of the desired basis function

◆ nc_basis_quad()

const std::vector< Eigen::ArrayXd > HArDCore2D::LEPNCCore::nc_basis_quad ( const size_t  iT,
const QuadratureRule  quad 
) const

Computes non-conforming basis functions at the given quadrature nodes.

Returns
nc_phi_quad[i] = array listing the nbq (=nb of quadrature nodes) values of the nonconforming \(\phi^{nc}_i\) basis function at the quadrature nodes
Parameters
iTglobal index of the cell/edge
quadquadrature nodes and weights on the cell/edge

◆ nc_evaluate_in_cell()

double HArDCore2D::LEPNCCore::nc_evaluate_in_cell ( const Eigen::VectorXd  XTF,
size_t  iT,
double  x,
double  y 
) const

Evaluates a non-conforming discrete function in the cell iT at point (x,y)

◆ nc_gradient()

const LEPNCCore::cell_gradient_type & HArDCore2D::LEPNCCore::nc_gradient ( size_t  iT,
size_t  i 
) const
inline

Return a reference to the gradient of the i'th non-conforming basis function of the cell iT.

The gradient functions are indexed the same as the basis functions.

Parameters
iTThe global region number of the cell
iThe index of the desired basis function

◆ nc_H1norm()

double HArDCore2D::LEPNCCore::nc_H1norm ( const Eigen::VectorXd &  Xh) const

Compute broken H1 norm of a discrete function (given by coefficients on the basis functions)

◆ nc_interpolate_ml()

template<typename Function >
Eigen::VectorXd HArDCore2D::LEPNCCore::nc_interpolate_ml ( const Function f,
size_t  doe 
) const

Interpolates a continuous function on the degrees of freedom, using the moments on the basis functions associated to the edges and the nodal values (corresponding to mass-lumping) on the cell basis functions. The first ones are the cell DOFs (DimPoly<Cell>(1) for each cell), the last ones are the edge DOFs (one for each edge)

Returns
XTF = vector of coefficients on the basis functions; the first "DimPoly<Cell>(1)*nb cells" correspond to the first three basis functions in each cell (1, x, y with adjustments for the averages on the edges and mass-lumping points), and the last "nb edges" to the edge basis functions.

◆ nc_interpolate_moments()

template<typename Function >
Eigen::VectorXd HArDCore2D::LEPNCCore::nc_interpolate_moments ( const Function f,
size_t  doe 
) const

Interpolates a continuous function on the degrees of freedom, using the moments on the basis functions. The first ones are the cell DOFs (DimPoly<Cell>(1) for each cell), the last ones are the edge DOFs (one for each edge)

◆ nc_L2norm()

double HArDCore2D::LEPNCCore::nc_L2norm ( const Eigen::VectorXd &  Xh) const

Compute L2 norm of a discrete function (given by coefficients on the basis functions)

◆ nc_L2norm_ml()

double HArDCore2D::LEPNCCore::nc_L2norm_ml ( const Eigen::VectorXd &  Xh) const

Compute L2 norm of the mass-lumped discrete function (given by coefficients on the basis functions)

◆ nc_restr()

Eigen::VectorXd HArDCore2D::LEPNCCore::nc_restr ( const Eigen::VectorXd &  Xh,
size_t  iT 
) const

Extract from a global vector Xh of unknowns the non-conforming unknowns corresponding to cell iT.

Returns
XTF = vector of coefficients on the basis functions; the first "DimPoly<Cell>(1)*nb cells" correspond to the first three basis functions in each cell (1, x, y with adjustments for the averages on the edges and mass-lumping points), and the last "nb edges" to the edge basis functions.

◆ nc_VertexValues()

Eigen::VectorXd HArDCore2D::LEPNCCore::nc_VertexValues ( const Eigen::VectorXd  Xh,
const double  weight = 0 
)

From a non-conforming discrete function, computes a vector of values at the vertices of the mesh.

Parameters
Xhnon-conforming function (coefficients on basis)
weightweight put on the edge values when evaluating the functions at the vertices

◆ solve() [1/2]

Eigen::VectorXd HArDCore2D::LEPNC_diffusion::solve ( )

Assemble and solve the scheme.

◆ solve() [2/2]

Eigen::VectorXd HArDCore2D::LEPNC_StefanPME::solve ( )

Assemble and solve the scheme.