70 {
72
73 try {
74
75 moab::Core mb_instance;
76 moab::Interface& moab = mb_instance;
77 ParallelComm* pcomm = ParallelComm::get_pcomm(&moab,
MYPCOMM_INDEX);
78 if(pcomm == NULL) pcomm = new ParallelComm(&moab,PETSC_COMM_WORLD);
79
80 PetscBool flg = PETSC_TRUE;
83 if(flg != PETSC_TRUE) {
84 SETERRQ(PETSC_COMM_SELF,1,"*** ERROR -my_file (MESH FILE NEEDED)");
85 }
86
89 if(flg != PETSC_TRUE) {
91 }
92 PetscInt bubble_order;
94 if(flg != PETSC_TRUE) {
96 }
97
98
99
100 PetscBool is_partitioned = PETSC_FALSE;
102
103
104 double mygiven_strain[6];
105 int nmax=6;
108 given_strain.resize(6);
109 cblas_dcopy(6, &mygiven_strain[0], 1, &given_strain(0), 1);
110 cout<<"given_strain ="<<given_strain<<endl;
111
112
113 if(is_partitioned == PETSC_TRUE) {
114 const char *option;
115 option = "PARALLEL=BCAST_DELETE;PARALLEL_RESOLVE_SHARED_ENTS;PARTITION=PARALLEL_PARTITION;";
117 } else {
118 const char *option;
119 option = "";
121 }
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
178 SmallStrainJ2Plasticity cp;
179 {
180 cp.tAgs.resize(3);
181 cp.tAgs[0] = 3;
182 cp.tAgs[1] = 4;
183 cp.tAgs[2] = 5;
184 cp.tOl = 1e-12;
185
187 cp.sIgma_y = 1;
188 cp.H = 0.1;
189 cp.K = 0;
190 cp.phi = 1;
191 {
200 }
201
202 PetscPrintf(PETSC_COMM_WORLD,
"young_modulus = %4.2e \n",
young_modulus);
203 PetscPrintf(PETSC_COMM_WORLD,
"poisson_ratio = %4.2e \n",
poisson_ratio);
204 PetscPrintf(PETSC_COMM_WORLD,"sIgma_y = %4.2e \n",cp.sIgma_y);
205 PetscPrintf(PETSC_COMM_WORLD,"H = %4.2e \n",cp.H);
206 PetscPrintf(PETSC_COMM_WORLD,"K = %4.2e \n",cp.K);
207 PetscPrintf(PETSC_COMM_WORLD,"phi = %4.2e \n",cp.phi);
208
209
210 cp.sTrain.resize(6,false);
211 cp.sTrain.clear();
212 cp.plasticStrain.resize(6,false);
213 cp.plasticStrain.clear();
214 cp.internalVariables.resize(7,false);
215 cp.internalVariables.clear();
216 cp.createMatAVecR();
217 cp.snesCreate();
218
219 }
220
221
222
223
224
225
226
229
230 vector<BitRefLevel> bit_levels;
231 {
233 int def_meshset_info[2] = {0,0};
234 rval = moab.tag_get_handle(
235 "MESHSET_INFO",2,MB_TYPE_INTEGER,th_meshset_info,MB_TAG_CREAT|MB_TAG_SPARSE,&def_meshset_info
236 );
237 int meshset_data[2];
240 if(meshset_data[0]==0) {
241 meshset_data[0] = 1;
243
244 }
245 bit_levels.push_back(
BitRefLevel().set(meshset_data[0]-1));
246 }
247
248
251
252 ierr = m_field.get_entities_by_ref_level(bit_levels.back(),
BitRefLevel().set(),out_meshset); CHKERRQ(
ierr);
253 Range LatestRefinedTets;
254 rval = moab.get_entities_by_type(out_meshset, MBTET,LatestRefinedTets,
true);
CHKERRQ_MOAB(
rval);
255 Range LatestRefinedPrisms;
256 rval = moab.get_entities_by_type(out_meshset, MBPRISM,LatestRefinedPrisms,
true);
CHKERRQ_MOAB(
rval);
257
258 cout<< "========================== LatestRefinedPrisms "<<LatestRefinedPrisms.size()<<endl;
259 cout<< "========================== LatestRefinedTets "<<LatestRefinedTets.size()<<endl;
260
261
264
265
268
269
270
271 Range prims_on_problem_bit_level;
272 ierr = m_field.get_entities_by_type_and_ref_level(
273 problem_bit_level,
BitRefLevel().set(),MBPRISM,prims_on_problem_bit_level
275 Range tets_on_problem_bit_level;
276 ierr = m_field.get_entities_by_type_and_ref_level(
277 problem_bit_level,
BitRefLevel().set(),MBTET,tets_on_problem_bit_level
279
280
283 rval = moab.add_entities(meshset_prims_on_problem_bit_level,prims_on_problem_bit_level);
CHKERRQ_MOAB(
rval);
284 ierr = m_field.seed_ref_level_MESHSET(meshset_prims_on_problem_bit_level,
BitRefLevel().set()); CHKERRQ(
ierr);
285
286
287
291
292
295
297 if(it->getName().compare(0,12,"AllBoundSurf") == 0 || it->getMeshsetId() == 103) {
301 }
302 }
303
304
305
310
315
319
320
322
323
325 ierr = m_field.
loop_dofs(
"MESH_NODE_POSITIONS",ent_method_material,0); CHKERRQ(
ierr);
326
327
329
334
335
336
339 if(it->getName() != "MAT_PLASTIC") continue;
341 int id = it->getMeshsetId();
342
344 meshset,MBTET,newtets,true
346
347
348 newtets = intersect(newtets,LatestRefinedTets);
349 ierr = m_field.seed_finite_elements(newtets); CHKERRQ(
ierr);
350 }
351
353
354
355
356
357
358
359
361 trans_elastic.commonData.spatialPositions = "DISPLACEMENT";
362 trans_elastic.commonData.meshPositions = "MESH_NODE_POSITIONS";
363 std::map<int,boost::shared_ptr<SmallStrainTranverslyIsotropicADouble> > tranversly_isotropic_adouble_ptr_map;
364 std::map<int,boost::shared_ptr<SmallStrainTranverslyIsotropicDouble> > tranversly_isotropic_double_ptr_map;
365 bool trans_iso_blocks = false;
367
368 string name = it->getName();
369 if (name.compare(0,20,"MAT_ELASTIC_TRANSISO") == 0) {
370 cout<<"================================ it is MAT_ELASTIC_TRANSISO "<<endl;
371 trans_iso_blocks = true;
372 int id = it->getMeshsetId();
374 ierr = it->getAttributeDataStructure(mydata); CHKERRQ(
ierr);
375 tranversly_isotropic_adouble_ptr_map[id] = boost::make_shared<SmallStrainTranverslyIsotropicADouble>();
376 tranversly_isotropic_double_ptr_map[id] = boost::make_shared<SmallStrainTranverslyIsotropicDouble>();
377
378 tranversly_isotropic_adouble_ptr_map.at(
id)->E_p = mydata.
data.Youngp;
379 tranversly_isotropic_double_ptr_map.at(
id)->E_p = mydata.
data.Youngp;
380 tranversly_isotropic_adouble_ptr_map.at(
id)->E_z = mydata.
data.Youngz;
381 tranversly_isotropic_double_ptr_map.at(
id)->E_z = mydata.
data.Youngz;
382 tranversly_isotropic_adouble_ptr_map.at(
id)->nu_p = mydata.
data.Poissonp;
383 tranversly_isotropic_double_ptr_map.at(
id)->nu_p = mydata.
data.Poissonp;
384 tranversly_isotropic_adouble_ptr_map.at(
id)->nu_pz = mydata.
data.Poissonpz;
385 tranversly_isotropic_double_ptr_map.at(
id)->nu_pz = mydata.
data.Poissonpz;
386 double shear_zp;
387 if(mydata.
data.Shearzp!=0) {
388 shear_zp = mydata.
data.Shearzp;
389 } else {
390 shear_zp = mydata.
data.Youngz/(2*(1+mydata.
data.Poissonpz));
391 }
392 tranversly_isotropic_adouble_ptr_map.at(it->getMeshsetId())->G_zp = shear_zp;
393 tranversly_isotropic_double_ptr_map.at(it->getMeshsetId())->G_zp = shear_zp;
394
397 meshset,MBTET,trans_elastic.setOfBlocks[id].tEts,true
399
400
401
402 trans_elastic.setOfBlocks[id].tEts = intersect(trans_elastic.setOfBlocks[id].tEts,LatestRefinedTets);
403
404
405
406 trans_elastic.setOfBlocks[id].iD = id;
407
408 trans_elastic.setOfBlocks[id].E = 0;
409 trans_elastic.setOfBlocks[id].PoissonRatio = 0;
410 trans_elastic.setOfBlocks[id].materialDoublePtr = tranversly_isotropic_double_ptr_map.at(id);
411 trans_elastic.setOfBlocks[id].materialAdoublePtr = tranversly_isotropic_adouble_ptr_map.at(id);
412 ierr = m_field.seed_finite_elements(trans_elastic.setOfBlocks[
id].tEts); CHKERRQ(
ierr);
413 }
414 }
415
416
417
426 }
427 for(
428 map<int,NonlinearElasticElement::BlockData>::iterator sit = trans_elastic.setOfBlocks.begin();
429 sit!=trans_elastic.setOfBlocks.end();sit++
430 ) {
432 }
433
434
435
440 }
441 map<int,NonlinearElasticElement::BlockData>::iterator sit = trans_elastic.setOfBlocks.begin();
442 for(;sit!=trans_elastic.setOfBlocks.end();sit++) {
445 }
446
447
452 }
453 sit = trans_elastic.setOfBlocks.begin();
454 for(;sit!=trans_elastic.setOfBlocks.end();sit++) {
457 }
458
459
460
461
462
468
470
471 boost::ptr_vector<CohesiveInterfaceElement::PhysicalEquation> interface_materials;
472
473
474
475
476
477 double interface_beta, interface_ft, interface_Gf, interface_h;
482
484 cout << endl << *it << endl;
485
486 string name = it->getName();
487 if (name.compare(0,10,"MAT_INTERF") == 0) {
489 ierr = it->getAttributeDataStructure(mydata); CHKERRQ(
ierr);
490 cout << mydata;
492
493 interface_materials.back().youngModulus = mydata.
data.alpha;
494
495
496
497
498 interface_materials.back().h = interface_h;
499 interface_materials.back().beta = interface_beta;
500 interface_materials.back().ft = interface_ft;
501 interface_materials.back().Gf = interface_Gf;
502
508 interface_materials.back().pRisms = ents3d.subset_by_type(MBPRISM);
509 }
510 }
511
512
513 {
514 boost::ptr_vector<CohesiveInterfaceElement::PhysicalEquation>::iterator pit = interface_materials.begin();
515 for(; pit != interface_materials.end();pit++) {
517 }
518 }
520 ierr = cohesive_elements.addOps(
"DISPLACEMENT",interface_materials); CHKERRQ(
ierr);
521
522
524 lagrangian_element_disp.addLagrangiangElement("LAGRANGE_ELEM","DISPLACEMENT","LAGRANGE_MUL_DISP","MESH_NODE_POSITIONS");
525
526
527
528
529
531
533
534
535 DMType dm_name = "PLASTIC_PROB";
537
538 DM dm;
539 ierr = DMCreate(PETSC_COMM_WORLD,&dm);CHKERRQ(
ierr);
540 ierr = DMSetType(dm,dm_name);CHKERRQ(
ierr);
541
542
544 ierr = DMSetFromOptions(dm); CHKERRQ(
ierr);
546
551
553
554
556 Mat Aij;
561 ierr = VecGhostUpdateBegin(
D,INSERT_VALUES,SCATTER_FORWARD); CHKERRQ(
ierr);
562 ierr = VecGhostUpdateEnd(
D,INSERT_VALUES,SCATTER_FORWARD); CHKERRQ(
ierr);
564 ierr = MatZeroEntries(Aij); CHKERRQ(
ierr);
565
566 vector<Vec> Fvec(6);
567 for(int ii = 0;ii<6;ii++) {
568 ierr = VecDuplicate(
D,&Fvec[ii]); CHKERRQ(
ierr);
569 ierr = VecZeroEntries(Fvec[ii]); CHKERRQ(
ierr);
570 ierr = VecGhostUpdateBegin(Fvec[ii],INSERT_VALUES,SCATTER_FORWARD); CHKERRQ(
ierr);
571 ierr = VecGhostUpdateEnd(Fvec[ii],INSERT_VALUES,SCATTER_FORWARD); CHKERRQ(
ierr);
572 }
573
574
575 SmallStrainPlasticity small_strain_plasticity(m_field);
576 {
577 PetscBool bbar = PETSC_TRUE;
579 small_strain_plasticity.commonData.bBar = bbar;
580 }
581 {
582 small_strain_plasticity.feRhs.getOpPtrVector().push_back(
583 new SmallStrainPlasticity::OpGetCommonDataAtGaussPts(
584 "DISPLACEMENT",small_strain_plasticity.commonData
585 )
586 );
587 small_strain_plasticity.feRhs.getOpPtrVector().push_back(
588 new SmallStrainPlasticity::OpCalculateStress(
589 m_field,"DISPLACEMENT",small_strain_plasticity.commonData,cp
590 )
591 );
592 small_strain_plasticity.feRhs.getOpPtrVector().push_back(
593 new SmallStrainPlasticity::OpAssembleRhs(
594 "DISPLACEMENT",small_strain_plasticity.commonData
595 )
596 );
597 small_strain_plasticity.feLhs.getOpPtrVector().push_back(
598 new SmallStrainPlasticity::OpGetCommonDataAtGaussPts(
599 "DISPLACEMENT",small_strain_plasticity.commonData
600 )
601 );
602 small_strain_plasticity.feLhs.getOpPtrVector().push_back(
603 new SmallStrainPlasticity::OpCalculateStress(
604 m_field,"DISPLACEMENT",small_strain_plasticity.commonData,cp
605 )
606 );
607 small_strain_plasticity.feLhs.getOpPtrVector().push_back(
608 new SmallStrainPlasticity::OpAssembleLhs(
609 "DISPLACEMENT",small_strain_plasticity.commonData
610 )
611 );
612 small_strain_plasticity.feUpdate.getOpPtrVector().push_back(
613 new SmallStrainPlasticity::OpGetCommonDataAtGaussPts(
614 "DISPLACEMENT",small_strain_plasticity.commonData
615 )
616 );
617 small_strain_plasticity.feUpdate.getOpPtrVector().push_back(
618 new SmallStrainPlasticity::OpCalculateStress(
619 m_field,"DISPLACEMENT",small_strain_plasticity.commonData,cp
620 )
621 );
622 small_strain_plasticity.feUpdate.getOpPtrVector().push_back(
623 new SmallStrainPlasticity::OpUpdate(
624 "DISPLACEMENT",small_strain_plasticity.commonData
625 )
626 );
627 ierr = small_strain_plasticity.createInternalVariablesTag(); CHKERRQ(
ierr);
628 }
629
630 lagrangian_element_disp.setRVEBCsOperatorsNonlinear(
"DISPLACEMENT",
"LAGRANGE_MUL_DISP",
"MESH_NODE_POSITIONS",Aij,Fvec,
F,given_strain);
632 lagrangian_element_disp.methodsOp.push_back(
new TimeForceScale(
"-my_macro_strian_history",
false));
633
634
635
636
637
643
644
649
650
651 SNES snes;
653
654 ierr = SNESCreate(PETSC_COMM_WORLD,&snes); CHKERRQ(
ierr);
655
659 ierr = SNESSetFromOptions(snes); CHKERRQ(
ierr);
660
661
663 ierr = post_proc.generateReferenceElementMesh(); CHKERRQ(
ierr);
664 ierr = post_proc.addFieldValuesPostProc(
"DISPLACEMENT"); CHKERRQ(
ierr);
665 ierr = post_proc.addFieldValuesGradientPostProc(
"DISPLACEMENT"); CHKERRQ(
ierr);
666 ierr = post_proc.addFieldValuesPostProc(
"MESH_NODE_POSITIONS"); CHKERRQ(
ierr);
667
668
669
671 Vec volume_vec;
672 int volume_vec_ghost[] = { 0 };
673 ierr = VecCreateGhost(
674 PETSC_COMM_WORLD,(!m_field.
get_comm_rank())?1:0,1,1,volume_vec_ghost,&volume_vec
676 ierr = VecZeroEntries(volume_vec); CHKERRQ(
ierr);
677 vol_elem.getOpPtrVector().push_back(
new VolumeCalculation(
"DISPLACEMENT",volume_vec));
678
681
682 ierr = VecAssemblyBegin(volume_vec); CHKERRQ(
ierr);
683 ierr = VecAssemblyEnd(volume_vec); CHKERRQ(
ierr);
684 double rve_volume;
685 ierr = VecSum(volume_vec,&rve_volume); CHKERRQ(
ierr);
686
687
688 ierr = PetscPrintf(PETSC_COMM_WORLD,
"RVE Volume %3.2g\n",rve_volume); CHKERRQ(
ierr);
689 ierr = VecDestroy(&volume_vec);
690
691
692 double final_time = 1,delta_time = 0.1;
695 double delta_time0 = delta_time;
696
697
698
699
700
701 Vec D0;
702 ierr = VecDuplicate(
D,&D0); CHKERRQ(
ierr);
703
704 int step = 0;
706 SNESConvergedReason reason = SNES_CONVERGED_ITERATING;
707 for(;
t<final_time;step++) {
709
711 break;
712 }
713 PetscPrintf(
714 PETSC_COMM_WORLD,
"Step %d Time %6.4g final time %3.2g\n",step,
t,final_time
715 );
716
717 lagrangian_element_disp.getLoopFeRVEBCRhs().ts_t =
t;
718
719 ierr = VecAssemblyBegin(
D);
720 ierr = VecAssemblyEnd(
D);
722 if(step == 0 || reason < 0) {
723 ierr = SNESSetLagJacobian(snes,-2); CHKERRQ(
ierr);
724 } else {
725 ierr = SNESSetLagJacobian(snes,-1); CHKERRQ(
ierr);
726 }
727 ierr = SNESSolve(snes,PETSC_NULL,
D); CHKERRQ(
ierr);
728
729 int its;
730 ierr = SNESGetIterationNumber(snes,&its); CHKERRQ(
ierr);
731
733 PETSC_COMM_WORLD,"number of Newton iterations = %D\n",its
735
736 ierr = SNESGetConvergedReason(snes,&reason); CHKERRQ(
ierr);
737
738 if(reason<0) {
740 delta_time *= 0.1;
742 } else {const int its_d = 60;
743 const double gamma = 0.5;
744 const double max_reudction = 1;
745 const double min_reduction = 1e-1;
746 double reduction;
747 reduction = pow((double)its_d/(double)(its+1),gamma);
748 if(delta_time >= max_reudction*delta_time0 && reduction > 1) {
749 reduction = 1;
750 } else if(delta_time <= min_reduction*delta_time0 && reduction < 1) {
751 reduction = 1;
752 }
753
755 PETSC_COMM_WORLD,
756 "reduction delta_time = %6.4e delta_time = %6.4e\n",
757 reduction,delta_time
759 delta_time *= reduction;
760 if(reduction>1 && delta_time < min_reduction*delta_time0) {
761 delta_time = min_reduction*delta_time0;
762 }
763
765 dm,
D,INSERT_VALUES,SCATTER_REVERSE
767
769 dm,"PLASTIC",&small_strain_plasticity.feUpdate
771
772
773
775 dm,"INTERFACE",&cohesive_elements.feHistory
777
778
779
780 {
782 dm,"PLASTIC",&post_proc
785 {
786 std::ostringstream stm;
787 stm << "out_" << step << ".h5m";
789 }
793 rval = post_proc.postProcMesh.write_file(
796 }
797
798
800 StressHomo.resize(6);
801 StressHomo.clear();
802
803
804
805 Vec stress_homo;
806 int stress_homo_ghost[] = { 0,1,2,3,4,5,6 };
807 ierr = VecCreateGhost(
808 PETSC_COMM_WORLD,(!m_field.
get_comm_rank())?6:0,6,6,stress_homo_ghost,&stress_homo
810
811 lagrangian_element_disp.setRVEBCsHomoStressOperators("DISPLACEMENT","LAGRANGE_MUL_DISP","MESH_NODE_POSITIONS",stress_homo);
812
813
814 PetscScalar *avec;
815 ierr = VecGetArray(stress_homo,&avec); CHKERRQ(
ierr);
816 ierr = VecZeroEntries(stress_homo); CHKERRQ(
ierr);
818 "PLASTIC_PROB","LAGRANGE_ELEM",lagrangian_element_disp.getLoopFeRVEBCStress()
821 PETSC_NULL,"-my_rve_volume",&rve_volume,PETSC_NULL
823 ierr = VecAssemblyBegin(stress_homo); CHKERRQ(
ierr);
824 ierr = VecAssemblyEnd(stress_homo); CHKERRQ(
ierr);
825 ierr = VecScale(stress_homo,1.0/rve_volume); CHKERRQ(
ierr);
826 ierr = VecGhostUpdateBegin(stress_homo,INSERT_VALUES,SCATTER_FORWARD); CHKERRQ(
ierr);
827 ierr = VecGhostUpdateEnd(stress_homo,INSERT_VALUES,SCATTER_FORWARD); CHKERRQ(
ierr);
828
829 for(int jj=0; jj<6; jj++) {
830 StressHomo(jj) = avec[jj];
831 }
832
835
836 PetscPrintf(PETSC_COMM_WORLD,
837 "Macro_Strain Homo_Stress Path "
838 );
839
840
841 for(int ii=0; ii<6; ii++) {
842 PetscPrintf(
843 PETSC_COMM_WORLD,
844 "%8.5e\t",
846 );
847 }
848
849
850 for(int ii=0; ii<6; ii++) {
851 PetscPrintf(
852 PETSC_COMM_WORLD,
853 "%8.5e\t",
854 StressHomo(ii)
855 );
856 }
857
858 PetscPrintf(PETSC_COMM_WORLD,
859 "\n"
860 );
861
862 }
863 }
864 ierr = VecDestroy(&D0); CHKERRQ(
ierr);
865
866 ierr = MatDestroy(&Aij); CHKERRQ(
ierr);
869 }
871
873}
#define CATCH_ERRORS
Catch errors.
@ AINSWORTH_LEGENDRE_BASE
Ainsworth Cole (Legendre) approx. base nme:nme847.
#define MYPCOMM_INDEX
default communicator number PCOMM
#define CHKERRQ_MOAB(a)
check error code of MoAB function
PetscErrorCode DMMoFEMSetIsPartitioned(DM dm, PetscBool is_partitioned)
PetscErrorCode DMMoFEMAddElement(DM dm, std::string fe_name)
add element to dm
PetscErrorCode DMMoFEMSNESSetFunction(DM dm, const char fe_name[], MoFEM::FEMethod *method, MoFEM::BasicMethod *pre_only, MoFEM::BasicMethod *post_only)
set SNES residual evaluation function
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 DMoFEMMeshToLocalVector(DM dm, Vec l, InsertMode mode, ScatterMode scatter_mode)
set local (or ghosted) vector values on mesh for partition only
PetscErrorCode DMMoFEMSNESSetJacobian(DM dm, const char fe_name[], MoFEM::FEMethod *method, MoFEM::BasicMethod *pre_only, MoFEM::BasicMethod *post_only)
set SNES Jacobian evaluation function
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.
PetscErrorCode DMMoFEMGetSnesCtx(DM dm, MoFEM::SnesCtx **snes_ctx)
get MoFEM::SnesCtx data structure
PetscErrorCode DMoFEMMeshToGlobalVector(DM dm, Vec g, InsertMode mode, ScatterMode scatter_mode)
set ghosted vector values on all existing mesh entities
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 add_ents_to_finite_element_by_bit_ref(const BitRefLevel &bit, const BitRefLevel &mask, const std::string &name, EntityType type, int verb=DEFAULT_VERBOSITY)=0
add TET entities from given refinement level to finite element database given by name
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.
virtual MoFEMErrorCode loop_finite_elements(const std::string problem_name, const std::string &fe_name, FEMethod &method, boost::shared_ptr< NumeredEntFiniteElement_multiIndex > fe_ptr=nullptr, MoFEMTypes bh=MF_EXIST, CacheTupleWeakPtr cache_ptr=CacheTupleSharedPtr(), int verb=DEFAULT_VERBOSITY)=0
Make a loop over finite elements.
#define _IT_CUBITMESHSETS_BY_BCDATA_TYPE_FOR_LOOP_(MESHSET_MANAGER, CUBITBCTYPE, IT)
Iterator that loops over a specific Cubit MeshSet in a moFEM field.
#define _IT_CUBITMESHSETS_BY_SET_TYPE_FOR_LOOP_(MESHSET_MANAGER, CUBITBCTYPE, IT)
Iterator that loops over a specific Cubit MeshSet having a particular BC meshset in a moFEM field.
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
static MoFEMErrorCodeGeneric< moab::ErrorCode > rval
std::bitset< BITREFLEVEL_SIZE > BitRefLevel
Bit structure attached to each entity identifying to what mesh entity is attached.
PetscErrorCode SnesMat(SNES snes, Vec x, Mat A, Mat B, void *ctx)
This is MoFEM implementation for the left hand side (tangent matrix) evaluation in SNES solver.
PetscErrorCode PetscOptionsGetInt(PetscOptions *, const char pre[], const char name[], PetscInt *ivalue, PetscBool *set)
PetscErrorCode PetscOptionsGetReal(PetscOptions *, const char pre[], const char name[], PetscReal *dval, PetscBool *set)
PetscErrorCode SnesRhs(SNES snes, Vec x, Vec f, void *ctx)
This is MoFEM implementation for the right hand side (residual vector) evaluation in SNES solver.
PetscErrorCode PetscOptionsGetBool(PetscOptions *, const char pre[], const char name[], PetscBool *bval, PetscBool *set)
PetscErrorCode PetscOptionsGetRealArray(PetscOptions *, const char pre[], const char name[], PetscReal dval[], PetscInt *nmax, PetscBool *set)
PetscErrorCode PetscOptionsGetString(PetscOptions *, const char pre[], const char name[], char str[], size_t size, PetscBool *set)
double young_modulus
Young modulus.
double poisson_ratio
Poisson ratio.
constexpr double t
plate stiffness
Constitutive (physical) equation for interface.
Cohesive element implementation.
virtual moab::Interface & get_moab()=0
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.
virtual int get_comm_rank() const =0
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.
DEPRECATED MoFEMErrorCode seed_ref_level_3D(const EntityHandle meshset, const BitRefLevel &bit, int verb=-1)
seed 2D entities in the meshset and their adjacencies (only TETs adjacencies) in a particular BitRefL...
Transverse Isotropic material data structure.
Linear interface data structure.
Projection of edge entities with one mid-node on hierarchical basis.
Interface for nonlinear (SNES) solver.
Volume finite element base.
Operator performs automatic differentiation.
structure grouping operators and data used for calculation of nonlinear elastic element
Force scale operator for reading two columns.