static char help[] =
"teting interface inserting algorithm\n\n";
constexpr
bool debug =
false;
int main(
int argc,
char *argv[]) {
try {
PetscBool flg = PETSC_TRUE;
#if PETSC_VERSION_GE(3, 6, 4)
255, &flg);
#else
#endif
if (flg != PETSC_TRUE) {
"*** ERROR -my_file (MESH FILE NEEDED)");
}
const char *option;
option = "";
std::vector<BitRefLevel> bit_levels;
int ll = 1;
CHKERR PetscPrintf(PETSC_COMM_WORLD,
"Insert Interface %d\n",
cit->getMeshsetId());
{
CHKERR moab.create_meshset(MESHSET_SET, ref_level_meshset);
->getEntitiesByTypeAndRefLevel(bit_levels.back(),
ref_level_meshset);
->getEntitiesByTypeAndRefLevel(bit_levels.back(),
ref_level_meshset);
CHKERR moab.get_entities_by_handle(ref_level_meshset, ref_level_tets,
true);
CHKERR interface->
getSides(cubit_meshset, bit_levels.back(),
true, 0);
cubit_meshset, true, true, 0);
CHKERR moab.delete_entities(&ref_level_meshset, 1);
}
->updateMeshsetByEntitiesChildren(cubit_meshset, bit_levels.back(),
cubit_meshset, MBMAXTYPE, true);
}
}
"H1FIELD_SCALAR");
"H1FIELD_SCALAR");
"H1FIELD_SCALAR");
"H1FIELD_SCALAR");
"H1FIELD_SCALAR");
"H1FIELD_SCALAR");
true);
true);
for (int lll = ll - 2; lll < ll; lll++) {
std::stringstream problem_name;
problem_name << "PROBLEM_SCALAR_" << lll;
"ELEM_SCALAR");
"INTERFACE");
}
for (int lll = ll - 2; lll < ll; lll++) {
std::stringstream problem_name;
problem_name << "PROBLEM_SCALAR_" << lll;
std::stringstream message;
message << "set problem problem < " << problem_name.str()
<< " > bit level " << bit_levels[lll] << std::endl;
CHKERR PetscPrintf(PETSC_COMM_WORLD, message.str().c_str());
bit_levels[lll]);
}
Range tets_back_bit_level;
bit_levels.back(),
BitRefLevel().set(), tets_back_bit_level);
CHKERR cit->getAttributeDataStructure(mydata);
std::cout << mydata << std::endl;
CHKERR moab.get_entities_by_type(cubit_meshset, MBTET, tets,
true);
tets = intersect(tets_back_bit_level, tets);
CHKERR moab.get_connectivity(tets, nodes,
true);
for (Range::iterator nit = nodes.begin(); nit != nodes.end(); nit++) {
double coords[3];
CHKERR moab.get_coords(&*nit, 1, coords);
coords[0] += mydata.
data.User1;
coords[1] += mydata.
data.User2;
coords[2] += mydata.
data.User3;
CHKERR moab.set_coords(&*nit, 1, coords);
}
}
for (int lll = ll - 2; lll < ll; lll++) {
std::stringstream problem_name;
problem_name << "PROBLEM_SCALAR_" << lll;
}
std::ofstream myfile;
CHKERR moab.create_meshset(MESHSET_SET, out_meshset_tet);
bit_levels.back(),
BitRefLevel().set(), MBTET, out_meshset_tet);
CHKERR moab.get_entities_by_handle(out_meshset_tet, tets,
true);
for (Range::iterator tit = tets.begin(); tit != tets.end(); tit++) {
int num_nodes;
CHKERR moab.get_connectivity(*tit, conn, num_nodes,
true);
for (int nn = 0; nn < num_nodes; nn++) {
std::cout << conn[nn] << " ";
myfile << conn[nn] << " ";
}
std::cout << std::endl;
myfile << std::endl;
}
CHKERR moab.create_meshset(MESHSET_SET, out_meshset_prism);
bit_levels.back(),
BitRefLevel().set(), MBPRISM, out_meshset_prism);
CHKERR moab.get_entities_by_handle(out_meshset_prism, prisms);
for (Range::iterator pit = prisms.begin(); pit != prisms.end(); pit++) {
int num_nodes;
CHKERR moab.get_connectivity(*pit, conn, num_nodes,
true);
for (int nn = 0; nn < num_nodes; nn++) {
std::cout << conn[nn] << " ";
myfile << conn[nn] << " ";
}
std::cout << std::endl;
myfile << std::endl;
}
myfile.close();
CHKERR moab.write_file(
"out_tet.vtk",
"VTK",
"", &out_meshset_tet, 1);
CHKERR moab.write_file(
"out_prism.vtk",
"VTK",
"", &out_meshset_prism, 1);
CHKERR moab.create_meshset(MESHSET_SET, out_meshset_tets_and_prism);
CHKERR moab.add_entities(out_meshset_tets_and_prism, tets);
CHKERR moab.add_entities(out_meshset_tets_and_prism, prisms);
CHKERR moab.write_file(
"out_tets_and_prisms.vtk",
"VTK",
"",
&out_meshset_tets_and_prism, 1);
CHKERR moab.create_meshset(MESHSET_SET, out_meshset_tris);
CHKERR moab.get_adjacencies(prisms, 2,
false, tris,
moab::Interface::UNION);
std::cerr << tris.size() << " : " << prisms.size() << std::endl;
CHKERR moab.add_entities(out_meshset_tris, tris);
CHKERR moab.write_file(
"out_tris.vtk",
"VTK",
"", &out_meshset_tris, 1);
}
}
}