9#ifndef __ANALYTICALDIRICHLETBC_HPP__
10#define __ANALYTICALDIRICHLETBC_HPP__
12using namespace boost::numeric;
55 template <
typename FUNEVAL>
64 boost::shared_ptr<FUNEVAL> function_evaluator,
int field_number)
76 unsigned int nb_row = data.
getIndices().size();
81 unsigned int rank = dof_ptr->getNbOfCoeffs();
86 NTf.resize(nb_row / rank);
89 for (
unsigned int gg = 0; gg < data.
getN().size1(); gg++) {
92 const double val = gauss_pts(2, gg) * area;
93 const double x = coords_at_gauss_pts(gg, 0);
94 const double y = coords_at_gauss_pts(gg, 1);
95 const double z = coords_at_gauss_pts(gg, 2);
99 if (
a.size() != rank) {
101 "data inconsistency");
104 for (
unsigned int rr = 0; rr < rank; rr++) {
106 ublas::noalias(
iNdices) = ublas::vector_slice<VectorInt>(
108 ublas::slice(rr, rank, data.
getIndices().size() / rank));
110 noalias(
NTf) = data.
getN(gg, nb_row / rank) *
a[rr] * val;
112 &
iNdices[0], &*
NTf.data().begin(), ADD_VALUES);
156 template <
typename FUNEVAL>
159 boost::shared_ptr<FUNEVAL> function_evaluator,
160 const int field_number = 0,
161 const string nodals_positions =
"MESH_NODE_POSITIONS") {
205 string nodals_positions =
"MESH_NODE_POSITIONS");
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#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.
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
virtual bool check_field(const std::string &name) const =0
check if field is in database
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
UBlasVector< int > VectorInt
implementation of Data Operators for Forces and Sources
MoFEMErrorCode VecSetValues(Vec V, const EntitiesFieldData::EntData &data, const double *ptr, InsertMode iora)
Assemble PETSc vector.
constexpr auto field_name
MyTriFE(MoFEM::Interface &m_field)
Lhs operator used to build matrix.
MoFEMErrorCode doWork(int row_side, int col_side, EntityType row_type, EntityType col_type, EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data)
Operator for bi-linear form, usually to calculate values on left hand side.
Rhs operator used to build matrix.
OpRhs(const std::string field_name, boost::shared_ptr< FUNEVAL > function_evaluator, int field_number)
boost::shared_ptr< FUNEVAL > functionEvaluator
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
Operator for linear form, usually to calculate values on right hand side.
finite element to approximate analytical solution on surface
virtual ~ApproxField()=default
MyTriFE & getLoopFeApprox()
ApproxField(MoFEM::Interface &m_field)
Structure used to enforce analytical boundary conditions.
MoFEMErrorCode iNitialize()
boost::shared_ptr< Range > trisPtr
Analytical Dirichlet boundary conditions.
MoFEMErrorCode destroyProblem()
Destroy problem.
MoFEMErrorCode setUpProblem(MoFEM::Interface &m_field, string problem)
set problem solver and create matrices and vectors
MoFEMErrorCode setApproxOps(MoFEM::Interface &m_field, const std::string field_name, boost::shared_ptr< FUNEVAL > function_evaluator, const int field_number=0, const string nodals_positions="MESH_NODE_POSITIONS")
Set operators used to calculate the rhs vector and the lhs matrix.
MoFEMErrorCode setFiniteElement(MoFEM::Interface &m_field, string fe, string field, Range &tris, string nodals_positions="MESH_NODE_POSITIONS")
set finite element
MoFEMErrorCode solveProblem(MoFEM::Interface &m_field, string problem, string fe, DirichletBC &bc, Range &tris)
solve boundary problem
Set Dirichlet boundary conditions on displacements.
Add operators pushing bases from local to physical configuration.
Deprecated interface functions.
Data on single entity (This is passed as argument to DataOperator::doWork)
MatrixDouble & getN(const FieldApproximationBase base)
get base functions this return matrix (nb. of rows is equal to nb. of Gauss pts, nb....
const VectorDofs & getFieldDofs() const
Get DOF data structures (const version)
const VectorInt & getIndices() const
Get global indices of degrees of freedom on entity.
default operator for TRI element
MatrixDouble & getNormalsAtGaussPts()
if higher order geometry return normals at Gauss pts.
MatrixDouble & getCoordsAtGaussPts()
Gauss points and weight, matrix (nb. of points x 3)
@ OPROW
operator doWork function is executed on FE rows
const FEMethod * getFEMethod() const
Return raw pointer to Finite Element Method object.
MatrixDouble & getGaussPts()
matrix of integration (Gauss) points for Volume Element
structure to get information from mofem into EntitiesFieldData
boost::ptr_deque< UserDataOperator > & getOpPtrVector()
Use to push back operator for row operator.