Evaluate error.
More...
#include <users_modules/tutorials/cor-2to5/src/PoissonOperators.hpp>
|
| OpError (UVal u_value, GVal g_value, boost::shared_ptr< VectorDouble > &field_vals, boost::shared_ptr< MatrixDouble > &grad_vals, Vec global_error) |
|
MoFEMErrorCode | doWork (int row_side, EntityType row_type, EntitiesFieldData::EntData &row_data) |
|
| OpBaseRhs (const std::string field_name) |
|
MoFEMErrorCode | doWork (int row_side, EntityType row_type, EntitiesFieldData::EntData &row_data) |
| This function is called by finite element. More...
|
|
virtual MoFEMErrorCode | iNtegrate (EntitiesFieldData::EntData &data)=0 |
| Class dedicated to integrate operator. More...
|
|
virtual MoFEMErrorCode | aSsemble (EntitiesFieldData::EntData &data)=0 |
| Class dedicated to assemble operator to global system vector. More...
|
|
|
MoFEMErrorCode | iNtegrate (EntitiesFieldData::EntData &data) |
| Integrate error. More...
|
|
MoFEMErrorCode | aSsemble (EntitiesFieldData::EntData &data) |
| Assemble error. More...
|
|
Evaluate error.
Definition at line 491 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 |
Definition at line 500 of file PoissonOperators.hpp.
503 : 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()
MoFEMErrorCode PoissonExample::OpError::aSsemble |
( |
EntitiesFieldData::EntData & |
data | ) |
|
|
inlineprivatevirtual |
◆ doWork()
MoFEMErrorCode PoissonExample::OpError::doWork |
( |
int |
row_side, |
|
|
EntityType |
row_type, |
|
|
EntitiesFieldData::EntData & |
row_data |
|
) |
| |
|
inline |
- Examples
- PoissonOperators.hpp.
Definition at line 507 of file PoissonOperators.hpp.
508 {
510 nbRows = row_data.getFieldData().size();
517 }
#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()
MoFEMErrorCode PoissonExample::OpError::iNtegrate |
( |
EntitiesFieldData::EntData & |
data | ) |
|
|
inlineprivatevirtual |
Integrate error.
Implements PoissonExample::OpBaseRhs< VolumeElementForcesAndSourcesCore::UserDataOperator >.
- Examples
- PoissonOperators.hpp.
Definition at line 535 of file PoissonOperators.hpp.
535 {
537
538 data.getFieldData().clear();
539
540 const double vol = getVolume();
541
542 auto t_w = getFTensor0IntegrationWeight();
543
544 auto t_u = getFTensor0FromVec(*
fieldVals);
545
546 auto t_grad = getFTensor1FromMat<3>(*
gradVals);
547
548 auto t_coords = getFTensor1CoordsAtGaussPts();
549
551
553 double alpha = vol * t_w;
554
555 double exact_u =
uValue(t_coords(
NX), t_coords(
NY), t_coords(
NZ));
556
557 t_exact_grad =
gValue(t_coords(
NX), t_coords(
NY), t_coords(
NZ));
558
559 t_error_grad(
i) = t_grad(
i) - t_exact_grad(
i);
560
561 double error = pow(t_u - exact_u, 2) + t_error_grad(
i) * t_error_grad(
i);
562
563 data.getFieldData()[0] +=
alpha * error;
564 ++t_w;
565 ++t_u;
566 ++t_grad;
567 ++t_coords;
568 }
570 }
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: