34 #if defined(LIBMESH_HAVE_NEMESIS_API) && defined(LIBMESH_HAVE_EXODUS_API) 46 bool verbose_in,
bool single_precision) :
51 num_elem_blks_global(0),
52 num_node_sets_global(0),
53 num_side_sets_global(0),
57 num_internal_nodes(0),
59 num_external_nodes(0),
60 num_internal_elems(0),
66 libmesh_experimental();
78 EX_EXCEPTIONLESS_CHECK_ERR(
ex_err,
"Error flushing buffers to file.");
88 Nemesis::ne_get_init_global(
ex_id,
120 Nemesis::ne_get_ss_param_global(
ex_id,
128 libMesh::out <<
"[" << this->
processor_id() <<
"] " <<
"Global Sideset IDs, Side Counts, and DF counts:" << std::endl;
153 Nemesis::ne_get_ns_param_global(
ex_id,
161 libMesh::out <<
"[" << this->
processor_id() <<
"] " <<
"Global Nodeset IDs, Node Counts, and DF counts:" << std::endl;
184 Nemesis::ne_get_eb_info_global(
ex_id,
208 Nemesis::ne_get_init_info(
ex_id,
227 Nemesis::ne_get_loadbal_param(
ex_id,
260 Nemesis::ne_get_elem_map(
ex_id,
292 Nemesis::ne_get_node_map(
ex_id,
330 Nemesis::ne_get_cmap_params(
ex_id,
380 Nemesis::ne_get_node_cmap(
ex_id,
385 EX_CHECK_ERR(
nemesis_err_flag,
"Error reading node cmap node and processor ids!");
422 Nemesis::ne_get_elem_cmap(
ex_id,
428 EX_CHECK_ERR(
nemesis_err_flag,
"Error reading elem cmap elem, side, and processor ids!");
459 unsigned num_proc_in_file_in,
460 const char * ftype_in)
463 Nemesis::ne_put_init_info(
ex_id,
466 const_cast<char *>(ftype_in));
476 unsigned num_elem_blks_global_in,
477 unsigned num_node_sets_global_in,
478 unsigned num_side_sets_global_in)
481 Nemesis::ne_put_init_global(
ex_id,
484 num_elem_blks_global_in,
485 num_node_sets_global_in,
486 num_side_sets_global_in);
494 std::vector<int> & global_elem_blk_cnts_in)
497 Nemesis::ne_put_eb_info_global(
ex_id,
498 global_elem_blk_ids_in.data(),
499 global_elem_blk_cnts_in.data());
501 EX_CHECK_ERR(
nemesis_err_flag,
"Error writing global element block information!");
508 std::vector<int> & num_global_node_counts_in,
509 std::vector<int> & num_global_node_df_counts_in)
515 Nemesis::ne_put_ns_param_global(
ex_id,
516 global_nodeset_ids_in.data(),
517 num_global_node_counts_in.data(),
518 num_global_node_df_counts_in.data());
528 std::vector<int> & num_global_side_counts_in,
529 std::vector<int> & num_global_side_df_counts_in)
535 Nemesis::ne_put_ss_param_global(
ex_id,
536 global_sideset_ids_in.data(),
537 num_global_side_counts_in.data(),
538 num_global_side_df_counts_in.data());
548 unsigned num_border_nodes_in,
549 unsigned num_external_nodes_in,
550 unsigned num_internal_elems_in,
551 unsigned num_border_elems_in,
552 unsigned num_node_cmaps_in,
553 unsigned num_elem_cmaps_in)
556 Nemesis::ne_put_loadbal_param(
ex_id,
557 num_internal_nodes_in,
559 num_external_nodes_in,
560 num_internal_elems_in,
574 std::vector<int> & node_cmap_node_cnts_in,
575 std::vector<int> & elem_cmap_ids_in,
576 std::vector<int> & elem_cmap_elem_cnts_in)
578 libmesh_assert(!node_cmap_ids_in.empty());
579 libmesh_assert(!node_cmap_node_cnts_in.empty());
580 libmesh_assert(!elem_cmap_ids_in.empty());
581 libmesh_assert(!elem_cmap_elem_cnts_in.empty());
584 Nemesis::ne_put_cmap_params(
ex_id,
585 node_cmap_ids_in.data(),
586 node_cmap_node_cnts_in.data(),
587 elem_cmap_ids_in.data(),
588 elem_cmap_elem_cnts_in.data(),
598 std::vector<std::vector<int>> & node_cmap_proc_ids_in)
604 for (std::size_t i=0; i<node_cmap_node_ids_in.size(); ++i)
609 for (std::size_t j=0; j<node_cmap_node_ids_in[i].size(); ++j)
614 for (std::size_t i=0; i<node_cmap_node_ids_in.size(); ++i)
617 for (std::size_t j=0; j<node_cmap_proc_ids_in[i].size(); ++j)
623 for (std::size_t i=0; i<node_cmap_node_ids_in.size(); ++i)
625 int * node_ids_ptr = node_cmap_node_ids_in[i].empty() ?
626 nullptr : node_cmap_node_ids_in[i].data();
627 int * proc_ids_ptr = node_cmap_proc_ids_in[i].empty() ?
628 nullptr : node_cmap_proc_ids_in[i].data();
632 node_ids_ptr, proc_ids_ptr,
635 EX_CHECK_ERR(
nemesis_err_flag,
"Error writing node communication map to file!");
643 std::vector<int> & node_mapb_in,
644 std::vector<int> & node_mape_in)
647 Nemesis::ne_put_node_map(
ex_id,
648 node_mapi_in.empty() ? nullptr : node_mapi_in.data(),
649 node_mapb_in.empty() ? nullptr : node_mapb_in.data(),
650 node_mape_in.empty() ? nullptr : node_mape_in.data(),
653 EX_CHECK_ERR(
nemesis_err_flag,
"Error writing Nemesis internal and border node maps to file!");
660 std::vector<std::vector<int>> & elem_cmap_side_ids_in,
661 std::vector<std::vector<int>> & elem_cmap_proc_ids_in)
666 Nemesis::ne_put_elem_cmap(
ex_id,
668 elem_cmap_elem_ids_in[i].
data(),
669 elem_cmap_side_ids_in[i].
data(),
670 elem_cmap_proc_ids_in[i].
data(),
673 EX_CHECK_ERR(
nemesis_err_flag,
"Error writing elem communication map to file!");
681 std::vector<int> & elem_mapb_in)
684 Nemesis::ne_put_elem_map(
ex_id,
685 elem_mapi_in.empty() ? nullptr : elem_mapi_in.data(),
686 elem_mapb_in.empty() ? nullptr : elem_mapb_in.data(),
689 EX_CHECK_ERR(
nemesis_err_flag,
"Error writing Nemesis internal and border element maps to file!");
698 unsigned num_nodes_in,
699 std::vector<Real> & x_coor,
700 std::vector<Real> & y_coor,
701 std::vector<Real> & z_coor)
706 Nemesis::ne_put_n_coord(
ex_id,
709 x_coor.empty() ? nullptr : x_coor.data(),
710 y_coor.empty() ? nullptr : y_coor.data(),
711 z_coor.empty() ? nullptr : z_coor.data());
737 comp_ws =
sizeof(float);
738 io_ws =
sizeof(float);
742 comp_ws = cast_int<int>(
std::min(
sizeof(
Real),
sizeof(
double)));
743 io_ws = cast_int<int>(
std::min(
sizeof(
Real),
sizeof(
double)));
746 this->
ex_id = exII::ex_create(filename.c_str(), EX_CLOBBER, &comp_ws, &io_ws);
748 EX_CHECK_ERR(
ex_id,
"Error creating Nemesis mesh file.");
751 libMesh::out <<
"File created successfully." << std::endl;
931 const std::string & title_in)
960 EX_CHECK_ERR(
ex_err,
"Error initializing new Nemesis file.");
983 libmesh_error_msg(
"Elem number " <<
id <<
" not found in libmesh_elem_num_to_exodus map.");
984 this->
elem_mapi[cnt++] = elem_it->second;
994 libmesh_error_msg(
"Elem number " <<
id <<
" not found in libmesh_elem_num_to_exodus map.");
995 this->
elem_mapb[cnt++] = elem_it->second;
1019 for (; it !=
end; ++it)
1022 libmesh_assert_equal_to (static_cast<unsigned>(this->
elem_cmap_ids[cnt]), it->first);
1025 std::set<std::pair<unsigned,unsigned>> & elem_set = it->second;
1032 std::set<std::pair<unsigned,unsigned>>::iterator elem_set_iter = elem_set.begin();
1040 libmesh_error_msg(
"Elem number " << (*elem_set_iter).first <<
" not found in libmesh_elem_num_to_exodus map.");
1075 libmesh_error_msg(
"Node number " <<
id <<
" not found in libmesh_node_num_to_exodus map.");
1076 this->
node_mapi[cnt++] = node_it->second;
1086 libmesh_error_msg(
"Node number " <<
id <<
" not found in libmesh_node_num_to_exodus map.");
1087 this->
node_mapb[cnt++] = node_it->second;
1102 libmesh_assert_less_equal
1115 for (; it !=
end; ++it)
1118 libmesh_assert_equal_to (static_cast<unsigned>(this->
node_cmap_ids[cnt]), it->first);
1121 std::set<unsigned> &
node_set = it->second;
1127 std::set<unsigned>::iterator node_set_iter =
node_set.begin();
1134 libmesh_error_msg(
"Node number " << *node_set_iter <<
" not found in libmesh_node_num_to_exodus map.");
1187 for (; it !=
end; ++it)
1222 for (; it !=
end; ++it)
1254 std::set<unsigned> all_elem_ids;
1259 std::set<unsigned> neighboring_processor_ids;
1270 all_elem_ids.insert(elem->id());
1273 bool is_border_elem =
false;
1289 for (
auto node : elem->node_index_range())
1293 for (
auto n : elem->side_index_range())
1295 if (elem->neighbor_ptr(n) !=
nullptr)
1297 unsigned neighbor_proc_id = elem->neighbor_ptr(n)->processor_id();
1303 is_border_elem =
true;
1304 neighboring_processor_ids.insert(neighbor_proc_id);
1312 <<
" mapped to (1-based) Exodus side " 1319 this->
proc_border_elem_sets[ neighbor_proc_id ].insert( std::make_pair(elem->id(), nemesis_side_id) );
1332 std::set_difference(all_elem_ids.begin(), all_elem_ids.end(),
1344 for (
const auto &
id : neighboring_processor_ids)
1351 cast_int<int>(neighboring_processor_ids.size());
1355 <<
"Number of neighboring processor IDs=" 1366 << pr.first <<
" communicates " 1367 << pr.second.size() <<
" elements." << std::endl;
1394 std::set<boundary_id_type> global_side_boundary_ids
1403 cast_int<int>(global_side_boundary_ids.size());
1408 global_side_boundary_ids.begin(),
1409 global_side_boundary_ids.end());
1421 typedef std::tuple<dof_id_type, unsigned short int, boundary_id_type> Tuple;
1425 std::vector<Tuple>::iterator
1426 it = bc_triples.begin(),
1427 new_end = bc_triples.end();
1429 while (it != new_end)
1444 bc_triples.erase(new_end, bc_triples.end());
1454 cast_int<int>(std::count_if(bc_triples.begin(),
1456 [id](
const Tuple & t)->
bool {
return std::get<2>(t) ==
id; }));
1486 std::set<boundary_id_type> local_node_boundary_ids;
1489 std::set<boundary_id_type> global_node_boundary_ids
1494 local_node_boundary_ids = global_node_boundary_ids;
1501 cast_int<int>(global_node_boundary_ids.size());
1506 global_node_boundary_ids.begin(),
1507 global_node_boundary_ids.end());
1517 for (
const auto &
id : local_node_boundary_ids)
1525 typedef std::tuple<dof_id_type, boundary_id_type> Tuple;
1531 << bc_tuples.size() << std::endl;
1533 for (
const auto & t : bc_tuples)
1534 libMesh::out <<
"(" << std::get<0>(t) <<
", " << std::get<1>(t) <<
") ";
1549 std::vector<Tuple>::iterator
1550 it = bc_tuples.begin(),
1551 new_end = bc_tuples.end();
1553 while (it != new_end)
1568 bc_tuples.erase(new_end, bc_tuples.end());
1575 cast_int<int>(std::count_if(bc_tuples.begin(),
1577 [id](
const Tuple & t)->
bool {
return std::get<1>(t) ==
id; }));
1598 std::set<subdomain_id_type> global_subdomain_ids;
1601 std::map<subdomain_id_type, unsigned> global_subdomain_counts;
1614 global_subdomain_ids.insert(cur_subdomain);
1617 global_subdomain_counts[cur_subdomain]++;
1625 std::vector<subdomain_id_type> global_subdomain_ids_vector(global_subdomain_ids.begin(),
1626 global_subdomain_ids.end());
1632 global_subdomain_ids.insert(global_subdomain_ids_vector.begin(),
1633 global_subdomain_ids_vector.end());
1638 cast_int<int>(global_subdomain_ids.size());
1644 for (
const auto & pr : global_subdomain_counts)
1647 <<
static_cast<unsigned>(pr.first)
1648 <<
", Count: " << pr.second <<
", ";
1660 for (
const auto &
id : global_subdomain_ids)
1677 global_subdomain_ids.begin(),
1678 global_subdomain_ids.end());
1721 <<
"local_subdomain_counts [" <<
static_cast<unsigned>(pr.first) <<
"]= " 1735 for (
auto n : elem->node_index_range())
1785 std::vector<dof_id_type> & elem_ids_this_subdomain = pr.second;
1788 if (elem_ids_this_subdomain.size() == 0)
1789 libmesh_error_msg(
"Error, no element IDs found in subdomain " << pr.first);
1806 current_block_connectivity.clear();
1807 current_block_connectivity.resize(elem_ids_this_subdomain.size() * this->
num_nodes_per_elem);
1809 for (
auto i :
index_range(elem_ids_this_subdomain))
1811 auto elem_id = elem_ids_this_subdomain[i];
1830 const unsigned int elem_node_index = conv.
get_node_map(j);
1834 libmesh_error_msg(
"Node number " << elem.node_id(elem_node_index) <<
" not found in libmesh_node_num_to_exodus map.");
1836 current_block_connectivity[connect_index] = node_it->second;
1855 std::map<unsigned, std::set<unsigned>> proc_nodes_touched;
1867 std::set<unsigned> & set_p = proc_nodes_touched[ elem->processor_id() ];
1870 for (
auto node : elem->node_index_range())
1871 set_p.insert(elem->node_id(node));
1878 cast_int<int>(proc_nodes_touched.size() -
1888 <<
"] proc_nodes_touched contains " 1889 << proc_nodes_touched.size()
1890 <<
" sets of nodes." 1893 for (
const auto & pr : proc_nodes_touched)
1895 <<
"] proc_nodes_touched[" << pr.first <<
"] has " 1904 for (
auto & pr : proc_nodes_touched)
1907 if (pr.first == this->processor_id())
1911 std::set<unsigned> & my_set = proc_nodes_touched[this->
processor_id()];
1912 std::set<unsigned> & other_set = pr.second;
1915 std::set_intersection(my_set.begin(), my_set.end(),
1916 other_set.begin(), other_set.end(),
1917 std::inserter(result_set, result_set.end()));
1924 <<
"] this->proc_nodes_touched_intersections[" << pr.first <<
"] has " 1934 std::set<unsigned> & other_set = pr.second;
1935 std::set<unsigned> intermediate_result;
1938 other_set.begin(), other_set.end(),
1939 std::inserter(intermediate_result, intermediate_result.end()));
1945 libmesh_assert_less_equal
1946 (this->proc_nodes_touched_intersections.size(),
1973 std::map<boundary_id_type, std::vector<int>> local_node_boundary_id_lists;
1980 typedef std::tuple<dof_id_type, boundary_id_type> Tuple;
1981 std::vector<Tuple> bc_tuples =
mesh.get_boundary_info().build_node_list();
1986 << bc_tuples.size() << std::endl;
1988 for (
const auto & t : bc_tuples)
1989 libMesh::out <<
"(" << std::get<0>(t) <<
", " << std::get<1>(t) <<
") ";
1996 for (
const auto & t : bc_tuples)
2006 std::vector<int> & current_id_set = local_node_boundary_id_lists[std::get<1>(t)];
2010 current_id_set.push_back( it->second );
2017 for (
const auto & pr : local_node_boundary_id_lists)
2022 for (
const auto &
id : pr.second)
2036 const std::string & current_ns_name =
2037 mesh.get_boundary_info().get_nodeset_name
2042 names_table.push_back_entry(current_ns_name);
2048 <<
", Name: " << current_ns_name
2064 local_node_boundary_id_lists.find (cast_int<boundary_id_type>(this->
global_nodeset_ids[i]));
2067 if (it == local_node_boundary_id_lists.end())
2072 <<
" on this processor." << std::endl;
2079 EX_CHECK_ERR(this->
ex_err,
"Error writing nodeset parameters in Nemesis");
2085 std::vector<int> & current_nodeset_ids = it->second;
2090 current_nodeset_ids.size(),
2093 EX_CHECK_ERR(this->
ex_err,
"Error writing nodeset parameters in Nemesis");
2098 current_nodeset_ids.data());
2100 EX_CHECK_ERR(this->
ex_err,
"Error writing nodesets in Nemesis");
2108 names_table.get_char_star_star());
2109 EX_CHECK_ERR(
ex_err,
"Error writing nodeset names");
2126 std::map<boundary_id_type, std::vector<int>> local_elem_boundary_id_lists;
2127 std::map<boundary_id_type, std::vector<int>> local_elem_boundary_id_side_lists;
2132 std::vector<std::tuple<dof_id_type, unsigned short int, boundary_id_type>> bndry_elem_side_id_list =
2133 mesh.get_boundary_info().build_side_list();
2136 for (std::size_t i=0; i<bndry_elem_side_id_list.size(); ++i)
2139 const Elem * elem =
mesh.elem_ptr(std::get<0>(bndry_elem_side_id_list[i]));
2141 std::vector<const Elem *> family;
2142 #ifdef LIBMESH_ENABLE_AMR 2149 family.push_back( elem );
2155 for (std::size_t j=0; j<family.size(); ++j)
2158 const Elem & f =
mesh.elem_ref(f_id);
2173 local_elem_boundary_id_lists[ std::get<2>(bndry_elem_side_id_list[i]) ].push_back( it->second );
2174 local_elem_boundary_id_side_lists[ std::get<2>(bndry_elem_side_id_list[i]) ].push_back(conv.
get_inverse_side_map( std::get<1>(bndry_elem_side_id_list[i]) ));
2177 libmesh_error_msg(
"Error, no Exodus mapping for Elem " \
2179 <<
" on processor " \
2194 const std::string & current_ss_name =
2195 mesh.get_boundary_info().get_sideset_name
2200 names_table.push_back_entry(current_ss_name);
2206 <<
", Name: " << current_ss_name
2222 local_elem_boundary_id_lists.find (cast_int<boundary_id_type>(this->
global_sideset_ids[i]));
2225 if (it == local_elem_boundary_id_lists.end())
2230 <<
" on this processor." << std::endl;
2237 EX_CHECK_ERR(this->
ex_err,
"Error writing sideset parameters in Nemesis");
2244 local_elem_boundary_id_side_lists.find (cast_int<boundary_id_type>(this->
global_sideset_ids[i]));
2246 libmesh_assert (it_sides != local_elem_boundary_id_side_lists.end());
2249 std::vector<int> & current_sideset_elem_ids = it->second;
2252 std::vector<int> & current_sideset_side_ids = (*it_sides).second;
2257 current_sideset_elem_ids.size(),
2260 EX_CHECK_ERR(this->
ex_err,
"Error writing sideset parameters in Nemesis");
2265 current_sideset_elem_ids.data(),
2266 current_sideset_side_ids.data());
2268 EX_CHECK_ERR(this->
ex_err,
"Error writing sidesets in Nemesis");
2277 names_table.get_char_star_star());
2278 EX_CHECK_ERR(
ex_err,
"Error writing sideset names");
2289 x.resize(local_num_nodes);
2290 y.resize(local_num_nodes);
2291 z.resize(local_num_nodes);
2302 if (local_num_nodes)
2307 x_single(
x.begin(),
x.end()),
2308 y_single(
y.begin(),
y.end()),
2309 z_single(
z.begin(),
z.end());
2324 EX_CHECK_ERR(
ex_err,
"Error writing node coordinates");
2328 EX_CHECK_ERR(
ex_err,
"Error writing node num map");
2333 EX_CHECK_ERR(
ex_err,
"Error writing empty node coordinates");
2336 EX_CHECK_ERR(
ex_err,
"Error writing empty node num map");
2363 (
mesh.subdomain_name(cast_int<subdomain_id_type>(this->global_elem_blk_ids[i])));
2366 std::map<int, std::vector<int>>::iterator it =
2379 EX_CHECK_ERR(this->
ex_err,
"Error writing element block from Nemesis.");
2386 cast_int<subdomain_id_type>(it->first);
2387 std::vector<int> & this_block_connectivity = it->second;
2388 std::vector<dof_id_type> & elements_in_this_block =
subdomain_map[block];
2404 elements_in_this_block.size(),
2407 EX_CHECK_ERR(
ex_err,
"Error writing element block from Nemesis.");
2411 this_block_connectivity.data());
2412 EX_CHECK_ERR(
ex_err,
"Error writing element connectivities from Nemesis.");
2419 EX_CHECK_ERR(
ex_err,
"Error writing element map");
2423 EX_CHECK_ERR(
ex_err,
"Error writing element block names");
2432 const std::vector<std::string> & names,
2435 int num_vars = cast_int<int>(names.size());
2438 for (
int c=0; c<num_vars; c++)
2440 #ifdef LIBMESH_USE_COMPLEX_NUMBERS 2441 std::vector<Real> real_parts(
num_nodes);
2442 std::vector<Real> imag_parts(
num_nodes);
2443 std::vector<Real> magnitudes(
num_nodes);
2448 real_parts[i] =
value.real();
2449 imag_parts[i] =
value.imag();
2456 std::vector<Number> cur_soln(
num_nodes);
2470 const std::vector<std::string> & names,
2472 const std::vector<std::string> & output_names)
2474 int num_vars = cast_int<int>(names.size());
2476 for (
int c=0; c<num_vars; c++)
2479 auto pos = std::find(output_names.begin(), output_names.end(), names[c]);
2482 if (pos == output_names.end())
2488 int variable_name_position =
2489 cast_int<int>(std::distance(output_names.begin(), pos));
2492 std::vector<numeric_index_type> required_indices(
num_nodes);
2499 std::vector<Number> local_soln;
2500 parallel_soln.
localize(local_soln, required_indices);
2502 #ifndef LIBMESH_USE_COMPLEX_NUMBERS 2508 std::vector<Real> real_parts(
num_nodes);
2509 std::vector<Real> imag_parts(
num_nodes);
2510 std::vector<Real> magnitudes(
num_nodes);
2514 real_parts[i] = local_soln[i].real();
2515 imag_parts[i] = local_soln[i].imag();
2516 magnitudes[i] =
std::abs(local_soln[i]);
2532 const std::vector<std::set<subdomain_id_type>> & vars_active_subdomains)
2535 if (names.size() == 0)
2560 for (
unsigned int var=0; var<names.size(); ++var)
2561 if (vars_active_subdomains[var].empty() ||
2562 vars_active_subdomains[var].count
2564 truth_tab[names.size()*blk + var] = 1;
2567 if (truth_tab.size())
2571 cast_int<int>(names.size()),
2573 EX_CHECK_ERR(
ex_err,
"Error writing element truth table.");
2582 const std::vector<std::string> & names,
2584 const std::vector<std::set<subdomain_id_type>> & vars_active_subdomains)
2595 for (
unsigned int v=0; v<names.size(); ++v)
2598 const auto & active_subdomains = vars_active_subdomains[v];
2605 cast_int<subdomain_id_type>(sbd_id_int);
2607 const std::vector<dof_id_type> empty_vec;
2608 const std::vector<dof_id_type> & elem_ids =
2612 if (active_subdomains.empty() || active_subdomains.count(sbd_id))
2614 std::vector<numeric_index_type> required_indices;
2615 required_indices.reserve(elem_ids.size());
2617 for (
const auto &
id : elem_ids)
2618 required_indices.push_back(v * parallel_n_elem +
id);
2620 std::vector<Number> local_soln;
2621 parallel_soln.
localize(local_soln, required_indices);
2628 if (local_soln.size())
2632 static_cast<int>(v+1),
2633 static_cast<int>(sbd_id),
2634 static_cast<int>(local_soln.size()),
2636 EX_CHECK_ERR(
ex_err,
"Error writing element values.");
2643 EX_CHECK_ERR(
ex_err,
"Error flushing buffers to file.");
2652 std::ostringstream file_oss;
2671 unsigned int field_width = cast_int<unsigned int>(file_oss.str().size());
2674 libMesh::out <<
"field_width=" << field_width << std::endl;
2677 file_oss << base_filename
2679 <<
'.' << std::setfill(
'0') << std::setw(field_width) << this->
processor_id();
2682 return file_oss.str();
2687 #endif // #if defined(LIBMESH_HAVE_NEMESIS_API) && defined(LIBMESH_HAVE_EXODUS_API) void set_union(T &data, const unsigned int root_id) const
bool _elem_vars_initialized
const std::set< boundary_id_type > & get_side_boundary_ids() const
Nemesis_IO_Helper(const ParallelObject &parent, bool verbose=false, bool single_precision=false)
std::map< subdomain_id_type, std::vector< dof_id_type > > subdomain_map
virtual ~Nemesis_IO_Helper()
std::vector< std::string > elem_var_names
std::vector< int > num_global_node_counts
void compute_element_maps()
std::vector< int > global_nodeset_ids
virtual void initialize(std::string title, const MeshBase &mesh, bool use_discontinuous=false) override
void write_var_names(ExodusVarType type, std::vector< std::string > &names)
std::vector< int > global_sideset_ids
void compute_num_global_nodesets(const MeshBase &pmesh)
std::vector< int > node_cmap_ids
void get_ss_param_global()
std::vector< int > exodus_elem_num_to_libmesh
void allgather(const T &send, std::vector< T, A > &recv) const
std::vector< int > node_mape
void compute_elem_communication_maps()
void compute_num_global_elem_blocks(const MeshBase &pmesh)
if(!eq) SETERRQ2(((PetscObject) dm) -> comm, PETSC_ERR_ARG_WRONG, "DM of type %s, not of type %s",((PetscObject) dm) ->type, DMLIBMESH)
EXODUS_EXPORT int ex_put_node_set_param(int exoid, ex_entity_id node_set_id, int64_t num_nodes_in_set, int64_t num_dist_in_set)
The base class for all geometric element types.
IntRange< std::size_t > index_range(const std::vector< T > &vec)
ExodusII_IO_Helper::Conversion assign_conversion(std::string type_str)
void put_elem_map(std::vector< int > &elem_mapi, std::vector< int > &elem_mapb)
EXODUS_EXPORT int ex_put_elem_block(int exoid, ex_entity_id elem_blk_id, const char *elem_type, int64_t num_elem_this_blk, int64_t num_nodes_per_elem, int64_t num_attr)
const Parallel::Communicator & comm() const
std::vector< int > num_global_node_df_counts
std::vector< int > block_ids
EXODUS_EXPORT int ex_put_coord(int exoid, const void *x_coor, const void *y_coor, const void *z_coor)
virtual SimpleRange< element_iterator > active_element_ptr_range()=0
std::vector< std::vector< int > > elem_cmap_side_ids
std::vector< std::vector< int > > node_cmap_proc_ids
void put_ns_param_global(std::vector< int > &global_nodeset_ids, std::vector< int > &num_global_node_counts, std::vector< int > &num_global_node_df_counts)
void put_eb_info_global(std::vector< int > &global_elem_blk_ids, std::vector< int > &global_elem_blk_cnts)
ElemType get_canonical_type() const
void compute_border_node_ids(const MeshBase &pmesh)
const BoundaryInfo & get_boundary_info() const
void compute_communication_map_parameters()
void write_nodal_values(int var_id, const std::vector< Real > &values, int timestep)
void check_existing_vars(ExodusVarType type, std::vector< std::string > &names, std::vector< std::string > &names_from_file)
EXODUS_EXPORT int ex_put_init(int exoid, const char *title, int64_t num_dim, int64_t num_nodes, int64_t num_elem, int64_t num_elem_blk, int64_t num_node_sets, int64_t num_side_sets)
virtual void write_elements(const MeshBase &mesh, bool use_discontinuous=false) override
void compute_node_communication_maps()
std::vector< int > num_global_side_df_counts
std::map< int, int > libmesh_elem_num_to_exodus
void build_side_list(std::vector< dof_id_type > &element_id_list, std::vector< unsigned short int > &side_list, std::vector< boundary_id_type > &bc_id_list) const
const std::set< boundary_id_type > & get_node_boundary_ids() const
void build_element_and_node_maps(const MeshBase &pmesh)
EXODUS_EXPORT int ex_put_elem_var(int exoid, int time_step, int elem_var_index, ex_entity_id elem_blk_id, int64_t num_elem_this_blk, const void *elem_var_vals)
void put_init_global(dof_id_type num_nodes_global, dof_id_type num_elems_global, unsigned num_elem_blks_global, unsigned num_node_sets_global, unsigned num_side_sets_global)
virtual SimpleRange< element_iterator > active_local_element_ptr_range()=0
EXODUS_EXPORT int ex_put_node_set(int exoid, ex_entity_id node_set_id, const void_int *node_set_node_list)
processor_id_type n_processors() const
void build_node_list(std::vector< dof_id_type > &node_id_list, std::vector< boundary_id_type > &bc_id_list) const
const dof_id_type n_nodes
virtual void write_nodal_coordinates(const MeshBase &mesh, bool use_discontinuous=false) override
std::vector< int > num_global_side_counts
void active_family_tree_by_side(std::vector< const Elem *> &family, const unsigned int side, const bool reset=true) const
void push_back_entry(const std::string &name)
virtual unsigned int n_nodes() const =0
std::vector< int > global_elem_blk_ids
virtual void initialize_element_variables(std::vector< std::string > names, const std::vector< std::set< subdomain_id_type >> &vars_active_subdomains) override
virtual element_iterator active_local_elements_begin()=0
std::vector< std::vector< int > > elem_cmap_elem_ids
EXODUS_EXPORT int ex_put_side_set(int exoid, ex_entity_id side_set_id, const void_int *side_set_elem_list, const void_int *side_set_side_list)
std::set< unsigned > border_elem_ids
static std::unique_ptr< Elem > build(const ElemType type, Elem *p=nullptr)
std::set< unsigned > internal_node_ids
std::vector< int > node_mapi
std::vector< std::vector< int > > elem_cmap_proc_ids
void put_cmap_params(std::vector< int > &node_cmap_ids, std::vector< int > &node_cmap_node_cnts, std::vector< int > &elem_cmap_ids, std::vector< int > &elem_cmap_elem_cnts)
std::set< unsigned > border_node_ids
EXODUS_EXPORT int ex_put_names(int exoid, ex_entity_type obj_type, char *names[])
virtual dof_id_type parallel_n_nodes() const =0
std::set< int > nodes_attached_to_local_elems
An object whose state is distributed along a set of processors.
virtual dof_id_type parallel_n_elem() const =0
void compute_num_global_sidesets(const MeshBase &pmesh)
void get_eb_info_global()
std::map< int, int > libmesh_node_num_to_exodus
void compute_internal_and_border_elems_and_internal_nodes(const MeshBase &pmesh)
int get_node_map(int i) const
void put_elem_cmap(std::vector< std::vector< int >> &elem_cmap_elem_ids, std::vector< std::vector< int >> &elem_cmap_side_ids, std::vector< std::vector< int >> &elem_cmap_proc_ids)
std::map< subdomain_id_type, unsigned > local_subdomain_counts
std::map< int, std::vector< int > > block_id_to_elem_connectivity
char ** get_char_star_star()
virtual void write_nodesets(const MeshBase &mesh) override
EXODUS_EXPORT int ex_put_side_set_param(int exoid, ex_entity_id side_set_id, int64_t num_side_in_set, int64_t num_dist_fact_in_set)
std::map< unsigned, std::set< unsigned > >::iterator proc_nodes_touched_iterator
void get_ns_param_global()
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void put_node_map(std::vector< int > &node_mapi, std::vector< int > &node_mapb, std::vector< int > &node_mape)
EXODUS_EXPORT int ex_put_node_num_map(int exoid, const void_int *node_map)
std::vector< int > elem_cmap_elem_cnts
EXODUS_EXPORT int ex_put_elem_conn(int exoid, ex_entity_id elem_blk_id, const void_int *connect)
std::string construct_nemesis_filename(const std::string &base_filename)
int get_inverse_side_map(int i) const
void swap(Iterator &lhs, Iterator &rhs)
std::vector< int > elem_cmap_ids
virtual const Elem & elem_ref(const dof_id_type i) const
void put_ss_param_global(std::vector< int > &global_sideset_ids, std::vector< int > &num_global_side_counts, std::vector< int > &num_global_side_df_counts)
virtual void write_sidesets(const MeshBase &mesh) override
std::vector< int > node_cmap_node_cnts
std::map< unsigned, std::set< unsigned > > proc_nodes_touched_intersections
std::vector< int > exodus_node_num_to_libmesh
void write_element_values(const MeshBase &mesh, const NumericVector< Number > ¶llel_soln, const std::vector< std::string > &names, int timestep, const std::vector< std::set< subdomain_id_type >> &vars_active_subdomains)
void write_exodus_initialization_info(const MeshBase &pmesh, const std::string &title)
std::string exodus_elem_type() const
void put_init_info(unsigned num_proc, unsigned num_proc_in_file, const char *ftype)
EXODUS_EXPORT int ex_put_elem_var_tab(int exoid, int num_elem_blk, int num_elem_var, int *elem_var_tab)
void put_node_cmap(std::vector< std::vector< int >> &node_cmap_node_ids, std::vector< std::vector< int >> &node_cmap_proc_ids)
EXODUS_EXPORT int ex_update(int exoid)
std::vector< int > elem_mapb
std::vector< int > node_mapb
virtual const Node * node_ptr(const dof_id_type i) const =0
std::vector< std::vector< int > > node_cmap_node_ids
processor_id_type processor_id() const
std::map< unsigned, std::set< std::pair< unsigned, unsigned > > >::iterator proc_border_elem_sets_iterator
EXODUS_EXPORT int ex_put_elem_num_map(int exoid, const void_int *elem_map)
OStreamProxy out(std::cout)
processor_id_type processor_id() const
virtual element_iterator active_local_elements_end()=0
virtual ElemType type() const =0
long double min(long double a, double b)
A geometric point in (x,y,z) space.
std::vector< int > global_elem_blk_cnts
void put_loadbal_param(unsigned num_internal_nodes, unsigned num_border_nodes, unsigned num_external_nodes, unsigned num_internal_elems, unsigned num_border_elems, unsigned num_node_cmaps, unsigned num_elem_cmaps)
virtual void create(std::string filename) override
std::vector< int > elem_mapi
std::map< unsigned, std::set< std::pair< unsigned, unsigned > > > proc_border_elem_sets
void put_n_coord(unsigned start_node_num, unsigned num_nodes, std::vector< Real > &x_coor, std::vector< Real > &y_coor, std::vector< Real > &z_coor)
std::set< unsigned > internal_elem_ids
void write_nodal_solution(const NumericVector< Number > ¶llel_soln, const std::vector< std::string > &names, int timestep, const std::vector< std::string > &output_names)
virtual void localize(std::vector< T > &v_local) const =0