|
| v0.14.0
|
Go to the documentation of this file.
14 #ifndef __POISSON_2D_HOMOGENEOUS_HPP__
15 #define __POISSON_2D_HOMOGENEOUS_HPP__
17 using namespace MoFEM;
37 typedef boost::function<
double(
const double,
const double,
const double)>
50 const int nb_row_dofs = row_data.
getIndices().size();
51 const int nb_col_dofs = col_data.
getIndices().size();
53 this->locMat.resize(nb_row_dofs, nb_col_dofs,
false);
57 const double area = getMeasure();
60 const int nb_integration_points = getGaussPts().size2();
62 auto t_w = getFTensor0IntegrationWeight();
68 for (
int gg = 0; gg != nb_integration_points; gg++) {
69 const double a = t_w * area;
71 for (
int rr = 0; rr != nb_row_dofs; ++rr) {
75 for (
int cc = 0; cc != nb_col_dofs; cc++) {
76 this->locMat(rr, cc) += t_row_diff_base(
i) * t_col_diff_base(
i) *
a;
98 sourceTermFunc(source_term_function) {}
105 this->locF.resize(nb_dofs,
false);
109 const double area = getMeasure();
112 const int nb_integration_points = getGaussPts().size2();
114 auto t_w = getFTensor0IntegrationWeight();
115 auto t_coords = getFTensor1CoordsAtGaussPts();
121 for (
int gg = 0; gg != nb_integration_points; gg++) {
122 const double a = t_w * area;
126 sourceTermFunc(t_coords(0), t_coords(1), t_coords(2));
127 for (
int rr = 0; rr != nb_dofs; rr++) {
128 this->locF[rr] += t_base * body_source *
a;
149 #endif //__POISSON_2D_HOMOGENEOUS_HPP__
Data on single entity (This is passed as argument to DataOperator::doWork)
MoFEMErrorCode iNtegrate(EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data)
Integrate grad-grad operator.
boost::function< double(const double, const double, const double)> ScalarFunc
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
FTensor::Index< 'i', SPACE_DIM > i
ScalarFunc sourceTermFunc
OpBaseImpl< PETSC, EdgeEleOp > OpBase
FTensor::Tensor0< FTensor::PackPtr< double *, 1 > > getFTensor0N(const FieldApproximationBase base)
Get base function as Tensor0.
implementation of Data Operators for Forces and Sources
OpDomainRhsVectorF(std::string field_name, ScalarFunc source_term_function)
const VectorInt & getIndices() const
Get global indices of dofs on entity.
OpDomainLhsMatrixK(std::string row_field_name, std::string col_field_name)
constexpr auto field_name
EntitiesFieldData::EntData EntData
FTensor::Tensor1< FTensor::PackPtr< double *, Tensor_Dim >, Tensor_Dim > getFTensor1DiffN(const FieldApproximationBase base)
Get derivatives of base functions.
ForcesAndSourcesCore::UserDataOperator UserDataOperator
ElementsAndOps< SPACE_DIM >::DomainEle DomainEle
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
MoFEMErrorCode iNtegrate(EntitiesFieldData::EntData &data)
Class dedicated to integrate operator.
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...