Evaluate error.
More...
#include "tutorials/cor-2to5/src/PoissonOperators.hpp"
Evaluate error.
Definition at line 494 of file PoissonOperators.hpp.
◆ GVal
◆ UVal
◆ OpError()
PoissonExample::OpError::OpError |
( |
UVal | u_value, |
|
|
GVal | g_value, |
|
|
boost::shared_ptr< VectorDouble > & | field_vals, |
|
|
boost::shared_ptr< MatrixDouble > & | grad_vals, |
|
|
Vec | global_error ) |
|
inline |
- Examples
- PoissonOperators.hpp.
Definition at line 503 of file PoissonOperators.hpp.
506 : OpBaseRhs<VolumeElementForcesAndSourcesCore::UserDataOperator>("ERROR"),
Vec globalError
ghost vector with global (integrated over volume) error
UVal uValue
function with exact solution
boost::shared_ptr< MatrixDouble > gradVals
GVal gValue
function with exact solution for gradient
boost::shared_ptr< VectorDouble > fieldVals
◆ aSsemble()
Assemble error.
- Examples
- PoissonOperators.hpp.
Definition at line 578 of file PoissonOperators.hpp.
578 {
580
582
585 }
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
const VectorDouble & getFieldData() const
get dofs values
const VectorDofs & getFieldDofs() const
get dofs data stature FEDofEntity
◆ doWork()
- Examples
- PoissonOperators.hpp.
Definition at line 510 of file PoissonOperators.hpp.
511 {
520 }
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
MoFEMErrorCode iNtegrate(EntitiesFieldData::EntData &data)
Integrate error.
MoFEMErrorCode aSsemble(EntitiesFieldData::EntData &data)
Assemble error.
◆ iNtegrate()
Integrate error.
- Examples
- PoissonOperators.hpp.
Definition at line 538 of file PoissonOperators.hpp.
538 {
540
542
543 const double vol = getVolume();
544
545 auto t_w = getFTensor0IntegrationWeight();
546
548
550
551 auto t_coords = getFTensor1CoordsAtGaussPts();
552
554
556 double alpha = vol * t_w;
557
558 double exact_u =
uValue(t_coords(
NX), t_coords(
NY), t_coords(
NZ));
559
560 t_exact_grad =
gValue(t_coords(
NX), t_coords(
NY), t_coords(
NZ));
561
562 t_error_grad(
i) = t_grad(
i) - t_exact_grad(
i);
563
564 double error = pow(t_u - exact_u, 2) + t_error_grad(
i) * t_error_grad(
i);
565
567 ++t_w;
568 ++t_u;
569 ++t_grad;
570 ++t_coords;
571 }
573 }
FTensor::Tensor1< FTensor::PackPtr< T *, S >, Tensor_Dim > getFTensor1FromMat(ublas::matrix< T, L, A > &data)
Get tensor rank 1 (vector) form data matrix.
static auto getFTensor0FromVec(ublas::vector< T, A > &data)
Get tensor rank 0 (scalar) form data vector.
FTensor::Index< 'i', 3 > i
◆ fieldVals
boost::shared_ptr<VectorDouble> PoissonExample::OpError::fieldVals |
|
private |
◆ globalError
Vec PoissonExample::OpError::globalError |
|
private |
◆ gradVals
boost::shared_ptr<MatrixDouble> PoissonExample::OpError::gradVals |
|
private |
◆ gValue
GVal PoissonExample::OpError::gValue |
|
private |
◆ NX
◆ NY
◆ NZ
◆ uValue
UVal PoissonExample::OpError::uValue |
|
private |
The documentation for this struct was generated from the following file: