Evaluate error.
More...
#include <users_modules/tutorials/cor-2to5/src/PoissonOperators.hpp>
Evaluate error.
Definition at line 504 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 |
|
) |
| |
- Examples
- PoissonOperators.hpp.
Definition at line 513 of file PoissonOperators.hpp.
516 : 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()
◆ doWork()
- Examples
- PoissonOperators.hpp.
Definition at line 520 of file PoissonOperators.hpp.
523 nbRows = row_data.getFieldData().size();
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
int nbIntegrationPts
number of integration points
MoFEMErrorCode iNtegrate(EntitiesFieldData::EntData &data)
Integrate error.
MoFEMErrorCode aSsemble(EntitiesFieldData::EntData &data)
Assemble error.
◆ iNtegrate()
Integrate error.
Implements PoissonExample::OpBaseRhs< VolumeElementForcesAndSourcesCore::UserDataOperator >.
- Examples
- PoissonOperators.hpp.
Definition at line 548 of file PoissonOperators.hpp.
551 data.getFieldData().clear();
553 const double vol = getVolume();
555 auto t_w = getFTensor0IntegrationWeight();
559 auto t_grad = getFTensor1FromMat<3>(*
gradVals);
561 auto t_coords = getFTensor1CoordsAtGaussPts();
566 double alpha = vol * t_w;
568 double exact_u =
uValue(t_coords(
NX), t_coords(
NY), t_coords(
NZ));
570 t_exact_grad =
gValue(t_coords(
NX), t_coords(
NY), t_coords(
NZ));
572 t_error_grad(
i) = t_grad(
i) - t_exact_grad(
i);
574 double error = pow(t_u - exact_u, 2) + t_error_grad(
i) * t_error_grad(
i);
576 data.getFieldData()[0] +=
alpha * error;
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: