v0.14.0
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
UFProblem< dim > Struct Template Reference
Collaboration diagram for UFProblem< dim >:
[legend]

Public Member Functions

 UFProblem (moab::Core &mb_instance, MoFEM::Core &core, const int order, const int n_species)
 
MoFEMErrorCode run_analysis ()
 
 UFProblem (moab::Core &mb_instance, MoFEM::Core &core, const int order, const int n_species)
 
MoFEMErrorCode run_analysis ()
 
 UFProblem (moab::Core &mb_instance, MoFEM::Core &core, const int order, const int n_species)
 
MoFEMErrorCode run_analysis ()
 

Private Member Functions

MoFEMErrorCode setup_system ()
 
MoFEMErrorCode add_fe (std::string field_name)
 
MoFEMErrorCode set_blockData (std::map< int, BlockData > &block_data_map)
 
MoFEMErrorCode set_initial_values (std::string field_name, int block_id, Range &surface, double &init_val)
 
MoFEMErrorCode push_mass_ele (std::string field_name)
 
MoFEMErrorCode update_vol_fe (boost::shared_ptr< VolEle > &vol_ele, boost::shared_ptr< PreviousData > &data)
 
MoFEMErrorCode update_stiff_rhs (std::string field_name, boost::shared_ptr< VectorDouble > &values_ptr, boost::shared_ptr< MatrixDouble > &grads_ptr, boost::shared_ptr< VectorDouble > &dots_ptr)
 
MoFEMErrorCode push_stiff_rhs (std::string field_name, boost::shared_ptr< PreviousData > &data, std::map< int, BlockData > &block_map)
 
MoFEMErrorCode update_stiff_lhs (std::string field_name, boost::shared_ptr< VectorDouble > &values_ptr, boost::shared_ptr< MatrixDouble > &grads_ptr)
 
MoFEMErrorCode push_stiff_lhs (std::string field_name, boost::shared_ptr< PreviousData > &data, std::map< int, BlockData > &block_map)
 
MoFEMErrorCode set_integration_rule ()
 
MoFEMErrorCode set_fe_in_loop ()
 
MoFEMErrorCode post_proc_fields (std::string field_name)
 
MoFEMErrorCode output_result ()
 
MoFEMErrorCode solve ()
 
MoFEMErrorCode setup_system ()
 
MoFEMErrorCode add_fe (std::string field_name)
 
MoFEMErrorCode set_blockData (std::map< int, BlockData > &block_data_map)
 
MoFEMErrorCode set_initial_values (std::string field_name, int block_id, Range &surface, double &init_val)
 
MoFEMErrorCode push_mass_ele (std::string field_name)
 
MoFEMErrorCode update_vol_fe (boost::shared_ptr< VolEle > &vol_ele, boost::shared_ptr< PreviousData > &data)
 
MoFEMErrorCode update_stiff_rhs (std::string field_name, boost::shared_ptr< VectorDouble > &values_ptr, boost::shared_ptr< MatrixDouble > &grads_ptr, boost::shared_ptr< VectorDouble > &dots_ptr)
 
MoFEMErrorCode push_stiff_rhs (std::string field_name, boost::shared_ptr< PreviousData > &data, std::map< int, BlockData > &block_map)
 
MoFEMErrorCode update_stiff_lhs (std::string field_name, boost::shared_ptr< VectorDouble > &values_ptr, boost::shared_ptr< MatrixDouble > &grads_ptr)
 
MoFEMErrorCode push_stiff_lhs (std::string field_name, boost::shared_ptr< PreviousData > &data, std::map< int, BlockData > &block_map)
 
MoFEMErrorCode set_integration_rule ()
 
MoFEMErrorCode set_fe_in_loop ()
 
MoFEMErrorCode post_proc_fields (std::string field_name)
 
MoFEMErrorCode output_result ()
 
MoFEMErrorCode solve ()
 
MoFEMErrorCode setup_system ()
 
MoFEMErrorCode add_fe (std::string field_name)
 
MoFEMErrorCode set_initial_values (std::string field_name, std::string init_name, Range &surface, double &init_val)
 
MoFEMErrorCode push_mass_ele (std::string field_name)
 
MoFEMErrorCode update_vol_fe (boost::shared_ptr< VolEle > &vol_ele)
 
MoFEMErrorCode update_stiff_rhs (std::string field_name, boost::shared_ptr< VectorDouble > &values_ptr, boost::shared_ptr< MatrixDouble > &grads_ptr, boost::shared_ptr< VectorDouble > &dots_ptr)
 
MoFEMErrorCode push_stiff_rhs (std::string field_name, boost::shared_ptr< PreviousData > &data)
 
MoFEMErrorCode update_stiff_lhs (std::string field_name, boost::shared_ptr< VectorDouble > &values_ptr, boost::shared_ptr< MatrixDouble > &grads_ptr, boost::shared_ptr< VectorDouble > &dots_ptr)
 
MoFEMErrorCode push_stiff_lhs (std::string field_name, boost::shared_ptr< PreviousData > &data)
 
MoFEMErrorCode set_integration_rule ()
 
MoFEMErrorCode set_fe_in_loop ()
 
MoFEMErrorCode post_proc_fields (std::string field_name)
 
MoFEMErrorCode output_result ()
 
MoFEMErrorCode solve ()
 

Private Attributes

MoFEM::Interfacem_field
 
Simplesimple_interface
 
moab::Interface & moab
 
SmartPetscObj< DM > dm
 
SmartPetscObj< TS > ts
 
Range natural_bdry_ents
 
std::vector< Rangeinner_surface
 
double global_error
 
MPI_Comm cOmm
 
const int rAnk
 
int order
 
int nb_species
 
std::map< int, BlockDatamaterial_blocks
 
boost::shared_ptr< VolElevol_ele_stiff_rhs
 
boost::shared_ptr< VolElevol_ele_stiff_lhs
 
boost::shared_ptr< FaceEleboundary_ele_rhs
 
boost::shared_ptr< VolElevol_mass_ele
 
boost::shared_ptr< PostProcpost_proc
 
boost::shared_ptr< Monitormonitor_ptr
 
std::vector< boost::shared_ptr< PreviousData > > data
 
std::vector< boost::shared_ptr< MatrixDouble > > grads_ptr
 
std::vector< boost::shared_ptr< VectorDouble > > values_ptr
 
std::vector< boost::shared_ptr< VectorDouble > > dots_ptr
 
boost::shared_ptr< ForcesAndSourcesCorenull
 
boost::shared_ptr< PostProcVolumeOnRefinedMeshpost_proc
 

Detailed Description

template<int dim>
struct UFProblem< dim >

Definition at line 10 of file unsatu2dFlow_prob.cpp.

Constructor & Destructor Documentation

◆ UFProblem() [1/3]

template<int dim>
UFProblem< dim >::UFProblem ( moab::Core &  mb_instance,
MoFEM::Core core,
const int  order,
const int  n_species 
)
inline

Definition at line 12 of file unsatu2dFlow_prob.cpp.

13 : moab( mb_instance)
14 , m_field(core)
15 , order(order)
16 , nb_species(n_species)
19 vol_ele_stiff_rhs = boost::shared_ptr<VolEle>(new VolEle(m_field));
20 vol_ele_stiff_lhs = boost::shared_ptr<VolEle>(new VolEle(m_field));
21
22 boundary_ele_rhs = boost::shared_ptr<FaceEle>(new FaceEle(m_field));
23
24
25 post_proc = boost::shared_ptr<PostProc>(
26 new PostProc(m_field));
27
28 data.resize(nb_species);
29 values_ptr.resize(nb_species);
30 grads_ptr.resize(nb_species);
31 dots_ptr.resize(nb_species);
33
34 for(int i = 0; i < nb_species; ++i){
35 data[i] = boost::shared_ptr<PreviousData>(new PreviousData());
36 grads_ptr[i] = boost::shared_ptr<MatrixDouble>(data[i], &data[i]->grads);
37 values_ptr[i] = boost::shared_ptr<VectorDouble>(data[i], &data[i]->values);
38 dots_ptr[i] = boost::shared_ptr<VectorDouble>(data[i], &data[i]->dot_values);
39 }
40
41 }
MoFEM::FaceElementForcesAndSourcesCore FaceEle
FTensor::Index< 'i', SPACE_DIM > i
PostProcFaceOnRefinedMesh PostProc
virtual MPI_Comm & get_comm() const =0
virtual int get_comm_rank() const =0
boost::shared_ptr< VolEle > vol_ele_stiff_rhs
MoFEM::Interface & m_field
std::vector< boost::shared_ptr< MatrixDouble > > grads_ptr
std::vector< boost::shared_ptr< PreviousData > > data
std::vector< Range > inner_surface
boost::shared_ptr< VolEle > vol_ele_stiff_lhs
moab::Interface & moab
std::vector< boost::shared_ptr< VectorDouble > > values_ptr
boost::shared_ptr< PostProc > post_proc
std::vector< boost::shared_ptr< VectorDouble > > dots_ptr
boost::shared_ptr< FaceEle > boundary_ele_rhs
VolumeElementForcesAndSourcesCore VolEle

◆ UFProblem() [2/3]

template<int dim>
UFProblem< dim >::UFProblem ( moab::Core &  mb_instance,
MoFEM::Core core,
const int  order,
const int  n_species 
)
inline

Definition at line 12 of file unsaturate_flow.cpp.

14 : moab(mb_instance), m_field(core), order(order), nb_species(n_species),
16 vol_ele_stiff_rhs = boost::shared_ptr<VolEle>(new VolEle(m_field));
17 vol_ele_stiff_lhs = boost::shared_ptr<VolEle>(new VolEle(m_field));
18
19 boundary_ele_rhs = boost::shared_ptr<FaceEle>(new FaceEle(m_field));
20
21 post_proc = boost::shared_ptr<PostProcVolumeOnRefinedMesh>(
23
24 data.resize(nb_species);
25 values_ptr.resize(nb_species);
26 grads_ptr.resize(nb_species);
27 dots_ptr.resize(nb_species);
29
30 for (int i = 0; i < nb_species; ++i) {
31 data[i] = boost::shared_ptr<PreviousData>(new PreviousData());
32 grads_ptr[i] = boost::shared_ptr<MatrixDouble>(data[i], &data[i]->grads);
33 values_ptr[i] =
34 boost::shared_ptr<VectorDouble>(data[i], &data[i]->values);
35 dots_ptr[i] =
36 boost::shared_ptr<VectorDouble>(data[i], &data[i]->dot_values);
37 }
38 }
Post processing.

◆ UFProblem() [3/3]

template<int dim>
UFProblem< dim >::UFProblem ( moab::Core &  mb_instance,
MoFEM::Core core,
const int  order,
const int  n_species 
)
inline

Definition at line 11 of file unsatu2dFlow_prob.cpp.

13 : moab(mb_instance), m_field(core), order(order), nb_species(n_species),
15 vol_ele_stiff_rhs = boost::shared_ptr<VolEle>(new VolEle(m_field));
16 vol_ele_stiff_lhs = boost::shared_ptr<VolEle>(new VolEle(m_field));
17
18 boundary_ele_rhs = boost::shared_ptr<FaceEle>(new FaceEle(m_field));
19
20 post_proc = boost::shared_ptr<PostProc>(new PostProc(m_field));
21
22 data.resize(nb_species);
23 values_ptr.resize(nb_species);
24 grads_ptr.resize(nb_species);
25 dots_ptr.resize(nb_species);
27
28 for (int i = 0; i < nb_species; ++i) {
29 data[i] = boost::shared_ptr<PreviousData>(new PreviousData());
30 grads_ptr[i] = boost::shared_ptr<MatrixDouble>(data[i], &data[i]->grads);
31 values_ptr[i] =
32 boost::shared_ptr<VectorDouble>(data[i], &data[i]->values);
33 dots_ptr[i] =
34 boost::shared_ptr<VectorDouble>(data[i], &data[i]->dot_values);
35 }
36 }

Member Function Documentation

◆ add_fe() [1/3]

template<int dim>
MoFEMErrorCode UFProblem< dim >::add_fe ( std::string  field_name)
private

Definition at line 139 of file unsatu2dFlow_prob.cpp.

139 {
142
146
147
149}
@ AINSWORTH_LEGENDRE_BASE
Ainsworth Cole (Legendre) approx. base .
Definition: definitions.h:60
@ H1
continuous field
Definition: definitions.h:85
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:346
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:416
#define CHKERR
Inline error check.
Definition: definitions.h:535
constexpr auto field_name
MoFEMErrorCode addDomainField(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_ZERO, int verb=-1)
Add field on domain.
Definition: Simple.cpp:264
MoFEMErrorCode setFieldOrder(const std::string field_name, const int order, const Range *ents=NULL)
Set field order.
Definition: Simple.cpp:473
MoFEMErrorCode addBoundaryField(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_ZERO, int verb=-1)
Add field on boundary.
Definition: Simple.cpp:282
Simple * simple_interface

◆ add_fe() [2/3]

template<int dim>
MoFEMErrorCode UFProblem< dim >::add_fe ( std::string  field_name)
private

◆ add_fe() [3/3]

template<int dim>
MoFEMErrorCode UFProblem< dim >::add_fe ( std::string  field_name)
private

◆ output_result() [1/3]

template<int dim>
MoFEMErrorCode UFProblem< dim >::output_result
private

Definition at line 328 of file unsatu2dFlow_prob.cpp.

328 {
333}
PetscErrorCode DMMoFEMTSSetMonitor(DM dm, TS ts, const std::string fe_name, boost::shared_ptr< MoFEM::FEMethod > method, boost::shared_ptr< MoFEM::BasicMethod > pre_only, boost::shared_ptr< MoFEM::BasicMethod > post_only)
Set Monitor To TS solver.
Definition: DMMoFEM.cpp:1042
const std::string getDomainFEName() const
Get the Domain FE Name.
Definition: Simple.hpp:341
SmartPetscObj< TS > ts
boost::shared_ptr< Monitor > monitor_ptr
SmartPetscObj< DM > dm
boost::shared_ptr< ForcesAndSourcesCore > null

◆ output_result() [2/3]

template<int dim>
MoFEMErrorCode UFProblem< dim >::output_result ( )
private

◆ output_result() [3/3]

template<int dim>
MoFEMErrorCode UFProblem< dim >::output_result ( )
private

◆ post_proc_fields() [1/3]

template<int dim>
MoFEMErrorCode UFProblem< dim >::post_proc_fields ( std::string  field_name)
private

Definition at line 321 of file unsatu2dFlow_prob.cpp.

321 {
323 post_proc->addFieldValuesPostProc(field_name);
325}

◆ post_proc_fields() [2/3]

template<int dim>
MoFEMErrorCode UFProblem< dim >::post_proc_fields ( std::string  field_name)
private

◆ post_proc_fields() [3/3]

template<int dim>
MoFEMErrorCode UFProblem< dim >::post_proc_fields ( std::string  field_name)
private

◆ push_mass_ele() [1/3]

template<int dim>
MoFEMErrorCode UFProblem< dim >::push_mass_ele ( std::string  field_name)
private

◆ push_mass_ele() [2/3]

template<int dim>
MoFEMErrorCode UFProblem< dim >::push_mass_ele ( std::string  field_name)
private

◆ push_mass_ele() [3/3]

template<int dim>
MoFEMErrorCode UFProblem< dim >::push_mass_ele ( std::string  field_name)
private

◆ push_stiff_lhs() [1/3]

template<int dim>
MoFEMErrorCode UFProblem< dim >::push_stiff_lhs ( std::string  field_name,
boost::shared_ptr< PreviousData > &  data 
)
private

Definition at line 223 of file unsatu2dFlow_prob.cpp.

◆ push_stiff_lhs() [2/3]

template<int dim>
MoFEMErrorCode UFProblem< dim >::push_stiff_lhs ( std::string  field_name,
boost::shared_ptr< PreviousData > &  data,
std::map< int, BlockData > &  block_map 
)
private

Definition at line 279 of file unsatu2dFlow_prob.cpp.

