12static char help[] =
"...\n\n";
14int main(
int argc,
char *argv[]) {
18 auto core_log = logging::core::get();
25 moab::Core mb_instance;
26 moab::Interface &moab = mb_instance;
28 MPI_Comm_rank(PETSC_COMM_WORLD, &rank);
42 MOFEM_LOG(
"ATOM_TEST", Sev::verbose) <<
"<<<< SIDESETs >>>>>";
44 bool add_block_is_there =
false;
48 strncpy(mybc.
data.name,
"Pressure", 8);
55 if (it->getMeshsetId() != 1002)
57 add_block_is_there =
true;
59 CHKERR it->getBcDataStructure(mydata);
61 MOFEM_LOG(
"ATOM_TEST", Sev::inform) << mydata;
63 if (!add_block_is_there)
65 "no added block set");
67 MOFEM_LOG(
"ATOM_TEST", Sev::inform) <<
"<<<< BLOCKSETs >>>>>";
69 add_block_is_there =
false;
71 std::vector<double> attr(3);
78 std::string name = it->getName();
79 if (name.compare(0, 13,
"ADD_BLOCK_SET") == 0) {
80 add_block_is_there =
true;
81 std::vector<double> attributes;
82 it->getAttributes(attributes);
83 if (attributes.size() != 3) {
85 "should be 3 attributes but is %d", attributes.size());
87 if (attributes[0] != 0 || attributes[1] != 1 || attributes[2] != 2) {
89 "wrong values of attributes");
93 if (!add_block_is_there) {
95 "no added block set");
97 add_block_is_there =
false;
101 mydata.
data.Young = 1;
102 mydata.
data.Poisson = 0.25;
107 if (it->getMeshsetId() != 1001)
110 std::string name = it->getName();
111 if (name.compare(0, 13,
"MAT_ELASTIC") == 0 &&
113 add_block_is_there =
true;
115 CHKERR it->getAttributeDataStructure(mydata);
117 MOFEM_LOG(
"ATOM_TEST", Sev::inform) << mydata;
118 if (mydata.
data.Young != 1 || mydata.
data.Poisson != 0.25) {
120 "wrong values of attributes");
124 if (!add_block_is_there) {
126 "no added block set");
129 MOFEM_LOG(
"ATOM_TEST", Sev::inform) <<
"<<<< NODESET >>>>>";
133 std::memcpy(disp_bc.
data.name,
"Displacement", 12);
134 disp_bc.
data.flag1 = 1;
135 disp_bc.
data.flag2 = 1;
136 disp_bc.
data.flag3 = 1;
137 disp_bc.
data.flag4 = 0;
138 disp_bc.
data.flag5 = 0;
139 disp_bc.
data.flag6 = 0;
140 disp_bc.
data.value1 = 0;
141 disp_bc.
data.value2 = 0;
142 disp_bc.
data.value3 = 0;
143 disp_bc.
data.value4 = 0;
144 disp_bc.
data.value5 = 0;
145 disp_bc.
data.value6 = 0;
152 CHKERR it->getBcDataStructure(disp_data);
153 MOFEM_LOG(
"ATOM_TEST", Sev::inform) << disp_data;
157 <<
"<<<< ADD BLOCKSETs FROM CONFIG FILE >>>>>";
173 MOFEM_LOG(
"ATOM_TEST", Sev::inform) <<
"Iterate blocksets";
175 bool mat_elastic_trans_is_found =
true;
177 MOFEM_LOG(
"ATOM_TEST", Sev::inform) << *it;
179 std::vector<double> attributes;
180 it->getAttributes(attributes);
181 std::ostringstream ss;
183 for (
unsigned int ii = 0; ii != attributes.size(); ii++) {
184 ss << attributes[ii] <<
" ";
186 MOFEM_LOG(
"ATOM_TEST", Sev::inform) << ss.str();
188 std::string block_name = it->getName();
189 if (block_name.compare(0, block_name.size(),
"MAT_ELASTIC_TRANS_ISO") ==
191 MOFEM_LOG(
"ATOM_TEST", Sev::inform) <<
"Mat Trans Iso block ";
192 mat_elastic_trans_is_found =
true;
194 CHKERR it->getAttributeDataStructure(mydata);
196 MOFEM_LOG(
"ATOM_TEST", Sev::inform) << mydata;
197 if (mydata.
data.Youngp != 1)
199 if (mydata.
data.Youngz != 2)
201 if (mydata.
data.Poissonp != 3)
203 if (mydata.
data.Poissonpz != 4)
205 if (mydata.
data.Shearzp != 5)
209 if(!mat_elastic_trans_is_found)
214 CHKERR it->getAttributeDataStructure(mydata);
215 MOFEM_LOG(
"ATOM_TEST", Sev::inform) <<
"Mat elastic found ";
216 MOFEM_LOG(
"ATOM_TEST", Sev::inform) << mydata;
220 CHKERR it->getAttributeDataStructure(mydata);
221 MOFEM_LOG(
"ATOM_TEST", Sev::inform) <<
"Mat thermal found ";
222 MOFEM_LOG(
"ATOM_TEST", Sev::inform) << mydata;
226 CHKERR it->getBcDataStructure(mydata);
227 MOFEM_LOG(
"ATOM_TEST", Sev::inform) << mydata;
231 CHKERR it->getBcDataStructure(mydata);
232 MOFEM_LOG(
"ATOM_TEST", Sev::inform) << mydata;
236 CHKERR it->getBcDataStructure(mydata);
237 MOFEM_LOG(
"ATOM_TEST", Sev::inform) << mydata;
241 CHKERR it->getBcDataStructure(mydata);
242 MOFEM_LOG(
"ATOM_TEST", Sev::inform) << mydata;
246 CHKERR it->getBcDataStructure(mydata);
247 MOFEM_LOG(
"ATOM_TEST", Sev::inform) << mydata;
#define CATCH_ERRORS
Catch errors.
@ MAT_ELASTICSET
block name is "MAT_ELASTIC"
@ MAT_THERMALSET
block name is "MAT_THERMAL"
@ MOFEM_OPERATION_UNSUCCESSFUL
@ MOFEM_ATOM_TEST_INVALID
#define CHKERR
Inline error check.
static LoggerType & setLog(const std::string channel)
Set ans resset chanel logger.
#define MOFEM_LOG(channel, severity)
Log.
#define MOFEM_LOG_TAG(channel, tag)
Tag channel.
#define MOFEM_LOG_CHANNEL(channel)
Set and reset channel.
#define MOFEM_LOG_ATTRIBUTES(channel, bit)
Add attributes to channel.
#define _IT_CUBITMESHSETS_BY_BCDATA_TYPE_FOR_LOOP_(MESHSET_MANAGER, CUBITBCTYPE, IT)
Iterator that loops over a specific Cubit MeshSet in a moFEM field.
MoFEMErrorCode addMeshset(const CubitBCType cubit_bc_type, const int ms_id, const std::string name="")
add cubit meshset
#define _IT_CUBITMESHSETS_FOR_LOOP_(MESHSET_MANAGER, IT)
Iterator that loops over all the Cubit MeshSets 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.
std::bitset< 32 > CubitBCType
implementation of Data Operators for Forces and Sources
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.
Definition of the displacement bc data structure.
Definition of the force bc data structure.
Definition of the heat flux bc data structure.
static boost::shared_ptr< SinkType > createSink(boost::shared_ptr< std::ostream > stream_ptr, std::string comm_filter)
Create a sink object.
static boost::shared_ptr< std::ostream > getStrmSelf()
Get the strm self object.
Transverse Isotropic material data structure.
Elastic material data structure.
Thermal material data structure.
Interface for managing meshsets containing materials and boundary conditions.
MoFEMErrorCode setBcData(const CubitBCType cubit_bc_type, const int ms_id, const GenericCubitBcData &data)
set boundary data structure to meshset
MoFEMErrorCode setAtributes(const CubitBCType cubit_bc_type, const int ms_id, const std::vector< double > &attributes, const std::string name="")
set attributes to cubit meshset
MoFEMErrorCode setMeshsetFromFile(const string file_name, const bool clean_file_options=true)
add blocksets reading config file
MoFEMErrorCode setAtributesByDataStructure(const CubitBCType cubit_bc_type, const int ms_id, const GenericAttributeData &data, const std::string name="")
set (material) data structure to cubit meshset
Definition of the pressure bc data structure.
Definition of the temperature bc data structure.
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface refernce to pointer of interface.