10#include <MethodForForceScaling.hpp>
16 boost::ptr_vector<MethodForForceScaling> &methods_op,
bool use_snes_f)
18 F(f), dAta(data), methodsOp(methods_op), useSnesF(use_snes_f) {}
28 EntityHandle ent = getNumeredEntFiniteElementPtr()->getEnt();
29 if (dAta.eDges.find(ent) == dAta.eDges.end()) {
35 int rank = dof_ptr->getNbOfCoeffs();
39 Nf.resize(nb_dofs,
false);
42 int nb_gauss_pts = data.
getN().size1();
43 wEights.resize(nb_gauss_pts,
false);
46 for (
int rr = 0; rr < rank; rr++) {
51 force = dAta.data.data.value3 * dAta.data.data.value1;
53 force = dAta.data.data.value4 * dAta.data.data.value1;
55 force = dAta.data.data.value5 * dAta.data.data.value1;
61 for (
int gg = 0; gg < nb_gauss_pts; gg++) {
66 for (
int dd = 0; dd < 3; dd++) {
67 wEights[gg] += pow(getTangentAtGaussPts()(gg, dd), 2);
69 wEights[gg] = std::sqrt(wEights[gg]);
70 wEights[gg] *= getGaussPts()(1, gg);
73 cblas_daxpy(nb_dofs / rank, wEights[gg] * force, &data.
getN()(gg, 0), 1,
84 if (useSnesF ||
F == PETSC_NULLPTR)
94 int ms_id,
bool use_snes_f) {
ForcesAndSourcesCore::UserDataOperator UserDataOperator
#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.
MoFEMErrorCode getCubitMeshsetPtr(const int ms_id, const CubitBCType cubit_bc_type, const CubitMeshSets **cubit_meshset_ptr) const
get cubit meshset
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
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
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
OpEdgeForce(const std::string field_name, Vec f, bCForce &data, boost::ptr_vector< MethodForForceScaling > &methods_op, bool use_snes_f=false)
MoFEM::Interface & mField
MoFEMErrorCode addForce(const std::string field_name, Vec F, int ms_id, bool use_snes_f=false)
boost::ptr_vector< MethodForForceScaling > methodsOp
std::map< int, bCForce > mapForce
static MoFEMErrorCode applyScale(const FEMethod *fe, boost::ptr_vector< MethodForForceScaling > &methods_op, VectorDouble &nf)
virtual moab::Interface & get_moab()=0
this struct keeps basic methods for moab meshset about material and boundary conditions
MoFEMErrorCode getBcDataStructure(CUBIT_BC_DATA_TYPE &data) const
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 dofs data stature FEDofEntity
const VectorInt & getIndices() const
Get global indices of dofs on entity.
boost::ptr_deque< UserDataOperator > & getOpPtrVector()
Use to push back operator for row operator.
Interface for managing meshsets containing materials and boundary conditions.
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface reference to pointer of interface.