281 {
283
284 vol_ele_stiff_lhs->getOpPtrVector().push_back(
286
288}

◆ push_stiff_lhs() [3/3]

template<int dim>
MoFEMErrorCode UFProblem< dim >::push_stiff_lhs ( std::string  field_name,
boost::shared_ptr< PreviousData > &  data,
std::map< int, BlockData > &  block_map 
)
private

Definition at line 253 of file unsaturate_flow.cpp.

255 {
257
258 vol_ele_stiff_lhs->getOpPtrVector().push_back(
259 new OpAssembleStiffLhs<3>(field_name, data, block_map));
260
262}

◆ push_stiff_rhs() [1/3]

template<int dim>
MoFEMErrorCode UFProblem< dim >::push_stiff_rhs ( std::string  field_name,
boost::shared_ptr< PreviousData > &  data 
)
private

Definition at line 195 of file unsatu2dFlow_prob.cpp.

196 {
198
199 vol_ele_stiff_rhs->getOpPtrVector().push_back(
201 // boundary_ele_rhs->getOpPtrVector().push_back(
202 // new OpAssembleNaturalBCRhs(field_name,natural_bdry_ents));
204}

◆ push_stiff_rhs() [2/3]

template<int dim>
MoFEMErrorCode UFProblem< dim >::push_stiff_rhs ( std::string  field_name,
boost::shared_ptr< PreviousData > &  data,
std::map< int, BlockData > &  block_map 
)
private

Definition at line 254 of file unsatu2dFlow_prob.cpp.

256 {
258
259 vol_ele_stiff_rhs->getOpPtrVector().push_back(
261 // boundary_ele_rhs->getOpPtrVector().push_back(
262 // new OpAssembleNaturalBCRhs(field_name,natural_bdry_ents));
264}

◆ push_stiff_rhs() [3/3]

template<int dim>
MoFEMErrorCode UFProblem< dim >::push_stiff_rhs ( std::string  field_name,
boost::shared_ptr< PreviousData > &  data,
std::map< int, BlockData > &  block_map 
)
private

Definition at line 228 of file unsaturate_flow.cpp.

230 {
232
233 vol_ele_stiff_rhs->getOpPtrVector().push_back(
234 new OpAssembleStiffRhs<3>(field_name, data, block_map));
235 // boundary_ele_rhs->getOpPtrVector().push_back(
236 // new OpAssembleNaturalBCRhs(field_name,natural_bdry_ents));
238}

◆ run_analysis() [1/3]

template<int dim>
MoFEMErrorCode UFProblem< dim >::run_analysis

Definition at line 351 of file unsatu2dFlow_prob.cpp.

351 {
353 global_error = 0;
354 std::vector<std::string> mass_names(nb_species);
355
356 for(int i = 0; i < nb_species; ++i){
357 mass_names[i] = "h" + boost::lexical_cast<std::string>(i+1);
358 }
360 for (int i = 0; i < nb_species; ++i) {
361 add_fe(mass_names[i]);
362 }
363
364
365
367
369 string name = it->getName();
370 if (name.compare(0, 14, "ESSENTIAL") == 0) {
371 CHKERR it->getMeshsetIdEntitiesByDimension(m_field.get_moab(), dim-1,
372 natural_bdry_ents, true);
373 }
374 }
375 // Range face_edges;
376
377 // CHKERR moab.get_adjacencies(natural_bdry_ents, dim-1, false, face_edges, moab::Interface::UNION);
378
379 Range edges_verts;
380 CHKERR moab.get_connectivity(natural_bdry_ents, edges_verts, false);
381
382 Range bdry_ents;
383 bdry_ents = unite(natural_bdry_ents, edges_verts);
384 // bdry_ents = unite(bdry_ents, face_edges_verts);
385
386 // bdry_ents.print();
387 // cout << "size: " <<endl;
388 // cout << bdry_ents.size() <<endl;
389 // cout << bdry_ents <<endl;
390
391 CHKERR m_field.getInterface<ProblemsManager>()->removeDofsOnEntities(
392 "SimpleProblem", mass_names[0], bdry_ents);
393
395
396 cout << "Material Block Size: " << material_blocks.size() << endl;
397
398 material_blocks[1003].block_ents.print();
399 cout << "size: ";
400 cout << material_blocks[1003].block_ents.size() << endl;
401
402 VectorDouble initVals;
403 initVals.resize(3, false);
404 initVals.clear();
405
406 initVals[0] = -0.8;
407 initVals[1] = 0.0;
408 initVals[2] = 0.0;
409
410 for (int i = 0; i < nb_species; ++i) {
411 CHKERR set_initial_values(mass_names[i], i + 2, inner_surface[i], initVals[i]);
412
413 }
414
415 if (!natural_bdry_ents.empty()) {
416 Range surface_verts;
417
418 CHKERR moab.get_connectivity(natural_bdry_ents, surface_verts, false);
420 0.0, MBVERTEX, surface_verts, mass_names[0]);
421 }
422
423
424
425
426
427
428
430
432
433 for (int i = 0; i < nb_species; ++i) {
435 dots_ptr[i]);
437 }
438
439
441
442 for (int i = 0; i < nb_species; ++i) {
444 CHKERR push_stiff_lhs(mass_names[i], data[i],
445 material_blocks); // nb_species times
446 }
447
448
450
452
454
455 post_proc->generateReferenceElementMesh(); // only once
456
457 for (int i = 0; i < nb_species; ++i) {
458 CHKERR post_proc_fields(mass_names[i]);
459 }
460
461 monitor_ptr = boost::shared_ptr<Monitor>(
462 new Monitor(cOmm, rAnk, dm, post_proc, global_error)); // nb_species times
463 CHKERR output_result(); // only once
464
465 CHKERR solve(); // only once
466
468}
@ BLOCKSET
Definition: definitions.h:148
const int dim
#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.
auto createTS(MPI_Comm comm)
virtual moab::Interface & get_moab()=0
Basic algebra on fields.
Definition: FieldBlas.hpp:21
Problem manager is used to build and partition problems.
MoFEMErrorCode getDM(DM *dm)
Get DM.
Definition: Simple.cpp:667
MoFEMErrorCode setUp(const PetscBool is_partitioned=PETSC_TRUE)
Setup problem.
Definition: Simple.cpp:611
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface refernce to pointer of interface.
[Push operators to pipeline]
MoFEMErrorCode push_stiff_lhs(std::string field_name, boost::shared_ptr< PreviousData > &data, std::map< int, BlockData > &block_map)
MoFEMErrorCode update_stiff_lhs(std::string field_name, boost::shared_ptr< VectorDouble > &values_ptr, boost::shared_ptr< MatrixDouble > &grads_ptr)
std::map< int, BlockData > material_blocks
MoFEMErrorCode set_initial_values(std::string field_name, int block_id, Range &surface, double &init_val)
MoFEMErrorCode solve()
MoFEMErrorCode update_vol_fe(boost::shared_ptr< VolEle > &vol_ele, boost::shared_ptr< PreviousData > &data)
MoFEMErrorCode set_fe_in_loop()
Range natural_bdry_ents
MoFEMErrorCode update_stiff_rhs(std::string field_name, boost::shared_ptr< VectorDouble > &values_ptr, boost::shared_ptr< MatrixDouble > &grads_ptr, boost::shared_ptr< VectorDouble > &dots_ptr)
MoFEMErrorCode output_result()
MoFEMErrorCode set_integration_rule()
MoFEMErrorCode post_proc_fields(std::string field_name)
MoFEMErrorCode push_stiff_rhs(std::string field_name, boost::shared_ptr< PreviousData > &data, std::map< int, BlockData > &block_map)
MoFEMErrorCode setup_system()
MoFEMErrorCode set_blockData(std::map< int, BlockData > &block_data_map)
MoFEMErrorCode add_fe(std::string field_name)

