16 namespace components {
22 using TagVec = std::vector<std::tuple<attribute::MeshAttributeHandle, int64_t>>;
23 using AttrVec = std::vector<attribute::MeshAttributeHandle>;
34 input_tags.emplace_back(std::make_tuple(handle, value));
44 input_tags.emplace_back(std::make_tuple(handle, value));
54 input_tags.emplace_back(std::make_tuple(handle, value));
64 input_tags.emplace_back(std::make_tuple(handle, value));
77 output_tags.emplace_back(std::make_tuple(handle, value));
87 output_tags.emplace_back(std::make_tuple(handle, value));
97 output_tags.emplace_back(std::make_tuple(handle, value));
107 output_tags.emplace_back(std::make_tuple(handle, value));
112 return std::make_tuple(input_tags, output_tags, pass_through_attributes);
123 Mesh& mesh =
static_cast<Mesh&
>(*mesh_in);
125 auto [input_tags, output_tags, pass_through_attributes] =
130 std::vector<attribute::MeshAttributeHandle> keeps = pass_through_attributes;
131 for (
const auto& [h, v] : input_tags) {
132 keeps.emplace_back(h);
134 for (
const auto& [h, v] : output_tags) {
135 keeps.emplace_back(h);
140 std::tie(input_tags, output_tags, pass_through_attributes) =
143 switch (mesh_in->top_simplex_type()) {
158 "Works only for faces and tetrahedrons, error-type: {}",
159 mesh_in->top_simplex_type());
void clear_attributes(const std::vector< attribute::MeshAttributeHandle::HandleVariant > &keep_attributes)
Remove all custom attributes besides the one passed in.
attribute::MeshAttributeHandle get_attribute_handle(const std::string &name, const PrimitiveType ptype) const
void write_mesh(const Mesh &m, const std::string &name, const std::map< std::string, std::vector< int64_t >> &multimesh_names={})
Write a mesh to cache.
std::shared_ptr< Mesh > read_mesh(const std::string &name) const
Load a mesh from cache.
std::vector< attribute::MeshAttributeHandle > get_attributes(const Mesh &m, const nlohmann::json &attribute_names)
auto gather_attributes(io::Cache &cache, Mesh &mesh, const internal::RegularSpaceOptions &options)
void tag_intersection(const utils::Paths &paths, const nlohmann::json &j, io::Cache &cache)
void log_and_throw_error(const std::string &msg)
std::vector< std::string > edge_labels
std::vector< std::string > vertex_labels
std::vector< std::string > face_labels
std::vector< std::string > tetrahedron_labels
TagIntersectionAttributes attributes
TagIntersectionAttributes output_attributes
TagIntersectionValues output_values
std::vector< std::string > pass_through
TagIntersectionValues values
std::vector< int64_t > edge_values
std::vector< int64_t > face_values
std::vector< int64_t > tetrahedron_values
std::vector< int64_t > vertex_values