LehrFEM++ 1.0.0
A simple Finite Element Library for teaching
|
Class to find the "best" basisexpansion coefficients with the analytical solution. More...
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::Mesh > | mesh_ |
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.
|
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_.
|
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().
|
inlinestatic |
Definition at line 249 of file whitney_one_basis_expansion_coeffs.h.
References projects::hldo_sphere::mesh::SphereTriagMeshBuilder::Build(), Compute(), projects::hldo_sphere::debugging::concat(), GetL2Error(), GetSquaredResidualError(), SetFunction(), SetMesh(), projects::hldo_sphere::mesh::SphereTriagMeshBuilder::setRadius(), projects::hldo_sphere::mesh::SphereTriagMeshBuilder::setRefinementLevel(), and lf::geometry::Volume().
|
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().
|
inline |
returns basis expansion coefficients computed in Compute
Definition at line 209 of file whitney_one_basis_expansion_coeffs.h.
References mu_.
|
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().
|
inline |
Sets the analytical solution.
u | analytical solution vector field |
Definition at line 192 of file whitney_one_basis_expansion_coeffs.h.
References u_.
Referenced by Experiemnt().
|
inline |
Definition at line 204 of file whitney_one_basis_expansion_coeffs.h.
References mesh_.
Referenced by projects::hldo_sphere::debugging::WhitneyOneCurlTest::Compute(), and Experiemnt().
|
private |
Definition at line 404 of file whitney_one_basis_expansion_coeffs.h.
Referenced by Compute(), GetL2Error(), SetMesh(), and WhitneyOneBasisExpansionCoeffs().
|
private |
Definition at line 402 of file whitney_one_basis_expansion_coeffs.h.
Referenced by Compute(), GetL2Error(), GetMu(), and WhitneyOneBasisExpansionCoeffs().
|
private |
Definition at line 403 of file whitney_one_basis_expansion_coeffs.h.
Referenced by Compute(), GetSquaredResidualError(), and WhitneyOneBasisExpansionCoeffs().
|
private |
Definition at line 401 of file whitney_one_basis_expansion_coeffs.h.
Referenced by Compute(), GetL2Error(), SetFunction(), and WhitneyOneBasisExpansionCoeffs().