◆ run_analysis() [2/3]

template<int dim>
MoFEMErrorCode UFProblem< dim >::run_analysis ( )

◆ run_analysis() [3/3]

template<int dim>
MoFEMErrorCode UFProblem< dim >::run_analysis ( )

◆ set_blockData() [1/2]

template<int dim>
MoFEMErrorCode UFProblem< dim >::set_blockData ( std::map< int, BlockData > &  block_data_map)
private

Definition at line 152 of file unsatu2dFlow_prob.cpp.

152 {
155 string name = it->getName();
156 const int id = it->getMeshsetId();
157 if (name.compare(0, 14, "REGION1") == 0) {
158 CHKERR m_field.getInterface<MeshsetsManager>()->getEntitiesByDimension(
159 id, BLOCKSET, dim, block_map[id].block_ents, true);
160 // cout << "Name: " << name << endl;
161
162 // block_map[id].block_ents.print();
163 // cout << "size: ";
164 // cout << block_map[id].block_ents.size() << endl;
165
166
167 block_map[id].block_id = id;
168 block_map[id].K_s = 1.000;
169 block_map[id].h_s = 0.000;
170 block_map[id].theta_s = 0.43000;
171 block_map[id].theta_m = 0.43000;
172 block_map[id].theta_r = 0.04500;
173 block_map[id].alpha = 1.812500;
174 block_map[id].nn = 5.3800;
175
176 } else if (name.compare(0, 14, "REGION2") == 0) {
177 CHKERR m_field.getInterface<MeshsetsManager>()->getEntitiesByDimension(
178 id, BLOCKSET, dim, block_map[id].block_ents, true);
179
180 block_map[id].block_id = id;
181 } else if (name.compare(0, 14, "REGION3") == 0) {
182 CHKERR m_field.getInterface<MeshsetsManager>()->getEntitiesByDimension(
183 id, BLOCKSET, dim, block_map[id].block_ents, true);
184
185 block_map[id].block_id = id;
186 } else if (name.compare(0, 14, "REGION4") == 0) {
187 CHKERR m_field.getInterface<MeshsetsManager>()->getEntitiesByDimension(
188 id, BLOCKSET, dim, block_map[id].block_ents, true);
189
190 block_map[id].block_id = id;
191 } else if (name.compare(0, 14, "REGION5") == 0) {
192 CHKERR m_field.getInterface<MeshsetsManager>()->getEntitiesByDimension(
193 id, BLOCKSET, dim, block_map[id].block_ents, true);
194
195 block_map[id].block_id = id;
196 }
197 }
199}
Interface for managing meshsets containing materials and boundary conditions.

◆ set_blockData() [2/2]

template<int dim>
MoFEMErrorCode UFProblem< dim >::set_blockData ( std::map< int, BlockData > &  block_data_map)
private

◆ set_fe_in_loop() [1/3]

template<int dim>
MoFEMErrorCode UFProblem< dim >::set_fe_in_loop
private

Definition at line 304 of file unsatu2dFlow_prob.cpp.

304 {
306 CHKERR TSSetType(ts, TSARKIMEX);
307 CHKERR TSARKIMEXSetType(ts, TSARKIMEXA2);
308
311
314
317
319}
PetscErrorCode DMMoFEMTSSetIFunction(DM dm, const char fe_name[], MoFEM::FEMethod *method, MoFEM::BasicMethod *pre_only, MoFEM::BasicMethod *post_only)
set TS implicit function evaluation function
Definition: DMMoFEM.cpp:786
PetscErrorCode DMMoFEMTSSetIJacobian(DM dm, const std::string fe_name, boost::shared_ptr< MoFEM::FEMethod > method, boost::shared_ptr< MoFEM::BasicMethod > pre_only, boost::shared_ptr< MoFEM::BasicMethod > post_only)
set TS Jacobian evaluation function
Definition: DMMoFEM.cpp:839
const std::string getBoundaryFEName() const
Get the Boundary FE Name.
Definition: Simple.hpp:348

