8static char help[] =
"...\n\n";
21 post_proc = boost::shared_ptr<PostProcVolumeOnRefinedMesh>(
34 boost::shared_ptr<VectorDouble>(
data[
i], &
data[
i]->values);
36 boost::shared_ptr<VectorDouble>(
data[
i], &
data[
i]->dot_values);
54 boost::shared_ptr<PreviousData> &
data);
57 boost::shared_ptr<MatrixDouble> &
grads_ptr,
58 boost::shared_ptr<VectorDouble> &
dots_ptr);
61 boost::shared_ptr<PreviousData> &
data,
62 std::map<int, BlockData> &block_map);
66 boost::shared_ptr<MatrixDouble> &
grads_ptr);
68 boost::shared_ptr<PreviousData> &
data,
69 std::map<int, BlockData> &block_map);
81 moab::Interface &
moab;
106 boost::shared_ptr<PostProcVolumeOnRefinedMesh>
post_proc;
109 std::vector<boost::shared_ptr<PreviousData>>
data;
111 std::vector<boost::shared_ptr<MatrixDouble>>
grads_ptr;
112 std::vector<boost::shared_ptr<VectorDouble>>
values_ptr;
113 std::vector<boost::shared_ptr<VectorDouble>>
dots_ptr;
115 boost::shared_ptr<ForcesAndSourcesCore>
null;
140 string name = it->getName();
141 const int id = it->getMeshsetId();
142 if (name.compare(0, 14,
"REGION1") == 0) {
144 id,
BLOCKSET, 3, block_map[
id].block_ents,
true);
155 }
else if (name.compare(0, 14,
"REGION2") == 0) {
157 id,
BLOCKSET, 3, block_map[
id].block_ents,
true);
160 }
else if (name.compare(0, 14,
"REGION3") == 0) {
162 id,
BLOCKSET, 3, block_map[
id].block_ents,
true);
165 }
else if (name.compare(0, 14,
"REGION4") == 0) {
167 id,
BLOCKSET, 3, block_map[
id].block_ents,
true);
170 }
else if (name.compare(0, 14,
"REGION5") == 0) {
172 id,
BLOCKSET, 3, block_map[
id].block_ents,
true);
194 init_val, MBVERTEX, surface_verts,
field_name);
201 boost::shared_ptr<PreviousData> &data) {
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>();
207 vol_ele->getOpPtrVector().push_back(
215 boost::shared_ptr<VectorDouble> &values_ptr,
216 boost::shared_ptr<MatrixDouble> &grads_ptr,
217 boost::shared_ptr<VectorDouble> &dots_ptr) {
229 boost::shared_ptr<PreviousData> &data,
230 std::map<int, BlockData> &block_map) {
242 boost::shared_ptr<VectorDouble> &values_ptr,
243 boost::shared_ptr<MatrixDouble> &grads_ptr) {
254 boost::shared_ptr<PreviousData> &data,
255 std::map<int, BlockData> &block_map) {
266 auto vol_rule = [](int, int,
int p) ->
int {
return 2 *
p; };
278 CHKERR TSARKIMEXSetType(
ts, TSARKIMEXA2);
314 CHKERR TSSetDuration(
ts, PETSC_DEFAULT, ftime);
324 std::vector<std::string> mass_names(
nb_species);
327 mass_names[
i] =
"h" + boost::lexical_cast<std::string>(
i + 1);
337 string name = it->getName();
338 if (name.compare(0, 14,
"ESSENTIAL") == 0) {
346 moab::Interface::UNION);
348 Range face_edges_verts;
349 CHKERR moab.get_connectivity(face_edges, face_edges_verts,
false);
353 bdry_ents = unite(bdry_ents, face_edges_verts);
356 cout <<
"size: " << endl;
357 cout << bdry_ents.size() << endl;
358 cout << bdry_ents << endl;
361 "SimpleProblem", mass_names[0], bdry_ents);
366 initVals.resize(3,
false);
383 0.0, MBVERTEX, surface_verts, mass_names[0]);
413 post_proc->generateReferenceElementMesh();
428int main(
int argc,
char *argv[]) {
432 moab::Core mb_instance;
433 moab::Interface &moab = mb_instance;
435 DMType dm_name =
"DMMOFEM";
441 UFProblem unsatu_flow_problem(mb_instance, core,
order, nb_species);
MoFEM::FaceElementForcesAndSourcesCore FaceEle
#define CATCH_ERRORS
Catch errors.
@ AINSWORTH_LEGENDRE_BASE
Ainsworth Cole (Legendre) approx. base .
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
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
PetscErrorCode DMoFEMMeshToLocalVector(DM dm, Vec l, InsertMode mode, ScatterMode scatter_mode)
set local (or ghosted) vector values on mesh for partition only
PetscErrorCode DMRegister_MoFEM(const char sname[])
Register MoFEM problem.
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
PetscErrorCode DMCreateGlobalVector_MoFEM(DM dm, Vec *g)
DMShellSetCreateGlobalVector.
bool checkMeshset(const int ms_id, const CubitBCType cubit_bc_type) const
check for CUBIT Id and CUBIT type
#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.
FTensor::Index< 'i', SPACE_DIM > i
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
implementation of Data Operators for Forces and Sources
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.
PetscErrorCode PetscOptionsGetInt(PetscOptions *, const char pre[], const char name[], PetscInt *ivalue, PetscBool *set)
OpCalculateHOJacForFaceImpl< 2 > OpCalculateHOJacForFace
OpCalculateScalarFieldValuesDot OpCalculateScalarValuesDot
auto createTS(MPI_Comm comm)
constexpr auto field_name
virtual moab::Interface & get_moab()=0
virtual MPI_Comm & get_comm() 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.
Interface for managing meshsets containing materials and boundary conditions.
Get field gradients at integration pts for scalar filed rank 0, i.e. vector field.
Get value at integration points for scalar field.
Problem manager is used to build and partition problems.
Simple interface for fast problem set-up.
const std::string getBoundaryFEName() const
Get the Boundary FE Name.
MoFEMErrorCode loadFile(const std::string options, const std::string mesh_file_name, LoadFileFunc loadFunc=defaultLoadFileFunc)
Load mesh file.
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.
MoFEMErrorCode getOptions()
get options
MoFEMErrorCode getDM(DM *dm)
Get DM.
MoFEMErrorCode setFieldOrder(const std::string field_name, const int order, const Range *ents=NULL)
Set field order.
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.
MoFEMErrorCode setUp(const PetscBool is_partitioned=PETSC_TRUE)
Setup problem.
const std::string getDomainFEName() const
Get the Domain FE Name.
intrusive_ptr for managing petsc objects
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface refernce to pointer of interface.
MoFEMErrorCode push_stiff_lhs(std::string field_name, boost::shared_ptr< PreviousData > &data, std::map< int, BlockData > &block_map)
boost::shared_ptr< VolEle > vol_ele_stiff_rhs
boost::shared_ptr< VolEle > vol_mass_ele
MoFEMErrorCode update_stiff_lhs(std::string field_name, boost::shared_ptr< VectorDouble > &values_ptr, boost::shared_ptr< MatrixDouble > &grads_ptr)
boost::shared_ptr< PostProcVolumeOnRefinedMesh > post_proc
MoFEM::Interface & m_field
Simple * simple_interface
std::vector< boost::shared_ptr< MatrixDouble > > grads_ptr
std::vector< boost::shared_ptr< PreviousData > > data
std::map< int, BlockData > material_blocks
MoFEMErrorCode set_initial_values(std::string field_name, int block_id, Range &surface, double &init_val)
MoFEMErrorCode run_analysis()
boost::shared_ptr< Monitor > monitor_ptr
MoFEMErrorCode update_vol_fe(boost::shared_ptr< VolEle > &vol_ele, boost::shared_ptr< PreviousData > &data)
MoFEMErrorCode push_mass_ele(std::string field_name)
MoFEMErrorCode set_fe_in_loop()
std::vector< Range > inner_surface
boost::shared_ptr< VolEle > vol_ele_stiff_lhs
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)
boost::shared_ptr< ForcesAndSourcesCore > null
std::vector< boost::shared_ptr< VectorDouble > > values_ptr
MoFEMErrorCode add_fe(std::string field_name)
boost::shared_ptr< PostProc > post_proc
std::vector< boost::shared_ptr< VectorDouble > > dots_ptr
UFProblem(moab::Core &mb_instance, MoFEM::Core &core, const int order, const int n_species)
boost::shared_ptr< FaceEle > boundary_ele_rhs
VolumeElementForcesAndSourcesCore VolEle