11namespace bio = boost::iostreams;
 
   15static char help[] = 
"...\n\n";
 
   17int main(
int argc, 
char *argv[]) {
 
   23    moab::Core mb_instance;
 
   24    moab::Interface &moab = mb_instance;
 
   27      PetscBool flg = PETSC_TRUE;
 
   32      if (flg != PETSC_TRUE) {
 
   33        SETERRQ(PETSC_COMM_SELF, 1, 
"*** ERROR -my_file (MESH FILE NEEDED)");
 
   57        bool check_if_spatial_field_exist =
 
   75        if (flg != PETSC_TRUE) {
 
   95        if (!check_if_spatial_field_exist) {
 
  136      CHKERR moab.get_entities_by_type(0, MBTET, material_data.
tEts);
 
  137      material_data.
gBeta = 1;
 
  138      material_data.
vBeta = 0.3;
 
  144      for (
auto &&fe_ptr : {&damper.
feRhs, &damper.
feLhs}) {
 
  149        fe_ptr->getOpPtrVector().push_back(
 
  153        fe_ptr->getOpPtrVector().push_back(
 
  156        fe_ptr->getOpPtrVector().push_back(
 
  160        fe_ptr->getOpPtrVector().push_back(
 
  166      std::vector<int> tags;
 
  174          "SPATIAL_POSITION", tags, ce, damper.
commonData, 
true, 
false));
 
  180          "SPATIAL_POSITION", tags, ce, damper.
commonData, 
false, 
true));
 
  187    DMType dm_name = 
"DMDAMPER";
 
  190      CHKERR DMCreate(PETSC_COMM_WORLD, &dm);
 
  191      CHKERR DMSetType(dm, dm_name);
 
  193      CHKERR DMSetFromOptions(dm);
 
  207      CHKERR VecGhostUpdateBegin(
F, INSERT_VALUES, SCATTER_FORWARD);
 
  208      CHKERR VecGhostUpdateEnd(
F, INSERT_VALUES, SCATTER_FORWARD);
 
  209      CHKERR VecZeroEntries(U_t);
 
  210      CHKERR VecGhostUpdateBegin(U_t, INSERT_VALUES, SCATTER_FORWARD);
 
  211      CHKERR VecGhostUpdateEnd(U_t, INSERT_VALUES, SCATTER_FORWARD);
 
  223      CHKERR MatAssemblyBegin(M, MAT_FINAL_ASSEMBLY);
 
  224      CHKERR MatAssemblyEnd(M, MAT_FINAL_ASSEMBLY);
 
  231      CHKERR PetscViewerASCIIOpen(PETSC_COMM_WORLD, 
"damper_jacobian_test.txt",
 
  233      CHKERR PetscViewerDestroy(&viewer);
 
 
#define CATCH_ERRORS
Catch errors.
@ AINSWORTH_LEGENDRE_BASE
Ainsworth Cole (Legendre) approx. base .
#define CHKERR
Inline error check.
PetscErrorCode DMMoFEMAddElement(DM dm, std::string fe_name)
add element to dm
PetscErrorCode DMMoFEMCreateMoFEM(DM dm, MoFEM::Interface *m_field_ptr, const char problem_name[], const MoFEM::BitRefLevel bit_level, const MoFEM::BitRefLevel bit_mask=MoFEM::BitRefLevel().set())
Must be called by user to set MoFEM data structures.
PetscErrorCode DMCreateMatrix_MoFEM(DM dm, Mat *M)
PetscErrorCode DMRegister_MoFEM(const char sname[])
Register MoFEM problem.
PetscErrorCode DMoFEMLoopFiniteElements(DM dm, const char fe_name[], MoFEM::FEMethod *method, CacheTupleWeakPtr cache_ptr=CacheTupleSharedPtr())
Executes FEMethod for finite elements in DM.
PetscErrorCode DMCreateGlobalVector_MoFEM(DM dm, Vec *g)
DMShellSetCreateGlobalVector.
virtual MoFEMErrorCode add_finite_element(const std::string &fe_name, enum MoFEMTypes bh=MF_EXCL, int verb=DEFAULT_VERBOSITY)=0
add finite element
virtual MoFEMErrorCode build_finite_elements(int verb=DEFAULT_VERBOSITY)=0
Build finite elements.
virtual MoFEMErrorCode modify_finite_element_add_field_col(const std::string &fe_name, const std::string name_row)=0
set field col which finite element use
virtual MoFEMErrorCode add_ents_to_finite_element_by_type(const EntityHandle entities, const EntityType type, const std::string name, const bool recursive=true)=0
add entities to finite element
virtual MoFEMErrorCode modify_finite_element_add_field_row(const std::string &fe_name, const std::string name_row)=0
set field row which finite element use
virtual MoFEMErrorCode modify_finite_element_add_field_data(const std::string &fe_name, const std::string name_field)=0
set finite element field data
virtual MoFEMErrorCode build_fields(int verb=DEFAULT_VERBOSITY)=0
virtual MoFEMErrorCode set_field_order(const EntityHandle meshset, const EntityType type, const std::string &name, const ApproximationOrder order, int verb=DEFAULT_VERBOSITY)=0
Set order approximation of the entities in the field.
virtual MoFEMErrorCode add_ents_to_field_by_type(const Range &ents, const EntityType type, const std::string &name, int verb=DEFAULT_VERBOSITY)=0
Add entities to field meshset.
virtual bool check_field(const std::string &name) const =0
check if field is in database
virtual MoFEMErrorCode loop_dofs(const Problem *problem_ptr, const std::string &field_name, RowColData rc, DofMethod &method, int lower_rank, int upper_rank, int verb=DEFAULT_VERBOSITY)=0
Make a loop over dofs.
std::bitset< BITREFLEVEL_SIZE > BitRefLevel
Bit structure attached to each entity identifying to what mesh entity is attached.
implementation of Data Operators for Forces and Sources
PetscErrorCode PetscOptionsGetInt(PetscOptions *, const char pre[], const char name[], PetscInt *ivalue, PetscBool *set)
PetscErrorCode PetscOptionsGetString(PetscOptions *, const char pre[], const char name[], char str[], size_t size, PetscBool *set)
Dumper material parameters.
double vBeta
Poisson ration spring alpha.
double gBeta
Sheer modulus spring alpha.
Common data for nonlinear_elastic_elem model.
string spatialPositionNameDot
string spatialPositionName
boost::shared_ptr< MatrixDouble > gradDataAtGaussTmpPtr
Constitutive model functions.
Assemble internal force vector.
Implementation of Kelvin Voigt Damper.
ConstitutiveEquationMap constitutiveEquationMap
std::map< int, BlockMaterialData > blockMaterialDataMap
virtual MoFEMErrorCode build_adjacencies(const Range &ents, int verb=DEFAULT_VERBOSITY)=0
build adjacencies
virtual MoFEMErrorCode add_field(const std::string name, const FieldSpace space, const FieldApproximationBase base, const FieldCoefficientsNumber nb_of_coefficients, const TagType tag_type=MB_TAG_SPARSE, const enum MoFEMTypes bh=MF_EXCL, int verb=DEFAULT_VERBOSITY)=0
Add field.
static MoFEMErrorCode Initialize(int *argc, char ***args, const char file[], const char help[])
Initializes the MoFEM database PETSc, MOAB and MPI.
static MoFEMErrorCode Finalize()
Checks for options to be called at the conclusion of the program.
Deprecated interface functions.
boost::ptr_deque< UserDataOperator > & getOpPtrVector()
Use to push back operator for row operator.
Get field gradients time derivative at integration pts for scalar field rank 0, i....
Get field gradients at integration pts for scalar field rank 0, i.e. vector field.
Projection of edge entities with one mid-node on hierarchical basis.
@ CTX_TSSETIFUNCTION
Setting up implicit function.
Vec & ts_F
Reference to residual vector F(t,U,U_t,U_tt)
TSContext ts_ctx
Current TS computation context.
PetscReal ts_a
Shift parameter for U_t (see PETSc Time Solver documentation)
Vec & ts_u_t
Reference to first time derivative of state vector dU/dt.
Mat & ts_B
Reference to preconditioner matrix for ts_A.
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface reference to pointer of interface.