◆ set_fe_in_loop() [2/3]

template<int dim>
MoFEMErrorCode UFProblem< dim >::set_fe_in_loop ( )
private

◆ set_fe_in_loop() [3/3]

template<int dim>
MoFEMErrorCode UFProblem< dim >::set_fe_in_loop ( )
private

◆ set_initial_values() [1/3]

template<int dim>
MoFEMErrorCode UFProblem< dim >::set_initial_values ( std::string  field_name,
int  block_id,
Range surface,
double init_val 
)
private

Definition at line 202 of file unsatu2dFlow_prob.cpp.

203 {
206 BLOCKSET)) {
207 CHKERR m_field.getInterface<MeshsetsManager>()->getEntitiesByDimension(
208 block_id, BLOCKSET, dim, surface, true);
209 }
210 if (!surface.empty()) {
211 Range surface_verts;
212
213 CHKERR moab.get_connectivity(surface, surface_verts, false);
215 init_val, MBVERTEX, surface_verts, field_name);
216 }
217
219}
bool checkMeshset(const int ms_id, const CubitBCType cubit_bc_type) const
check for CUBIT Id and CUBIT type

◆ set_initial_values() [2/3]

template<int dim>
MoFEMErrorCode UFProblem< dim >::set_initial_values ( std::string  field_name,
int  block_id,
Range surface,
double init_val 
)
private

◆ set_initial_values() [3/3]

template<int dim>
MoFEMErrorCode UFProblem< dim >::set_initial_values ( std::string  field_name,
std::string  init_name,
Range surface,
double init_val 
)
private

Definition at line 134 of file unsatu2dFlow_prob.cpp.

137 {
139 // if (m_field.getInterface<MeshsetsManager>()->checkMeshset(block_id,
140 // BLOCKSET)) {
141 // CHKERR m_field.getInterface<MeshsetsManager>()->getEntitiesByDimension(
142 // block_id, BLOCKSET, dim, surface, true);
143 // }
145 string name = it->getName();
146 if (name.compare(0, init_name.size(), init_name) == 0) {
147 CHKERR it->getMeshsetIdEntitiesByDimension(m_field.get_moab(), dim,
148 surface, true);
149 }
150 }
151
152 if (!surface.empty()) {
153 Range surface_verts;
154
155 CHKERR moab.get_connectivity(surface, surface_verts, false);
157 init_val, MBVERTEX, surface_verts, field_name);
158 }
159
161}

◆ set_integration_rule() [1/3]

template<int dim>
MoFEMErrorCode UFProblem< dim >::set_integration_rule
private

Definition at line 290 of file unsatu2dFlow_prob.cpp.

290 {
292 auto vol_rule = [](int, int, int p) -> int { return 2 * p; };
293
294
295 vol_ele_stiff_rhs->getRuleHook = vol_rule;
296
297 vol_ele_stiff_lhs->getRuleHook = vol_rule;
298 boundary_ele_rhs->getRuleHook = vol_rule;
300}
static Index< 'p', 3 > p

◆ set_integration_rule() [2/3]

template<int dim>
MoFEMErrorCode UFProblem< dim >::set_integration_rule ( )
private

◆ set_integration_rule() [3/3]

template<int dim>
MoFEMErrorCode UFProblem< dim >::set_integration_rule ( )
private

◆ setup_system() [1/3]

template<int dim>
MoFEMErrorCode UFProblem< dim >::setup_system
private

Definition at line 130 of file unsatu2dFlow_prob.cpp.

130 {
136}
MoFEMErrorCode loadFile(const std::string options, const std::string mesh_file_name, LoadFileFunc loadFunc=defaultLoadFileFunc)
Load mesh file.
Definition: Simple.cpp:194
MoFEMErrorCode getOptions()
get options
Definition: Simple.cpp:180

◆ setup_system() [2/3]

template<int dim>
MoFEMErrorCode UFProblem< dim >::setup_system ( )
private

◆ setup_system() [3/3]

template<int dim>
MoFEMErrorCode UFProblem< dim >::setup_system ( )
private

◆ solve() [1/3]

template<int dim>
MoFEMErrorCode UFProblem< dim >::solve
private

Definition at line 335 of file unsatu2dFlow_prob.cpp.

335 {
337 // Create solution vector
340 CHKERR DMoFEMMeshToLocalVector(dm, X, INSERT_VALUES, SCATTER_FORWARD);
341 // Solve problem
342 double ftime = 1;
343 CHKERR TSSetDM(ts, dm);
344 CHKERR TSSetDuration(ts, PETSC_DEFAULT, ftime);
345 CHKERR TSSetSolution(ts, X);
346 CHKERR TSSetFromOptions(ts);
347 CHKERR TSSolve(ts, X);
349}
PetscErrorCode DMoFEMMeshToLocalVector(DM dm, Vec l, InsertMode mode, ScatterMode scatter_mode)
set local (or ghosted) vector values on mesh for partition only
Definition: DMMoFEM.cpp:509
PetscErrorCode DMCreateGlobalVector_MoFEM(DM dm, Vec *g)
DMShellSetCreateGlobalVector.
Definition: DMMoFEM.cpp:1153
intrusive_ptr for managing petsc objects

