8 int order, boost::shared_ptr<MatrixDouble> mass_ptr,
9 boost::shared_ptr<EntitiesFieldData> data_l2,
21 "Space should be set to L2");
35 boost::shared_ptr<MatrixDouble> data_ptr,
36 boost::shared_ptr<MatrixDouble> coeffs_ptr,
37 boost::shared_ptr<MatrixDouble> mass_ptr,
38 boost::shared_ptr<EntitiesFieldData> data_l2,
42 dataPtr(data_ptr), coeffsPtr(coeffs_ptr) {}
51 constexpr auto side_number = 0;
52 auto &ent_data =
dataL2->dataOnEntities[fe_type][side_number];
53 auto nb_base_functions = ent_data.getN(
base).size2();
55 auto nb_data_coeffs =
dataPtr->size1();
59 rhs.resize(nb_base_functions, nb_data_coeffs,
false);
66 auto t_base = ent_data.getFTensor0N(
base, 0, 0);
68 for (
auto gg = 0; gg != nb_integration_pts; ++gg) {
69 Tensor0 t_rhs(&*rhs.data().begin());
70 for (
auto bb = 0; bb != nb_base_functions; ++bb) {
71 double alpha = t_w * t_base;
72 Tensor0 t_data(&trans_data(gg, 0));
73 for (
auto cc = 0; cc != nb_data_coeffs; ++cc) {
74 t_rhs += alpha * t_data;
84 for (
auto cc = 0; cc != nb_data_coeffs; ++cc) {
85 ublas::matrix_column<MatrixDouble> mc(rhs, cc);
93 boost::shared_ptr<MatrixDouble> data_ptr,
94 boost::shared_ptr<MatrixDouble> coeffs_ptr,
95 boost::shared_ptr<EntitiesFieldData> data_l2,
110 "Space should be set to L2");
114 constexpr auto side_number = 0;
115 auto order =
dataL2->dataOnEntities[fe_type][side_number].getOrder();
122 auto &ent_data =
dataL2->dataOnEntities[fe_type][side_number];
123 const auto nb_base_functions = ent_data.getN(
base).size2();
124 auto nb_data_coeffs =
dataPtr->size1();
125 if (!nb_data_coeffs) {
127 "Number of data coefficients should be set");
133 data.resize(nb_integration_pts, nb_data_coeffs);
138 auto t_base = ent_data.getFTensor0N(
base, 0, 0);
139 for (
auto gg = 0; gg != nb_integration_pts; ++gg) {
140 Tensor0 t_coeffs(&*coeffs.data().begin());
141 for (
auto bb = 0; bb != nb_base_functions; ++bb) {
142 double alpha = t_base;
143 Tensor0 t_data(&data(gg, 0));
144 for (
auto cc = 0; cc != nb_data_coeffs; ++cc) {
145 t_data += alpha * t_coeffs;
void cholesky_solve(const TRIA &L, VEC &x, ublas::lower)
solve system L L^T x = b inplace
FieldApproximationBase
approximation base
FieldSpace
approximation spaces
@ L2
field with C-1 continuity
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
@ MOFEM_DATA_INCONSISTENCY
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
SeverityLevel
Severity levels.
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
implementation of Data Operators for Forces and Sources
Data on single entity (This is passed as argument to DataOperator::doWork)
EntityType getFEType() const
Get dimension of finite element.
auto getFTensor0IntegrationWeight()
Get integration weights.
MatrixDouble & getGaussPts()
matrix of integration (Gauss) points for Volume Element
boost::shared_ptr< EntitiesFieldData > dataL2
MoFEMErrorCode calculateBase(GetOrderFun get_order)
MoFEMErrorCode calculateMass()
boost::shared_ptr< MatrixDouble > baseMassPtr
FieldApproximationBase base
boost::shared_ptr< MatrixDouble > coeffsPtr
boost::shared_ptr< MatrixDouble > dataPtr
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
Operator for linear form, usually to calculate values on right hand side.
OpDGProjectionCoefficients(boost::shared_ptr< MatrixDouble > data_ptr, boost::shared_ptr< MatrixDouble > coeffs_ptr, boost::shared_ptr< MatrixDouble > mass_ptr, boost::shared_ptr< EntitiesFieldData > data_l2, const FieldApproximationBase b, const FieldSpace s, const LogManager::SeverityLevel sev=Sev::noisy)
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
Operator for linear form, usually to calculate values on right hand side.
OpDGProjectionEvaluation(boost::shared_ptr< MatrixDouble > data_ptr, boost::shared_ptr< MatrixDouble > coeffs_ptr, boost::shared_ptr< EntitiesFieldData > data_l2, const FieldApproximationBase b, const FieldSpace s, const LogManager::SeverityLevel sev=Sev::noisy)
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
Operator for linear form, usually to calculate values on right hand side.
OpDGProjectionMassMatrix(int order, boost::shared_ptr< MatrixDouble > mass_ptr, boost::shared_ptr< EntitiesFieldData > data_l2, const FieldApproximationBase b, const FieldSpace s, int verb=QUIET, Sev sev=Sev::verbose)