9#include <kernel/geometry/cgal.hpp>
10#include <kernel/geometry/common_factories.hpp>
11#include <kernel/geometry/mesh_file_reader.hpp>
12#include <kernel/geometry/mesh_node.hpp>
13#include <kernel/geometry/parti_2lvl.hpp>
14#include <kernel/geometry/parti_iterative.hpp>
15#include <kernel/geometry/parti_parmetis.hpp>
16#include <kernel/geometry/parti_zoltan.hpp>
17#include <kernel/geometry/partition_set.hpp>
18#include <kernel/geometry/patch_mesh_factory.hpp>
19#include <kernel/geometry/patch_meshpart_factory.hpp>
20#include <kernel/geometry/patch_meshpart_splitter.hpp>
21#include <kernel/geometry/voxel_map.hpp>
22#include <kernel/runtime.hpp>
23#include <kernel/trafo/standard/mapping.hpp>
24#include <kernel/util/dist.hpp>
25#include <kernel/util/dist_file_io.hpp>
26#include <kernel/util/math.hpp>
27#include <kernel/util/property_map.hpp>
28#include <kernel/util/simple_arg_parser.hpp>
29#include <kernel/util/statistics.hpp>
30#include <kernel/util/stop_watch.hpp>
32#include <control/domain/parti_domain_control_base.hpp>
34#include <kernel/util/string.hpp>
35#include <kernel/util/tiny_algebra.hpp>
52 template<
typename DomainLevel_>
59 using typename BaseClass::MeshType;
61 using typename BaseClass::MeshNodeType;
74 std::unique_ptr<MeshNodeType> node,
86 std::unique_ptr<MeshNodeType> node,
87 std::unique_ptr<MeshNodeType> slag_node,
97 slag_level = std::make_shared<DomainLevel_>(_lvl_idx, std::move(slag_node));
108 template<
typename MeshType_,
typename WeightType_>
112 using WeightType = WeightType_;
113 using MeshType = MeshType_;
161 template<
typename MeshType_,
typename WeightType_>
167 using MeshType =
typename BaseClass::MeshType;
168 using WeightType =
typename BaseClass::WeightType;
169 using VertexType =
typename MeshType::VertexType;
170 using CoordType =
typename MeshType::CoordType;
172 static constexpr int dim = MeshType::shape_dim;
175 std::unique_ptr<Geometry::VoxelMap> _voxel_map;
179 _voxel_map(std::move(voxel_map))
195 const VertexType& min,
196 const VertexType& max,
200 _voxel_map = std::make_unique<Geometry::VoxelMap>();
201 if constexpr(dim == 2)
203 _voxel_map->set_bounding_box_2d(min[0], max[0], min[1], max[1]);
207 _voxel_map->set_bounding_box_3d(min[0], max[0], min[1], max[1], min[2], max[2]);
211 for(
int i(0); i < dim; i++)
213 resolution =
Math::min(resolution, (max[i] - min[i]) /
Real(slices[i]));
215 resolution /=
Real(2ULL << level);
216 _voxel_map->set_resolution(resolution);
230 _voxel_map = std::make_unique<Geometry::VoxelMap>();
231 if constexpr(dim == 2)
233 _voxel_map->set_bounding_box_2d(min[0], max[0], min[1], max[1]);
237 _voxel_map->set_bounding_box_3d(min[0], max[0], min[1], max[1], min[2], max[2]);
239 _voxel_map->set_resolution(resolution);
265 _voxel_map->set_out_of_bounds_value(
value);
285 _voxel_map->compute_map(comm, masker,
true);
305 template<
typename Lambda_>
308 if constexpr(dim == 2)
310 _voxel_map->compute_map_from_lambda_2d(comm, std::forward<Lambda_>(lambda),
true);
314 _voxel_map->compute_map_from_lambda_3d(comm, std::forward<Lambda_>(lambda),
true);
338 this->_voxel_map->compute_map_from_chart(comm, chart, invert,
true);
364 std::stringstream sstr;
395 static_assert(dim == 3);
396 _voxel_map->compute_map_from_off_3d(comm, is, invert,
true);
428 const auto& vtx = mesh.get_vertex_set();
429 const Index nv = vtx.get_num_vertices();
431 std::vector<int> mask(nv, 0);
432 for(
Index i(0); i < nv; ++i)
434 mask[i] = _voxel_map->check_point_nearest(vtx[i]);
443 const Index num_elems = mesh.get_num_elements();
446 std::vector<WeightType> weights(num_elems, 0.0);
449 const auto& vtx = mesh.get_vertex_set();
450 const auto& verts_at_elem = mesh.template get_index_set<dim, 0>();
457 for(
Index ielem(0); ielem < num_elems; ++ielem)
467 elbox_min = elbox_max = vtx[verts_at_elem(ielem, 0)];
468 for(
int j(1); j < verts_at_elem.num_indices; ++j)
470 const auto& v = vtx[verts_at_elem(ielem, j)];
471 for(
int k(0); k < dim; ++k)
478 weights[ielem] = this->_voxel_map->sample_box(elbox_min, elbox_max);
501 const Index num_elems = mesh.get_num_elements();
504 std::vector<Index> masked_elems;
505 masked_elems.reserve(num_elems);
508 const auto& vtx = mesh.get_vertex_set();
509 const auto& verts_at_elem = mesh.template get_index_set<dim, 0>();
516 for(
Index ielem(0); ielem < num_elems; ++ielem)
526 elbox_min = elbox_max = vtx[verts_at_elem(ielem, 0)];
527 for(
int j(1); j < verts_at_elem.num_indices; ++j)
529 const auto& v = vtx[verts_at_elem(ielem, j)];
530 for(
int k(0); k < dim; ++k)
537 if(this->_voxel_map->check_box(elbox_min, elbox_max))
539 masked_elems.push_back(ielem);
550 const Index num_elems = mesh.get_num_elements();
551 const auto num_procs =
Index(comm.
size());
552 const auto cur_rank =
Index(comm.
rank());
555 const Index base_elems = num_elems / num_procs;
556 const Index remainder = num_elems % num_procs;
558 const Index num_elements = base_elems +
Index(cur_rank < remainder);
560 const Index offset = (cur_rank * base_elems) +
Math::min(cur_rank, remainder);
563 std::vector<Index> masked_elems;
564 masked_elems.reserve(num_elements);
567 const auto& vtx = mesh.get_vertex_set();
568 const auto& verts_at_elem = mesh.template get_index_set<dim, 0>();
575 for(
Index ielem = 0; ielem < num_elements; ielem++)
577 const Index elem = offset + ielem;
586 elbox_min = elbox_max = vtx[verts_at_elem(elem, 0)];
587 for(
int j(1); j < verts_at_elem.num_indices; ++j)
589 const auto& v = vtx[verts_at_elem(elem, j)];
590 for(
int k(0); k < dim; ++k)
597 if(this->_voxel_map->check_box(elbox_min, elbox_max))
599 masked_elems.push_back(elem);
604 std::vector<int> recv_sizes(num_procs);
605 recv_sizes.at(cur_rank) = int(masked_elems.size());
607 comm.
allgather(recv_sizes.data(), 1, recv_sizes.data(), 1);
610 std::vector<Index> gathered_mask(std::size_t(std::accumulate(recv_sizes.begin(), recv_sizes.end(), 0)), 0);
613 std::vector<int> displacements;
614 displacements.reserve(recv_sizes.size());
615 std::exclusive_scan(recv_sizes.begin(), recv_sizes.end(), std::back_inserter(displacements), 0);
621 gathered_mask.data(),
623 displacements.data());
626 return gathered_mask;
630#if defined(FEAT_HAVE_CGAL) || defined(DOXYGEN)
636 template<
typename MeshType_,
typename WeightType_>
642 using MeshType =
typename BaseClass::MeshType;
643 using WeightType =
typename BaseClass::WeightType;
644 using VertexType =
typename MeshType::VertexType;
645 using CoordType =
typename MeshType::CoordType;
648 static constexpr int dim = MeshType::shape_dim;
650 static_assert(dim == 3,
"CGAL deslagging is only available in 3D");
653 bool _cheap_weights =
true;
654 std::unique_ptr<CGALWrapperType> _cgal_wrapper;
659 _cgal_wrapper(std::move(cgal_wrapper))
672 std::stringstream file_contents;
674 _cgal_wrapper = std::make_unique<CGALWrapperType>(file_contents, file_mode);
680 XASSERT(_cgal_wrapper !=
nullptr);
681 return *_cgal_wrapper;
687 XASSERT(_cgal_wrapper !=
nullptr);
688 return *_cgal_wrapper;
699 _cheap_weights = enable;
705 const Index num_elems = mesh.get_num_elements();
708 const auto& vtx = mesh.get_vertex_set();
709 const auto& verts_at_elem = mesh.template get_index_set<dim, 0>();
712 return _offset_gather_mask(vtx, verts_at_elem, 0u, num_elems);
718 const Index num_elems = mesh.get_num_elements();
719 const auto num_procs =
Index(comm.
size());
720 const auto cur_rank =
Index(comm.
rank());
722 const Index base_elems = num_elems / num_procs;
723 const Index remainder = num_elems % num_procs;
725 const Index num_elements = base_elems +
Index(cur_rank < remainder);
727 const Index offset = (cur_rank * base_elems) +
Math::min(cur_rank, remainder);
730 const auto& vtx = mesh.get_vertex_set();
731 const auto& verts_at_elem = mesh.template get_index_set<dim, 0>();
733 const auto masked_elems = _offset_gather_mask(vtx, verts_at_elem, offset, num_elements);
736 std::vector<int> recv_sizes(num_procs);
737 recv_sizes.at(cur_rank) = int(masked_elems.size());
739 comm.
allgather(recv_sizes.data(), 1, recv_sizes.data(), 1);
742 std::vector<Index> gathered_mask(std::size_t(std::accumulate(recv_sizes.begin(), recv_sizes.end(), 0)), 0);
745 std::vector<int> displacements;
746 displacements.reserve(recv_sizes.size());
747 std::exclusive_scan(recv_sizes.begin(), recv_sizes.end(), std::back_inserter(displacements), 0);
753 gathered_mask.data(),
755 displacements.data());
758 return gathered_mask;
769 const Index num_elems = mesh.get_num_elements();
772 std::vector<WeightType> weights(num_elems, 0.0);
776 cub_fac.create(rule);
779 this->_cgal_wrapper->point_not_outside(CoordType(0), CoordType(0), CoordType(0));
783 using TrafoEvaluator =
typename TrafoType::template Evaluator<typename MeshType::ShapeType, CoordType>::Type;
787 using TrafoEvalData =
typename TrafoEvaluator::template ConfigTraits<trafo_config>::EvalDataType;
789 const TrafoType trafo(
const_cast<MeshType&
>(mesh));
791 FEAT_PRAGMA_OMP(parallel)
793 TrafoEvaluator trafo_eval(trafo);
794 TrafoEvalData trafo_data;
798 for(
Index ielem = 0; ielem < num_elems; ++ielem)
800 trafo_eval.prepare(ielem);
801 CoordType loc_sum = CoordType(0);
802 for(
int k = 0; k < rule.get_num_points(); ++k)
804 const auto ref_point = rule.get_point(k);
805 trafo_eval(trafo_data, ref_point);
806 const auto&
img_point = trafo_data.img_point;
807 const CoordType weight = trafo_data.jac_det * rule.get_weight(k);
811 loc_sum /= trafo_eval.volume();
812 ASSERTM(loc_sum >= CoordType(0) && loc_sum <= CoordType(1),
"Local sum not between zero and one");
815 weights[ielem] = loc_sum;
823 template<
typename VtxSet_,
typename IdxMap_>
824 std::vector<Index> _offset_gather_mask_omp(
const VtxSet_& vtx,
const IdxMap_& verts_at_elem,
Index offset,
Index num_elems)
const
827 std::vector<std::uint8_t> masked_elems;
828 masked_elems.resize(num_elems);
830 FEAT_PRAGMA_OMP(parallel
for)
831 for(std::size_t k = 0; k < num_elems; ++k)
833 masked_elems[k] = 0u;
836 std::size_t num_mask = 0u;
838 FEAT_PRAGMA_OMP(parallel
for reduction(+ : num_mask))
839 for(
Index ielem = 0; ielem < num_elems; ++ielem)
841 std::array<Tiny::Vector<CoordType, dim>, std::decay_t<
decltype(verts_at_elem)>::num_indices> verts;
842 for(std::size_t k = 0; k < verts.size(); ++k)
844 verts[k] = vtx[verts_at_elem(ielem+offset,
int(k))];
847 if(this->_cgal_wrapper->intersects_polygon(verts))
849 masked_elems.at(ielem) = 1;
854 std::vector<Index> masked_elems_gathered;
855 masked_elems_gathered.reserve(num_mask);
857 std::size_t ctr_num = 0;
858 for(
Index ielem = 0; ielem < num_elems; ++ielem)
860 if(masked_elems[ielem] == 1)
863 masked_elems_gathered.push_back(ielem+offset);
867 XASSERTM(ctr_num == num_mask,
"Misscount in gather loop");
870 return masked_elems_gathered;
874 template<
typename VtxSet_,
typename IdxMap_>
875 std::vector<Index> _offset_gather_mask_single_thread(
const VtxSet_& vtx,
const IdxMap_& verts_at_elem,
Index offset,
Index num_elems)
const
878 std::vector<Index> masked_elems;
879 masked_elems.reserve(num_elems);
882 for(
Index ielem = 0; ielem < num_elems; ++ielem)
884 std::array<Tiny::Vector<CoordType, dim>, std::decay_t<
decltype(verts_at_elem)>::num_indices> verts;
885 for(std::size_t k = 0; k < verts.size(); ++k)
887 verts[k] = vtx[verts_at_elem(ielem+offset,
int(k))];
890 if(this->_cgal_wrapper->intersects_polygon(verts))
892 masked_elems.push_back(ielem+offset);
901 template<
typename VtxSet_,
typename IdxMap_>
902 std::vector<Index> _offset_gather_mask(
const VtxSet_& vtx,
const IdxMap_& verts_at_elem,
Index offset,
Index num_elems)
const
907 return _offset_gather_mask_omp(vtx, verts_at_elem, offset, num_elems);
909 return _offset_gather_mask_single_thread(vtx, verts_at_elem, offset, num_elems);
922 template<
typename DomainLevel_>
929 using typename BaseClass::LevelType;
933 using typename BaseClass::MeshType;
1029 this->_keep_deslagging_predicate =
true;
1111 XASSERTM(
shape_dim == 2,
"invalid dimension: this function can only be called for 2D domains!");
1124 _bbox_max[0] = x_max;
1126 _bbox_max[1] = y_max;
1135 Index n = vtx.get_num_vertices();
1136 for(
Index i(0); i < n; ++i)
1138 vtx[i][0] = x_min + (x_max - x_min) * vtx[i][0];
1139 vtx[i][1] = y_min + (y_max - y_min) * vtx[i][1];
1184 XASSERTM(
shape_dim == 3,
"invalid dimension: this function can only be called for 3D domains!");
1200 _bbox_max[0] = x_max;
1202 _bbox_max[1] = y_max;
1204 _bbox_max[2] = z_max;
1213 Index n = vtx.get_num_vertices();
1214 for(
Index i(0); i < n; ++i)
1216 vtx[i][0] = x_min + (x_max - x_min) * vtx[i][0];
1217 vtx[i][1] = y_min + (y_max - y_min) * vtx[i][1];
1218 vtx[i][2] = z_min + (z_max - z_min) * vtx[i][2];
1227 MeshNodeType& set_base_mesh(std::unique_ptr<MeshNodeType>&& mesh_node)
1234 for(std::size_t k = 0; k < std::size_t(
shape_dim); ++k)
1246 Index n = vtx.get_num_vertices();
1247 for(
Index i(0); i < n; ++i)
1252 _bbox_max[k] =
Math::max(_bbox_max[k], vtx[i][k]);
1259 this->_unstructured_mesh =
true;
1277 this->_watch_create_hierarchy.
start();
1281 if(this->_comm.
size() == 1)
1305 this->compile_virtual_levels();
1307 this->_watch_create_hierarchy.
stop();
1311 this->_watch_create_voxel_map.
elapsed() +
1312 this->_watch_create_hierarchy.
elapsed();
1318 if(!_keep_deslagging_predicate)
1333 return this->_watch_create_voxel_map;
1339 return this->_watch_create_hierarchy;
1356 XASSERT(level < this->size_physical());
1366 for(
auto it = this->_layer_levels.begin(); it != this->_layer_levels.end(); ++it)
1368 if(it != this->_layer_levels.begin())
1372 for(
auto jt = it->begin(); jt != it->end(); ++jt)
1374 msg +=
" " +
stringify((*jt)->get_level_index());
1378 if((*jt)->slag_level)
1380 ((msg +=
"<[") +=
stringify((*jt)->slag_level->get_mesh().get_num_elements()).pad_front(4)) +=
"]";
1396 virtual void create(
const std::deque<String>& filenames,
const String& dirpath =
"")
1399 ASSERTM(
false,
"Thou shall not arrive here!");
1413 ASSERTM(
false,
"Thou shall not arrive here!");
1422 virtual void create(std::unique_ptr<MeshNodeType>& )
1425 ASSERTM(
false,
"Thou shall not arrive here!");
1474 XASSERTM(mesh_node.
get_halo_map().empty(),
"This function must not be used for partitioned mesh nodes!");
1482 const Index num_elements = mesh_node.
get_mesh()->get_num_elements();
1483 std::vector<Index> elements(num_elements);
1484 for(
Index i(0); i < num_elements; i++)
1489 return mesh_node.
extract_patch(std::move(elements),
true,
false,
false);
1514 virtual std::unique_ptr<MeshNodeType>
1517 const bool split_meshparts =
true;
1518 const bool split_halos =
false;
1519 const bool split_patches =
false;
1523 const auto* prod_comm = is_child ? &ancestor.
progeny_comm :
nullptr;
1524 std::unique_ptr<MeshNodeType> new_node =
1534 const Index num_elements = mesh_node.
get_mesh()->get_num_elements();
1535 std::vector<Index> elements(num_elements);
1536 for(
Index i(0); i < num_elements; i++)
1542 return mesh_node.
extract_patch(std::move(elements),
true,
false,
false);
1570 const std::map<int, std::unique_ptr<MeshPartType>>& base_halo_map = base_mesh_node.
get_halo_map();
1573 if(base_halo_map.empty())
1579 const std::size_t num_halos = base_halo_map.size();
1585 std::vector<int> halo_ranks;
1586 std::vector<std::size_t> halo_send_sizes;
1587 for(
auto it = base_halo_map.begin(); it != base_halo_map.end(); ++it)
1590 halo_ranks.push_back(it->first);
1593 halo_send_sizes.push_back(halo_splitter.add_halo(it->first, *it->second));
1597 std::vector<std::size_t> halo_recv_sizes(num_halos);
1598 std::vector<std::vector<Index>> halo_send_data(num_halos);
1599 std::vector<std::vector<Index>> halo_recv_data(num_halos);
1606 const int layer_idx = is_child ? ancestor.
layer_p : ancestor.
layer;
1609 for(std::size_t i(0); i < num_halos; ++i)
1612 if(halo_send_sizes.at(i) > std::size_t(0))
1614 halo_send_data.at(i) = halo_splitter.serialize_split_halo(halo_ranks[i], -1);
1622 const Dist::Comm& layer_comm = this->_layers.at(std::size_t(layer_idx))->comm();
1625 for(std::size_t i(0); i < num_halos; ++i)
1628 halo_recv_reqs[i] = layer_comm.
irecv(&halo_recv_sizes[i], std::size_t(1), halo_ranks[i]);
1631 halo_send_reqs[i] = layer_comm.
isend(&halo_send_sizes[i], std::size_t(1), halo_ranks[i]);
1639 for(std::size_t i(0); i < num_halos; ++i)
1642 if(halo_recv_sizes[i] >
Index(0))
1645 halo_recv_data.at(i).resize(halo_recv_sizes[i]);
1646 halo_recv_reqs[i] = layer_comm.
irecv(halo_recv_data.at(i).data(), halo_recv_sizes.at(i), halo_ranks[i]);
1650 if(halo_send_sizes.at(i) >
Index(0))
1653 halo_send_reqs[i] = layer_comm.
isend(halo_send_data.at(i).data(), halo_send_sizes.at(i), halo_ranks[i]);
1671 for(std::size_t i(0); i < num_halos; ++i)
1673 halo_recv_data.at(i).resize(halo_recv_sizes[i]);
1678 for(std::size_t i(0); i < num_halos; ++i)
1680 if(halo_recv_sizes[i] > std::size_t(0))
1701 std::vector<std::array<Index, shape_dim + 1>> halo_send_intsec_sizes(num_halos);
1702 std::vector<std::array<Index, shape_dim + 1>> halo_recv_intsec_sizes(num_halos);
1705 for(std::size_t i(0); i < num_halos; ++i)
1708 if(halo_recv_sizes.at(i) ==
Index(0))
1714 if(!halo_splitter.intersect_split_halo(halo_ranks[i], halo_recv_data.at(i), 0))
1720 std::unique_ptr<MeshPartType> split_halo = halo_splitter.make_unique();
1725 halo_send_intsec_sizes[i][
Index(j)] = split_halo->get_num_entities(j);
1729 patch_mesh_node.
add_halo(halo_ranks[i], std::move(split_halo));
1733 if((ancestor.
layer_p >= 0) || (!is_child && (ancestor.
layer >= 0)))
1736 const LayerType& layer = *this->_layers.at(std::size_t(is_child ? ancestor.
layer_p : ancestor.
layer));
1739 for(std::size_t i(0); i < num_halos; ++i)
1742 layer.comm().
irecv(halo_recv_intsec_sizes.at(i).data(), std::size_t(
shape_dim + 1), halo_ranks[i]);
1744 layer.comm().
isend(halo_send_intsec_sizes.at(i).data(), std::size_t(
shape_dim + 1), halo_ranks[i]);
1752 for(std::size_t i(0); i < num_halos; ++i)
1756 if(halo_recv_intsec_sizes[i][
Index(j)] != halo_send_intsec_sizes[i][
Index(j)])
1758 String msg =
"Inconsistent deslagged halo size between process ";
1760 msg +=
" and neighbor with layer rank ";
1783 const auto& verts_at_elem = base_node.get_mesh()->template get_index_set<MeshType::shape_dim, 0>();
1792#ifdef FEAT_DEBUG_MODE
1793 std::cout <<
"Unstructured Layering Computation not implemented yet!";
1811 XASSERT(slag_part !=
nullptr);
1812 const Geometry::TargetSet& slag_target = slag_part->template get_target_set<MeshType::shape_dim>();
1815 const Index num_colors =
Index(1) << MeshType::shape_dim;
1823 if constexpr(MeshType::shape_dim == 1)
1825 for(
Index i(0); i < num_elems; ++i)
1827 colors[i] = slag_target[i] & 1ULL;
1830 else if constexpr(MeshType::shape_dim == 2)
1832 for(
Index i(0); i < num_elems; ++i)
1834 Index iel = slag_target[i];
1835 Index ix = iel % this->_base_slices[0];
1836 Index iy = iel / this->_base_slices[0];
1837 colors[i] = (ix & 1ULL) | ((iy & 1ULL) << 1ULL);
1840 else if constexpr(MeshType::shape_dim == 3)
1842 for(
Index i(0); i < num_elems; ++i)
1844 Index iel = slag_target[i];
1845 Index ix = iel % this->_base_slices[0];
1846 Index iy = (iel / this->_base_slices[0]) % this->_base_slices[1];
1847 Index iz = iel / (this->_base_slices[0] * this->_base_slices[1]);
1848 colors[i] = (ix & 1ULL) | ((iy & 1ULL) << 1ULL) | ((iz & 1ULL) << (1ULL << 1ULL));
1868 XASSERT(slag_part !=
nullptr);
1869 const Geometry::TargetSet& slag_target = slag_part->template get_target_set<MeshType::shape_dim>();
1872 const Index num_colors =
Index(1) << MeshType::shape_dim;
1880 for(
Index i(0); i < num_elems; ++i)
1882 colors[i] = slag_target[i] % num_colors;
1906 int child_rank)
const
1910 XASSERT(patch_part !=
nullptr);
1911 const Geometry::TargetSet& patch_target = patch_part->template get_target_set<MeshType::shape_dim>();
1922 for(
Index i(0); i < num_elems; ++i)
1924 colors[i] = parent_coloring[patch_target[i]];
1943 XASSERT(slag_part !=
nullptr);
1944 const Geometry::TargetSet& slag_target = slag_part->template get_target_set<MeshType::shape_dim>();
1955 denom *= this->_base_slices[
Index(j)];
1959 std::vector<Index> aux(max_layers, 0);
1960 for(
Index i(0); i < num_elems; ++i)
1962 ++aux[slag_target[i] / denom];
1966 Index num_layers = 0;
1967 for(
Index i(0); i < max_layers; ++i)
1969 Index k = num_layers;
1980 for(
Index i(0); i < num_elems; ++i)
1982 layers[i] = aux[slag_target[i] / denom];
2006 XASSERT(slag_part !=
nullptr);
2007 const Geometry::TargetSet& slag_target = slag_part->template get_target_set<MeshType::shape_dim>();
2015 std::vector<Index> aux(max_layers, 0);
2016 for(
Index i(0); i < num_elems; ++i)
2019 ++aux[(coarse_layering[qux >> 1ULL] << 1ULL) | (qux & 1ULL)];
2023 Index num_layers = 0;
2024 for(
Index i(0); i < max_layers; ++i)
2026 Index k = num_layers;
2037 for(
Index i(0); i < num_elems; ++i)
2040 layers[i] = aux[(coarse_layering[qux >> 1ULL] << 1ULL) | (qux & 1ULL)];
2064 int child_rank)
const
2073 XASSERT(patch_part !=
nullptr);
2074 const Geometry::TargetSet& patch_target = patch_part->template get_target_set<MeshType::shape_dim>();
2082 std::vector<Index> aux(max_layers, 0);
2083 for(
Index i(0); i < num_elems; ++i)
2085 ++aux[parent_layering[patch_target[i]]];
2089 Index num_layers = 0;
2090 for(
Index i(0); i < max_layers; ++i)
2092 Index k = num_layers;
2103 for(
Index i(0); i < num_elems; ++i)
2105 layers[i] = aux[parent_layering[patch_target[i]]];
2125 this->push_layer(std::make_shared<LayerType>(this->_comm.
comm_dup(), 0));
2135 std::unique_ptr<MeshNodeType> base_slag_node = std::move(base_mesh_node);
2145 for(; lvl < ancestor.desired_level_min; ++lvl)
2147 base_slag_node = base_mesh_node->refine_unique(this->
_adapt_mode);
2149 base_layering =
_unstructured_mesh ? this->_compute_unstructured_layering(*base_mesh_node)
2157 base_coloring = this->_compute_unstructured_coloring(*base_mesh_node);
2181 auto refined_node = base_mesh_node->refine_unique(this->
_adapt_mode);
2184 std::shared_ptr<LevelType> level_ptr = std::make_shared<LevelType>(
2186 std::move(base_mesh_node),
2187 std::move(base_slag_node),
2188 std::move(base_coloring),
2189 std::move(base_layering));
2190 this->push_level_front(0, level_ptr);
2193 base_slag_node = std::move(refined_node);
2195 base_coloring =
_unstructured_mesh ? this->_compute_unstructured_coloring(*base_mesh_node)
2198 ? this->_compute_unstructured_layering(*base_mesh_node)
2206 this->push_level_front(
2208 std::make_shared<LevelType>(
2210 std::move(base_mesh_node),
2211 std::move(base_slag_node),
2212 std::move(base_coloring),
2213 std::move(base_layering)));
2219#if defined(FEAT_HAVE_MPI) || defined(DOXYGEN)
2230 std::shared_ptr<LayerType> layer = std::make_shared<LayerType>(this->_comm.
comm_dup(), 0);
2231 this->push_layer(layer);
2240 std::unique_ptr<MeshNodeType> base_slag_node = std::move(base_mesh_node);
2254 (base_mesh_node->get_mesh()->get_num_elements() >=
2268 base_slag_node = base_mesh_node->refine_unique(this->
_adapt_mode);
2270 base_coloring =
_unstructured_mesh ? this->_compute_unstructured_coloring(*base_mesh_node)
2272 base_layering =
_unstructured_mesh ? this->_compute_unstructured_layering(*base_mesh_node)
2277 XASSERTM(ancestor.
parti_found,
"SlaggedDomainControl failed to find a valid partitioning");
2285 base_coloring =
_unstructured_mesh ? this->_compute_unstructured_coloring(*base_mesh_node)
2290 std::vector<int> neighbor_ranks;
2291 std::unique_ptr<MeshNodeType> patch_mesh_node(
2292 base_mesh_node->extract_patch(neighbor_ranks, ancestor.
parti_graph, this->_comm.rank()));
2296 if(lvl == ancestor.desired_level_min)
2306 layer->set_neighbor_ranks(neighbor_ranks);
2309 std::unique_ptr<MeshNodeType> patch_slag_node;
2312 for(; lvl < ancestor.desired_level_min; ++lvl)
2315 patch_slag_node = patch_mesh_node->refine_unique(this->
_adapt_mode);
2316 patch_mesh_node = this->
_deslag_mesh_node(lvl + 1, *patch_slag_node, ancestor,
false);
2317 patch_layering =
_unstructured_mesh ? this->_compute_unstructured_layering(*patch_mesh_node)
2322 if(patch_coloring.
empty())
2324 patch_coloring =
_unstructured_mesh ? this->_compute_unstructured_coloring(*patch_mesh_node)
2338 auto refined_node = patch_mesh_node->refine_unique(this->
_adapt_mode);
2341 std::shared_ptr<LevelType> level_ptr = std::make_shared<LevelType>(
2343 std::move(patch_mesh_node),
2344 std::move(patch_slag_node),
2345 std::move(patch_coloring),
2346 std::move(patch_layering));
2349 this->push_level_front(0, level_ptr);
2352 patch_slag_node = std::move(refined_node);
2353 patch_mesh_node = this->
_deslag_mesh_node(lvl + 1, *patch_slag_node, ancestor,
false);
2354 patch_coloring =
_unstructured_mesh ? this->_compute_unstructured_coloring(*patch_mesh_node)
2357 ? this->_compute_unstructured_layering(*patch_mesh_node)
2365 this->push_level_front(
2367 std::make_shared<LevelType>(
2369 std::move(patch_mesh_node),
2370 std::move(patch_slag_node),
2371 std::move(patch_coloring),
2372 std::move(patch_layering)));
2396 std::unique_ptr<MeshNodeType> parent_slag_node;
2397 std::unique_ptr<MeshNodeType> parent_mesh_node = this->
_deslag_mesh_node(lvl, *base_mesh_node);
2405 base_mesh_node.reset();
2408 for(std::size_t slayer = this->
_ancestry.size(); slayer > std::size_t(0);)
2411 const bool is_base_layer = (slayer == this->
_ancestry.size());
2419 int parent_min_lvl = -1;
2430 this->
_check_parti(ancestor, *parent_mesh_node, is_base_layer);
2476 auto refined_node = parent_mesh_node->refine_unique(this->
_adapt_mode);
2479 std::shared_ptr<LevelType> level_ptr;
2482 if((ancestor.
layer_p >= 0) && (parent_min_lvl >= 0) && (lvl >= parent_min_lvl))
2484 level_ptr = std::make_shared<LevelType>(
2486 std::move(parent_mesh_node),
2487 std::move(parent_slag_node),
2488 std::move(parent_coloring),
2489 std::move(parent_layering));
2490 this->push_level_front(ancestor.
layer_p, level_ptr);
2494 parent_slag_node = std::move(refined_node);
2495 parent_mesh_node = this->
_deslag_mesh_node(lvl + 1, *parent_slag_node, ancestor, !is_base_layer);
2496 parent_coloring =
_unstructured_mesh ? this->_compute_unstructured_coloring(*parent_mesh_node)
2498 parent_layering =
_unstructured_mesh ? this->_compute_unstructured_layering(*parent_mesh_node)
2501 level_ptr ? level_ptr->element_layering : parent_layering);
2505 XASSERTM(ancestor.
parti_found,
"SlaggedDomainControl failed to find a valid partitioning");
2511 std::vector<int> neighbor_ranks;
2512 std::unique_ptr<MeshNodeType> patch_mesh_node(
2524 std::unique_ptr<MeshNodeType> patch_slag_node;
2529 std::map<int, int> halo_map;
2530 for(
auto& i : neighbor_ranks)
2535 patch_mesh_node->rename_halos(halo_map);
2542 for(
int i(1); i < ancestor.
num_parts; ++i)
2544 parent_mesh_node->create_patch_meshpart(ancestor.
parti_graph, i);
2561 XASSERTM(lvl == global_level_min,
"INTERNAL ERROR");
2590 if(ancestor.
layer >= 0)
2593 this->_layers.at(std::size_t(ancestor.
layer))->set_neighbor_ranks(neighbor_ranks);
2601 else if(parent_min_lvl < 0)
2607 this->
_chosen_levels.push_front(std::make_pair(parent_min_lvl, 0));
2612 std::shared_ptr<LevelType> level_ptr;
2617 this->push_level_front(
2619 std::make_shared<LevelType>(
2621 std::move(parent_mesh_node),
2622 std::move(parent_slag_node),
2623 std::move(parent_coloring),
2624 std::move(parent_layering)));
2628 parent_slag_node = std::move(patch_slag_node);
2629 parent_mesh_node = std::move(patch_mesh_node);
2630 parent_coloring = std::move(patch_coloring);
2631 parent_layering = std::move(patch_layering);
2637 int desired_level_max =
Math::max(this->
_ancestry.front().desired_level_max, lvl + 1);
2639 for(; lvl < desired_level_max; ++lvl)
2642 auto refined_node = parent_mesh_node->refine_unique(this->
_adapt_mode);
2645 std::shared_ptr<LevelType> level_ptr = std::make_shared<LevelType>(
2647 std::move(parent_mesh_node),
2648 std::move(parent_slag_node),
2649 std::move(parent_coloring),
2650 std::move(parent_layering));
2653 this->push_level_front(0, level_ptr);
2656 parent_slag_node = std::move(refined_node);
2658 parent_coloring =
_unstructured_mesh ? this->_compute_unstructured_coloring(*parent_mesh_node)
2661 ? this->_compute_unstructured_layering(*parent_mesh_node)
2669 this->push_level_front(
2671 std::make_shared<LevelType>(
2673 std::move(parent_mesh_node),
2674 std::move(parent_slag_node),
2675 std::move(parent_coloring),
2676 std::move(parent_layering)));
#define XABORTM(msg)
Abortion macro definition with custom message.
#define ASSERTM(expr, msg)
Debug-Assertion macro definition with custom message.
#define XASSERT(expr)
Assertion macro definition.
#define XASSERTM(expr, msg)
Assertion macro definition with custom message.
Coloring object implementation.
bool empty() const
Checks whether the coloring is empty.
Index * get_coloring()
Returns the coloring array.
Index get_num_colors() const
Returns the number of colors.
Adjacency Graph implementation.
Deslagging predicate based on a CGALWrapper.
CGALDeslaggingPredicate(const FEAT::String &file, Geometry::CGALFileMode file_mode)
Construct from filename.
CGALDeslaggingPredicate(const Dist::Comm &comm, const FEAT::String &file, Geometry::CGALFileMode file_mode)
Construct from filename.
void cheap_weight_calculation(bool enable)
Enable or disable cheap weight calculation.
CGALDeslaggingPredicate(std::unique_ptr< CGALWrapperType > &&cgal_wrapper)
Construct from existing wrapper.
std::vector< WeightType > gather_element_weights(const MeshType &mesh) const override
Gathers the element slag weights for a given mesh.
std::vector< Index > gather_elements(const MeshType &mesh, const Dist::Comm &comm) const override
Gather a vector of element indices that intersect the domain.
const CGALWrapperType & get_cgal_wrapper() const
const CGALWrapper accessor
std::vector< Index > gather_elements(const MeshType &mesh) const override
Gather a vector of element indices that intersect the domain.
CGALWrapperType & get_cgal_wrapper()
CGALWrapper accessor.
Hierarchical partitioned Slagged Domain Control.
DeslaggedDomainControl & operator=(DeslaggedDomainControl &&other)=default
Move-assignment.
const StopWatch & get_watch_hierarchy() const
Returns a const reference to the StopWatch that measures the base-mesh creation phase.
Adjacency::Coloring _compute_base_mesh_layering(const MeshNodeType &slag_node) const
Computes the element layering for the unpartitioned base mesh.
const StopWatch & get_watch_base_mesh() const
Returns a const reference to the StopWatch that measures the base-mesh creation phase.
virtual void create(Geometry::MeshFileReader &)
Creates a domain control from a MeshFileReader.
Adjacency::Coloring _compute_refined_mesh_layering(const MeshNodeType &slag_node, const Adjacency::Coloring &coarse_layering) const
Computes the layering for a refined mesh.
Adjacency::Coloring _compute_base_mesh_coloring(const MeshNodeType &slag_node) const
Computes the coloring for the unpartitioned base mesh.
virtual std::unique_ptr< MeshNodeType > _deslag_mesh_node(int lvl, MeshNodeType &mesh_node, const Ancestor &ancestor, bool is_child)
Deslaggs a (potentially partitioned) mesh node including its mesh-parts and halos.
std::vector< Index > _gather_masked_elements(const MeshType &mesh, const Dist::Comm &sibling_comm) const
Gather vector of elements that intersect the masked domain, synced across ranks.
DeslaggingPredicateType & get_deslagging_predicate()
Returns a reference to the internal slagging predicate.
virtual void create(const std::deque< String > &filenames, const String &dirpath="")
Creates a domain control from a list of filenames.
VertexType _bbox_min
the bounding box of the structured domain
int _deslag_lvl_min
Lowest level to deslag on. Inclusive.
DeslaggedDomainControl & operator=(const DeslaggedDomainControl &other)=delete
Deleted copy-assignment.
Adjacency::Coloring _extract_patch_coloring(const MeshNodeType &slag_node, const Adjacency::Coloring &parent_coloring, int child_rank) const
Extracts a patch coloring from the parent mesh coloring.
virtual void _deslag_patch_halos(MeshNodeType &patch_mesh_node, const MeshNodeType &base_mesh_node, const Ancestor &ancestor, bool is_child)
Deslags the halos of a patch mesh node.
bool _keep_deslagging_predicate
specifies whether to keep the slagging predicate after hierarchy creation
Geometry::RootMeshNode< MeshType > MeshNodeType
our root mesh node type
MeshNodeType & create_base_mesh_3d(Index num_x, Index num_y, Index num_z, CoordType x_min, CoordType x_max, CoordType y_min, CoordType y_max, CoordType z_min, CoordType z_max)
Creates a 3D structured cuboid base mesh and returns its base-mesh node.
typename MeshType::CoordType CoordType
coordinate type
int _deslag_lvl_max
Highest level to deslag on. Inclusive.
Adjacency::Coloring _extract_patch_layering(const MeshNodeType &slag_node, const Adjacency::Coloring &parent_layering, int child_rank) const
Extracts a patch layering from the parent mesh layering.
String dump_slag_layer_levels() const
Debugging function: Returns a string containing encoded slag layer level information.
DeslaggedDomainControl(const DeslaggedDomainControl &other)=delete
Deleted copy constructor.
virtual void _create_single_layered(std::unique_ptr< MeshNodeType > base_mesh_node)
Creates a single-layered mesh hierarchy.
DeslaggingPredicateBase< MeshType, WeightType > DeslaggingPredicateType
deslagging predicate type
void create_hierarchy()
Creates the domain level hierarchy.
StopWatch _watch_create_base_mesh
a bunch of stop-watches
void set_deslag_level_range(int min, int max)
Set the deslag level range.
const StopWatch & get_watch_voxel_map() const
Returns a const reference to the StopWatch that measures the voxel-map creation phase.
virtual void create(std::unique_ptr< MeshNodeType > &)
Creates a domain control from a base-mesh node.
void set_deslagging_predicate(std::unique_ptr< DeslaggingPredicateType > &&pred)
Setter for deslagging predicate.
virtual std::unique_ptr< MeshNodeType > _deslag_mesh_node(int lvl, MeshNodeType &mesh_node)
Deslags an unpartitioned mesh node including its mesh-parts.
virtual ~DeslaggedDomainControl()=default
virtual destructor
virtual void _create_single_process(std::unique_ptr< MeshNodeType > base_mesh_node)
Creates a single-layered mesh hierarchy for a single process.
virtual void _create_multi_layered(std::unique_ptr< MeshNodeType > base_mesh_node)
Creates a multi-layered mesh hierarchy.
const DeslaggingPredicateType & get_deslagging_predicate() const
Returns a const reference to the internal slagging predicate.
static constexpr int shape_dim
shape dimension
DeslaggedDomainControl(DeslaggedDomainControl &&other)=default
Move-constructor.
bool _unstructured_mesh
specifies whether we use a non voxel base mesh
std::unique_ptr< DeslaggingPredicateType > _deslagging_predicate
Predicate for deciding which parts of a mesh to keep and which to discard.
std::vector< WeightType > gather_element_weights(Index level) const
Gathers the element weights on a given domain level.
std::vector< Index > _gather_masked_elements(const MeshType &mesh)
Gather vector of elements that intersect the masked domain.
DeslaggedDomainControl(const Dist::Comm &comm_, bool support_multi_layered)
Constructor.
std::array< Index, shape_dim > _base_slices
number of element slices on base mesh level 0
Adjacency::Coloring _compute_refined_mesh_coloring(const MeshNodeType &slag_node) const
Computes the coloring for a refined mesh.
MeshNodeType & create_base_mesh_2d(Index num_x, Index num_y, CoordType x_min, CoordType x_max, CoordType y_min, CoordType y_max)
Creates a 2D structured rectangle base mesh and returns its base-mesh node.
std::unique_ptr< MeshNodeType > _base_mesh_node
the input base-mesh node on level 0
void keep_deslagging_predicate()
Instructs the domain controller to keep the slagging predicate after hierarchy creation.
typename MeshType::VertexType VertexType
vertex type
Wrapper class for domain levels for SlaggingDomainControl.
Adjacency::Coloring element_coloring
element coloring
std::shared_ptr< DomainLevel_ > slag_level
attachable slag level
Adjacency::Coloring element_layering
element layering (stored as coloring)
DomainLevel_ BaseClass
our base-class; the actual domain level
Abstract base class for deslagging predicates.
virtual std::vector< Index > gather_elements(const MeshType &mesh, const Dist::Comm &comm) const =0
Gather a vector of element indices that intersect the domain.
virtual std::vector< Index > gather_elements(const MeshType &mesh) const =0
Gather a vector of element indices that intersect the domain.
virtual std::vector< WeightType > gather_element_weights(const MeshType &mesh) const =0
Gathers the element slag weights for a given mesh.
bool _keep_base_levels
keep base-mesh levels on root process?
Dist::Comm progeny_comm
Progeny communicator.
int desired_level_max
the desired minimum and maximum refinement levels for this layer
int parti_level
the refinement level on which the patch is to be partitioned
String parti_info
a string containing some information about the chosen partitioning
bool parti_found
specifies whether a partitioning was found
int num_procs
the number of processes that participate in this layer
Adjacency::Graph parti_graph
this is the actual elements-at-rank partitioning graph
int progeny_group
Progeny group of this process.
int layer_p
the index of the parent layer or -1, if this process is not part of the parent layer
int layer
the index of the layer that this ancestor object belongs to
int num_parts
the number of partitions for each patch of the parent layer
int progeny_child
Which direct child this process belongs to in its progeny group.
Base-Class for Hierarchical Domain Control implementations.
std::deque< std::pair< int, int > > _desired_levels
desired level deque
int _required_elems_per_rank
required number of elements per rank for a-posteriori partitioning
std::deque< std::pair< int, int > > _chosen_levels
chosen level deque
virtual void _create_ancestry_scattered()
Creates the layers for a multi-layered domain control in a scattered fashion.
Real WeightType
weight type for partitioner element weights; always Real
std::deque< Ancestor > _ancestry
the partition ancestry deque
Geometry::RootMeshNode< MeshType > MeshNodeType
our root mesh node type
LevelType::PartType MeshPartType
our mesh-part type
virtual void _create_ancestry_single()
Creates the ancestry for a single layer (or a single process)
Geometry::AdaptMode _adapt_mode
the adapt mode for refinement
bool _was_created
specifies whether the domain control was already created
virtual bool _check_parti(Ancestor &ancestor, const MeshNodeType &mesh_node, bool is_base_layer)
Checks for an appropriate partitioning strategy.
bool _support_multi_layered
support multi-layered hierarchy?
virtual bool _apply_parti(Ancestor &ancestor, MeshNodeType &base_mesh_node)
Applies an a-posteriori partitioner.
virtual void _create_multi_layers_scattered()
Creates the layers for a multi-layered domain control in a scattered fashion.
virtual void _split_basemesh_halos(const Ancestor &ancestor, const MeshNodeType &base_mesh_node, MeshNodeType &patch_mesh_node, std::vector< int > &neighbor_ranks)
Splits the base-mesh halos and computes the inter-patch-mesh halos.
Deslagging predicate based on a VoxelMap.
void compute_from_off(const Dist::Comm &comm, std::istream &is, bool invert)
Computes the voxel map based on a surface triangulation stored in an OFF file.
std::vector< int > gather_vertex_voxel_map(const MeshType &mesh) const
Gathers the vertex voxel map on a given mesh.
VoxelMapDeslaggingPredicate(const VertexType &min, const VertexType &max, const Tiny::Vector< Index, dim > &slices, Index level)
Slice based constructor.
Geometry::VoxelMap & get_voxel_map()
VoxelMap accessor.
void set_out_of_bounds_value(bool value)
Sets the out-of-bounds value for the voxel map.
std::vector< WeightType > gather_element_weights(const MeshType &mesh) const override
std::vector< Index > gather_elements(const MeshType &mesh, const Dist::Comm &comm) const override
const Geometry::VoxelMap & get_voxel_map() const
VoxelMap accessor.
void compute_from_voxel_masker(const Dist::Comm &comm, Geometry::VoxelMasker< CoordType, dim > &masker)
Computes the voxel map based on a VoxelMasker object.
Geometry::VoxelMap::ReadResult read_voxel_map(const Dist::Comm &comm, const String &filename)
Reads the voxel map from a voxel map file.
VoxelMapDeslaggingPredicate(const VertexType &min, const VertexType &max, Real resolution)
Resolution based constructor.
void compute_from_off(const Dist::Comm &comm, const String &filename, bool invert)
Computes the voxel map based on a surface triangulation stored in an OFF file.
std::vector< Index > gather_elements(const MeshType &mesh) const override
Gather a vector of element indices that intersect the masked domain.
void compute_from_chart(const Dist::Comm &comm, const Geometry::Atlas::ChartBase< MeshType > &chart, bool invert)
Computes the voxel map based on a chart.
void compute_from_lambda(const Dist::Comm &comm, Lambda_ &&lambda)
Computes the voxel map based on a lambda expression.
Cubature Rule class template.
void bcast(void *buffer, std::size_t count, const Datatype &datatype, int root) const
Blocking broadcast.
void allreduce(const void *sendbuf, void *recvbuf, std::size_t count, const Datatype &datatype, const Operation &op) const
Blocking All-Reduce.
int size() const
Returns the size of this communicator.
Request irecv(void *buffer, std::size_t count, const Datatype &datatype, int source, int tag=0) const
Nonblocking Receive.
Request isend(const void *buffer, std::size_t count, const Datatype &datatype, int dest, int tag=0) const
Nonblocking Send.
Comm comm_dup() const
Creates a copy of this communicator.
void allgatherv(const void *sendbuf, std::size_t sendcount, const Datatype &sendtype, void *recvbuf, const int *recvcounts, const int *displs, const Datatype &recvtype) const
Blocking gather-to-all.
int rank() const
Returns the rank of this process in this communicator.
void allgather(const void *sendbuf, std::size_t sendcount, const Datatype &sendtype, void *recvbuf, std::size_t recvcount, const Datatype &recvtype) const
Blocking gather-to-all.
Communication Request vector class.
void wait_all()
Blocks until all active requests are fulfilled.
static void read_common(std::stringstream &stream, const String &filename, const Dist::Comm &comm, int root_rank=0)
Reads a common text file for all ranks.
Wrapper for the CGAL Library.
MeshType * get_mesh()
Returns the mesh of this node.
Class template for partial meshes.
Base-Mesh Patch Halo splitter.
std::unique_ptr< RootMeshNode > extract_patch(std::vector< Index > &&elements, bool split_meshparts, bool split_halos, bool split_patches)
Extracts a patch from the root mesh as a new mesh node.
const MeshPartType * get_patch(int rank) const
Returns a patch meshpart for a given child.
static std::unique_ptr< RootMeshNode > make_unique(std::unique_ptr< MeshType > mesh, MeshAtlasType *atlas=nullptr)
Creates a new RootMeshNode on the heap and returns a unique pointer to it.
const std::map< int, std::unique_ptr< MeshPartType > > & get_halo_map() const
void add_halo(int rank, std::unique_ptr< MeshPartType > halo_part)
Adds a halo mesh part to this mesh node.
Structured unit-cube mesh factory.
Index get_num_entities() const
Returns the number of entities.
helper class for read function result
Interface for voxel masker for the VoxelMap class.
Math Limits class template.
static double toe_partition
time of partitioning in seconds, needs initialization
double elapsed() const
Returns the total elapsed time in seconds.
void start()
Starts the stop-watch.
void stop()
Stops the stop-watch and increments elapsed time.
String class implementation.
String pad_front(size_type len, char c=' ') const
Pads the front of the string up to a desired length.
Tiny Vector class template.
Standard transformation mapping class template.
@ transpose
Render-Transpose mode.
@ injectify
Render-Injectified mode.
Domain control namespace.
const Operation op_min(MPI_MIN)
Operation wrapper for MPI_MIN.
const Operation op_max(MPI_MAX)
Operation wrapper for MPI_MAX.
void minimax(T_ x, T_ &a, T_ &b)
Updates the minimum and maximum.
T_ min(T_ a, T_ b)
Returns the minimum of two values.
T_ max(T_ a, T_ b)
Returns the maximum of two values.
double Real
Real data type.
String stringify(const T_ &item)
Converts an item into a String.
@ value
specifies whether the space should supply basis function values
int feat_omp_get_max_threads()
Returns the maximum number of omp threads.
std::uint64_t Index
Index data type.
TrafoTags
Trafo configuration tags enum.
@ img_point
specifies whether the trafo should supply image point coordinates
@ dom_point
specifies whether the trafo should supply domain point coordinates
@ jac_det
specifies whether the trafo should supply jacobian determinants