◆ solve() [2/3]

template<int dim>
MoFEMErrorCode UFProblem< dim >::solve ( )
private

◆ solve() [3/3]

template<int dim>
MoFEMErrorCode UFProblem< dim >::solve ( )
private

◆ update_stiff_lhs() [1/3]

template<int dim>
MoFEMErrorCode UFProblem< dim >::update_stiff_lhs ( std::string  field_name,
boost::shared_ptr< VectorDouble > &  values_ptr,
boost::shared_ptr< MatrixDouble > &  grads_ptr 
)
private

Definition at line 267 of file unsatu2dFlow_prob.cpp.

269 {
271 vol_ele_stiff_lhs->getOpPtrVector().push_back(
273
274 vol_ele_stiff_lhs->getOpPtrVector().push_back(
277}
Get field gradients at integration pts for scalar filed rank 0, i.e. vector field.
Get value at integration points for scalar field.

◆ update_stiff_lhs() [2/3]

template<int dim>
MoFEMErrorCode UFProblem< dim >::update_stiff_lhs ( std::string  field_name,
boost::shared_ptr< VectorDouble > &  values_ptr,
boost::shared_ptr< MatrixDouble > &  grads_ptr 
)
private

◆ update_stiff_lhs() [3/3]

template<int dim>
MoFEMErrorCode UFProblem< dim >::update_stiff_lhs ( std::string  field_name,
boost::shared_ptr< VectorDouble > &  values_ptr,
boost::shared_ptr< MatrixDouble > &  grads_ptr,
boost::shared_ptr< VectorDouble > &  dots_ptr 
)
private

Definition at line 208 of file unsatu2dFlow_prob.cpp.

211 {
213 vol_ele_stiff_lhs->getOpPtrVector().push_back(
215 vol_ele_stiff_lhs->getOpPtrVector().push_back(
217 vol_ele_stiff_lhs->getOpPtrVector().push_back(
220}
OpCalculateScalarFieldValuesDot OpCalculateScalarValuesDot

◆ update_stiff_rhs() [1/3]

template<int dim>
MoFEMErrorCode UFProblem< dim >::update_stiff_rhs ( std::string  field_name,
boost::shared_ptr< VectorDouble > &  values_ptr,
boost::shared_ptr< MatrixDouble > &  grads_ptr,
boost::shared_ptr< VectorDouble > &  dots_ptr 
)
private

Definition at line 238 of file unsatu2dFlow_prob.cpp.

241 {
242
244
245 vol_ele_stiff_rhs->getOpPtrVector().push_back(
247 vol_ele_stiff_rhs->getOpPtrVector().push_back(
249 vol_ele_stiff_rhs->getOpPtrVector().push_back(
252}

◆ update_stiff_rhs() [2/3]

template<int dim>
MoFEMErrorCode UFProblem< dim >::update_stiff_rhs ( std::string  field_name,
boost::shared_ptr< VectorDouble > &  values_ptr,
boost::shared_ptr< MatrixDouble > &  grads_ptr,
boost::shared_ptr< VectorDouble > &  dots_ptr 
)
private

◆ update_stiff_rhs() [3/3]

template<int dim>
MoFEMErrorCode UFProblem< dim >::update_stiff_rhs ( std::string  field_name,
boost::shared_ptr< VectorDouble > &  values_ptr,
boost::shared_ptr< MatrixDouble > &  grads_ptr,
boost::shared_ptr< VectorDouble > &  dots_ptr 
)
private

◆ update_vol_fe() [1/3]

template<int dim>
MoFEMErrorCode UFProblem< dim >::update_vol_fe ( boost::shared_ptr< VolEle > &  vol_ele)
private

Definition at line 165 of file unsatu2dFlow_prob.cpp.

165 {
167 auto det_ptr = boost::make_shared<VectorDouble>();
168 auto jac_ptr = boost::make_shared<MatrixDouble>();
169 auto inv_jac_ptr = boost::make_shared<MatrixDouble>();
170 vol_ele->getOpPtrVector().push_back(new OpCalculateHOJacForFace(jac_ptr));
171 vol_ele->getOpPtrVector().push_back(
172 new OpInvertMatrix<2>(jac_ptr, det_ptr, inv_jac_ptr));
173 vol_ele->getOpPtrVector().push_back(new OpSetInvJacH1ForFace(inv_jac_ptr));
175}
OpCalculateHOJacForFaceImpl< 2 > OpCalculateHOJacForFace

◆ update_vol_fe() [2/3]

template<int dim>
MoFEMErrorCode UFProblem< dim >::update_vol_fe ( boost::shared_ptr< VolEle > &  vol_ele,
boost::shared_ptr< PreviousData > &  data 
)
private

Definition at line 224 of file unsatu2dFlow_prob.cpp.

225 {
227 auto det_ptr = boost::make_shared<VectorDouble>();
228 auto jac_ptr = boost::make_shared<MatrixDouble>();
229 auto inv_jac_ptr = boost::make_shared<MatrixDouble>();
230 vol_ele->getOpPtrVector().push_back(new OpCalculateHOJacForFace(jac_ptr));
231 vol_ele->getOpPtrVector()
232 push_back(new OpInvertMatrix<2>(jac_ptr, det_ptr, inv_jac_ptr));
233 vol_ele->getOpPtrVector().push_back(new OpSetInvJacH1ForFace(data->invJac));
235}

◆ update_vol_fe() [3/3]

template<int dim>
MoFEMErrorCode UFProblem< dim >::update_vol_fe ( boost::shared_ptr< VolEle > &  vol_ele,
boost::shared_ptr< PreviousData > &  data 
)
private

Definition at line 200 of file unsaturate_flow.cpp.

201 {
203 auto det_ptr = boost::make_shared<VectorDouble>();
204 auto jac_ptr = boost::make_shared<MatrixDouble>();
205 auto inv_jac_ptr = boost::make_shared<MatrixDouble>();
206 vol_ele->getOpPtrVector().push_back(new OpCalculateHOJacForFace(jac_ptr));
207 vol_ele->getOpPtrVector().push_back(
208 new OpInvertMatrix<2>(jac_ptr, det_ptr, inv_jac_ptr));
209 vol_ele->getOpPtrVector().push_back(new OpSetInvJacH1ForFace(inv_jac_ptr));
211}

Member Data Documentation

◆ boundary_ele_rhs

template<int dim>
boost::shared_ptr< FaceEle > UFProblem< dim >::boundary_ele_rhs
private

Definition at line 113 of file unsatu2dFlow_prob.cpp.

◆ cOmm

template<int dim>
MPI_Comm UFProblem< dim >::cOmm
private

Definition at line 103 of file unsatu2dFlow_prob.cpp.

◆ data

template<int dim>
std::vector< boost::shared_ptr< PreviousData > > UFProblem< dim >::data
private

Definition at line 121 of file unsatu2dFlow_prob.cpp.

◆ dm

template<int dim>
SmartPetscObj< DM > UFProblem< dim >::dm
private

Definition at line 93 of file unsatu2dFlow_prob.cpp.

◆ dots_ptr

template<int dim>
std::vector< boost::shared_ptr< VectorDouble > > UFProblem< dim >::dots_ptr
private

Definition at line 125 of file unsatu2dFlow_prob.cpp.

◆ global_error

template<int dim>
double UFProblem< dim >::global_error
private

Definition at line 101 of file unsatu2dFlow_prob.cpp.

◆ grads_ptr

template<int dim>
std::vector< boost::shared_ptr< MatrixDouble > > UFProblem< dim >::grads_ptr
private

Definition at line 123 of file unsatu2dFlow_prob.cpp.

◆ inner_surface

template<int dim>
std::vector< Range > UFProblem< dim >::inner_surface
private

Definition at line 99 of file unsatu2dFlow_prob.cpp.

◆ m_field

template<int dim>
MoFEM::Interface & UFProblem< dim >::m_field
private

Definition at line 88 of file unsatu2dFlow_prob.cpp.

◆ material_blocks

template<int dim>
std::map< int, BlockData > UFProblem< dim >::material_blocks
private

Definition at line 109 of file unsatu2dFlow_prob.cpp.

◆ moab

template<int dim>
moab::Interface & UFProblem< dim >::moab
private

Definition at line 91 of file unsatu2dFlow_prob.cpp.

◆ monitor_ptr

template<int dim>
boost::shared_ptr< Monitor > UFProblem< dim >::monitor_ptr
private

Definition at line 118 of file unsatu2dFlow_prob.cpp.

◆ natural_bdry_ents

template<int dim>
Range UFProblem< dim >::natural_bdry_ents
private

Definition at line 97 of file unsatu2dFlow_prob.cpp.

◆ nb_species

template<int dim>
int UFProblem< dim >::nb_species
private

Definition at line 107 of file unsatu2dFlow_prob.cpp.

◆ null

template<int dim>
boost::shared_ptr< ForcesAndSourcesCore > UFProblem< dim >::null
private

Definition at line 127 of file unsatu2dFlow_prob.cpp.

◆ order

template<int dim>
int UFProblem< dim >::order
private

Definition at line 106 of file unsatu2dFlow_prob.cpp.

◆ post_proc [1/2]

template<int dim>
boost::shared_ptr< PostProc > UFProblem< dim >::post_proc
private

Definition at line 117 of file unsatu2dFlow_prob.cpp.

◆ post_proc [2/2]

template<int dim>
boost::shared_ptr<PostProcVolumeOnRefinedMesh> UFProblem< dim >::post_proc
private

Definition at line 106 of file unsaturate_flow.cpp.

◆ rAnk

template<int dim>
const int UFProblem< dim >::rAnk
private

Definition at line 104 of file unsatu2dFlow_prob.cpp.

◆ simple_interface

template<int dim>
Simple * UFProblem< dim >::simple_interface
private

Definition at line 89 of file unsatu2dFlow_prob.cpp.

◆ ts

template<int dim>
SmartPetscObj< TS > UFProblem< dim >::ts
private

Definition at line 94 of file unsatu2dFlow_prob.cpp.

◆ values_ptr

template<int dim>
std::vector< boost::shared_ptr< VectorDouble > > UFProblem< dim >::values_ptr
private

Definition at line 124 of file unsatu2dFlow_prob.cpp.

◆ vol_ele_stiff_lhs

template<int dim>
boost::shared_ptr< VolEle > UFProblem< dim >::vol_ele_stiff_lhs
private

Definition at line 112 of file unsatu2dFlow_prob.cpp.

◆ vol_ele_stiff_rhs

template<int dim>
boost::shared_ptr< VolEle > UFProblem< dim >::vol_ele_stiff_rhs
private

Definition at line 111 of file unsatu2dFlow_prob.cpp.

◆ vol_mass_ele

template<int dim>
boost::shared_ptr< VolEle > UFProblem< dim >::vol_mass_ele
private

Definition at line 115 of file unsatu2dFlow_prob.cpp.


The documentation for this struct was generated from the following files: