1#ifndef __NONLINEARPOISSON2D_HPP__
2#define __NONLINEARPOISSON2D_HPP__
35typedef boost::function<
double(
const double,
const double,
const double)>
42 std::string row_field_name, std::string col_field_name,
43 boost::shared_ptr<VectorDouble> field_vec,
44 boost::shared_ptr<MatrixDouble> field_grad_mat)
53 auto &locLhs = AssemblyDomainEleOp::locMat;
55 const int nb_row_dofs = row_data.
getIndices().size();
56 const int nb_col_dofs = col_data.
getIndices().size();
58 const double area = getMeasure();
61 const int nb_integration_points = getGaussPts().size2();
63 auto t_w = getFTensor0IntegrationWeight();
75 for (
int gg = 0; gg != nb_integration_points; gg++) {
76 const double a = t_w * area;
78 for (
int rr = 0; rr != nb_row_dofs; ++rr) {
84 for (
int cc = 0; cc != nb_col_dofs; cc++) {
85 locLhs(rr, cc) += (((1 + t_field * t_field) * t_row_diff_base(
i) *
87 (2.0 * t_field * t_field_grad(
i) *
88 t_row_diff_base(
i) * t_col_base)) *
123 boost::shared_ptr<VectorDouble> field_vec,
124 boost::shared_ptr<MatrixDouble> field_grad_mat)
132 auto &nf = AssemblyDomainEleOp::locF;
136 const double area = getMeasure();
139 const int nb_integration_points = getGaussPts().size2();
141 auto t_w = getFTensor0IntegrationWeight();
143 auto t_coords = getFTensor1CoordsAtGaussPts();
155 for (
int gg = 0; gg != nb_integration_points; gg++) {
156 const double a = t_w * area;
161 for (
int rr = 0; rr != AssemblyDomainEleOp::nbRows; rr++) {
163 (-t_base * body_source +
164 t_grad_base(
i) * t_field_grad(
i) * (1 + t_field * t_field)) *
ElementsAndOps< SPACE_DIM >::BoundaryEle BoundaryEle
ElementsAndOps< SPACE_DIM >::DomainEle DomainEle
[Define dimension]
#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()
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
implementation of Data Operators for Forces and Sources
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', 2 > i
boost::function< double(const double, const double, const double)> ScalarFunc
FormsIntegrators< BoundaryEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpSource< 1, 1 > OpBoundaryRhsSource
FormsIntegrators< BoundaryEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpBaseTimesScalar< 1 > OpBoundaryRhs
FormsIntegrators< BoundaryEleOp >::Assembly< PETSC >::BiLinearForm< GAUSS >::OpMass< 1, 1 > OpBoundaryLhs
constexpr auto field_name
OpBaseImpl< PETSC, EdgeEleOp > OpBase
Data on single entity (This is passed as argument to DataOperator::doWork)
FTensor::Tensor1< FTensor::PackPtr< double *, Tensor_Dim >, Tensor_Dim > getFTensor1DiffN(const FieldApproximationBase base)
Get derivatives of base functions.
FTensor::Tensor0< FTensor::PackPtr< double *, 1 > > getFTensor0N(const FieldApproximationBase base)
Get base function as Tensor0.
const VectorInt & getIndices() const
Get global indices of dofs on entity.
friend class UserDataOperator
MoFEM::FaceElementForcesAndSourcesCore FaceEle
MoFEM::EdgeElementForcesAndSourcesCore EdgeEle
boost::shared_ptr< VectorDouble > fieldVec
boost::shared_ptr< MatrixDouble > fieldGradMat
MoFEMErrorCode iNtegrate(EntData &row_data, EntData &col_data)
OpDomainLhs(std::string row_field_name, std::string col_field_name, boost::shared_ptr< VectorDouble > field_vec, boost::shared_ptr< MatrixDouble > field_grad_mat)
boost::shared_ptr< VectorDouble > fieldVec
MoFEMErrorCode iNtegrate(EntData &data)
OpDomainRhs(std::string field_name, ScalarFunc source_term_function, boost::shared_ptr< VectorDouble > field_vec, boost::shared_ptr< MatrixDouble > field_grad_mat)
ScalarFunc sourceTermFunc
boost::shared_ptr< MatrixDouble > fieldGradMat
FormsIntegrators< BoundaryEleOp >::Assembly< A >::OpBase AssemblyBoundaryEleOp
FormsIntegrators< DomainEleOp >::Assembly< A >::OpBase AssemblyDomainEleOp