LehrFEM++ 1.0.0
A simple Finite Element Library for teaching
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
projects::hldo_sphere::debugging::WhitneyOneBasisExpansionCoeffs Class Reference

Class to find the "best" basisexpansion coefficients with the analytical solution. More...

#include </home/nico/bildung/SemVI/thesis/lehrfempp/projects/hldo_sphere/debugging/whitney_one_basis_expansion_coeffs.h>

Public Member Functions

 WhitneyOneBasisExpansionCoeffs ()
 Constructor. More...
 
void Compute ()
 Computes the "best" basisexpansion coefficients. More...
 
void SetFunction (std::function< Eigen::Matrix< double, 3, 1 >(const Eigen::Matrix< double, 3, 1 > &)> u)
 Sets the analytical solution. More...
 
void SetMesh (std::shared_ptr< const lf::mesh::Mesh > mesh)
 
Eigen::VectorXd GetMu ()
 returns basis expansion coefficients computed in Compute More...
 
double GetL2Error ()
 returns L2 Error between the approximation and the analytical solution More...
 
double GetSquaredResidualError ()
 returns the squared sum of all residuals at the edge midpoints, this is the quanity minimized in the computation. More...
 

Static Public Member Functions

static void Experiemnt (unsigned refinement_level, std::function< Eigen::Vector3d(const Eigen::Vector3d &)> u)
 

Private Attributes

std::function< Eigen::Matrix< double, 3, 1 >(const Eigen::Matrix< double, 3, 1 > &)> u_
 
Eigen::VectorXd mu_
 
Eigen::VectorXd res_
 
std::shared_ptr< const lf::mesh::Meshmesh_
 

Detailed Description

Class to find the "best" basisexpansion coefficients with the analytical solution.

The best basis expansion coefficients are defined as the coefficients with the smallest sum of residuals when compared to the analytical solution evaluated at the edge midpoints.

The exact evaluation is not possible because we have three times as many constraints as coefficients when choosing to evaluate at the edge midpoints.

Definition at line 45 of file whitney_one_basis_expansion_coeffs.h.

Constructor & Destructor Documentation

◆ WhitneyOneBasisExpansionCoeffs()

projects::hldo_sphere::debugging::WhitneyOneBasisExpansionCoeffs::WhitneyOneBasisExpansionCoeffs ( )
inline

Constructor.

Assigns zero function as analytical solution can be set with set function.

Definition at line 53 of file whitney_one_basis_expansion_coeffs.h.

References mesh_, mu_, res_, projects::hldo_sphere::mesh::SphereTriagMeshBuilder::setRefinementLevel(), and u_.

Member Function Documentation

◆ Compute()

void projects::hldo_sphere::debugging::WhitneyOneBasisExpansionCoeffs::Compute ( )
inline

Computes the "best" basisexpansion coefficients.

Best in the sense of smallest sum of residuals error when evaluating at the edge midpoints

requires the mesh and the analytical functor to be set beforehand.

Definition at line 82 of file whitney_one_basis_expansion_coeffs.h.

References lf::assemble::COOMatrix< SCALAR >::AddToEntry(), lf::uscalfe::FeLagrangeO1Tria< SCALAR >::GradientsReferenceShapeFunctions(), lf::base::RefEl::kTria(), lf::assemble::COOMatrix< SCALAR >::makeSparse(), mesh_, mu_, lf::base::RefEl::RefEl(), res_, lf::mesh::to_sign(), and u_.

Referenced by Experiemnt().

◆ Experiemnt()

static void projects::hldo_sphere::debugging::WhitneyOneBasisExpansionCoeffs::Experiemnt ( unsigned  refinement_level,
std::function< Eigen::Vector3d(const Eigen::Vector3d &)>  u 
)
inlinestatic

◆ GetL2Error()

double projects::hldo_sphere::debugging::WhitneyOneBasisExpansionCoeffs::GetL2Error ( )
inline

returns L2 Error between the approximation and the analytical solution

Definition at line 215 of file whitney_one_basis_expansion_coeffs.h.

References lf::base::RefEl::kTria(), projects::hldo_sphere::post_processing::L2norm(), lf::quad::make_QuadRule(), mesh_, mu_, and u_.

Referenced by Experiemnt().

◆ GetMu()

Eigen::VectorXd projects::hldo_sphere::debugging::WhitneyOneBasisExpansionCoeffs::GetMu ( )
inline

returns basis expansion coefficients computed in Compute

Definition at line 209 of file whitney_one_basis_expansion_coeffs.h.

References mu_.

◆ GetSquaredResidualError()

double projects::hldo_sphere::debugging::WhitneyOneBasisExpansionCoeffs::GetSquaredResidualError ( )
inline

returns the squared sum of all residuals at the edge midpoints, this is the quanity minimized in the computation.

Definition at line 238 of file whitney_one_basis_expansion_coeffs.h.

References res_.

Referenced by Experiemnt().

◆ SetFunction()

void projects::hldo_sphere::debugging::WhitneyOneBasisExpansionCoeffs::SetFunction ( std::function< Eigen::Matrix< double, 3, 1 >(const Eigen::Matrix< double, 3, 1 > &)>  u)
inline

Sets the analytical solution.

Parameters
uanalytical solution vector field

Definition at line 192 of file whitney_one_basis_expansion_coeffs.h.

References u_.

Referenced by Experiemnt().

◆ SetMesh()

void projects::hldo_sphere::debugging::WhitneyOneBasisExpansionCoeffs::SetMesh ( std::shared_ptr< const lf::mesh::Mesh mesh)
inline

Member Data Documentation

◆ mesh_

std::shared_ptr<const lf::mesh::Mesh> projects::hldo_sphere::debugging::WhitneyOneBasisExpansionCoeffs::mesh_
private

◆ mu_

Eigen::VectorXd projects::hldo_sphere::debugging::WhitneyOneBasisExpansionCoeffs::mu_
private

◆ res_

Eigen::VectorXd projects::hldo_sphere::debugging::WhitneyOneBasisExpansionCoeffs::res_
private

◆ u_

std::function<Eigen::Matrix<double, 3, 1>( const Eigen::Matrix<double, 3, 1> &)> projects::hldo_sphere::debugging::WhitneyOneBasisExpansionCoeffs::u_
private

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