Skip to content

Commit 9d9d843

Browse files
committed
Remove TupleInspector and other files that are not used anymore.
1 parent efb0c29 commit 9d9d843

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+183
-434
lines changed

components/tests/test_component_isotropic_remeshing.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
#include <nlohmann/json.hpp>
33
#include <tools/DEBUG_EdgeMesh.hpp>
44
#include <tools/DEBUG_TriMesh.hpp>
5-
#include <tools/DEBUG_Tuple.hpp>
65
#include <tools/EdgeMesh_examples.hpp>
76
#include <tools/TriMesh_examples.hpp>
87
#include <wmtk/Scheduler.hpp>

src/wmtk/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ set(SRC_FILES
2828
Primitive.cpp
2929
Tuple.hxx
3030
Tuple.hpp
31+
Tuple.cpp
3132
Types.hpp
3233
Scheduler.hpp
3334
Scheduler.cpp

src/wmtk/EdgeMesh.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,18 +51,18 @@ class EdgeMesh : public MeshCRTP<EdgeMesh>
5151
std::vector<std::vector<TypedAttributeHandle<int64_t>>> connectivity_attributes()
5252
const override;
5353

54+
5455
Tuple switch_vertex(const Tuple& tuple) const;
5556
Tuple switch_edge(const Tuple& tuple) const;
5657

5758
std::vector<Tuple> orient_vertices(const Tuple& tuple) const override;
58-
59-
protected:
6059
int64_t id(const Tuple& tuple, PrimitiveType type) const;
6160
using MeshCRTP<EdgeMesh>::id; // getting the (simplex) prototype
6261

6362
int64_t id_vertex(const Tuple& tuple) const { return id(tuple, PrimitiveType::Vertex); }
6463
int64_t id_edge(const Tuple& tuple) const { return id(tuple, PrimitiveType::Edge); }
6564

65+
protected:
6666
/**
6767
* @brief internal function that returns the tuple of requested type, and has the global index
6868
* cid

src/wmtk/PointMesh.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ class PointMesh : public MeshCRTP<PointMesh>
4343

4444
std::vector<Tuple> orient_vertices(const Tuple& tuple) const override;
4545

46-
protected:
4746
using MeshCRTP<PointMesh>::id; // getting the (simplex) prototype
4847
int64_t id(const Tuple& tuple, PrimitiveType type) const;
4948

49+
protected:
5050
/**
5151
* @brief internal function that returns the tuple of requested type, and has the global index
5252
* cid

src/wmtk/TetMesh.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,6 @@ class TetMesh : public MeshCRTP<TetMesh>
6161
std::vector<Tuple> orient_vertices(const Tuple& t) const override;
6262

6363

64-
protected:
65-
void make_cached_accessors();
6664
int64_t id(const Tuple& tuple, PrimitiveType type) const;
6765
using MeshCRTP<TetMesh>::id; // getting the (simplex) prototype
6866

@@ -72,6 +70,8 @@ class TetMesh : public MeshCRTP<TetMesh>
7270
int64_t id_face(const Tuple& tuple) const { return id(tuple, PrimitiveType::Triangle); }
7371
int64_t id_tet(const Tuple& tuple) const { return id(tuple, PrimitiveType::Tetrahedron); }
7472

73+
protected:
74+
void make_cached_accessors();
7575
/**
7676
* @brief internal function that returns the tuple of requested type, and has the global index
7777
* cid

src/wmtk/TetMeshOperationExecutor.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#include <wmtk/simplex/top_dimension_cofaces.hpp>
1111
#include <wmtk/simplex/top_dimension_cofaces_iterable.hpp>
1212
#include <wmtk/utils/Logger.hpp>
13-
#include <wmtk/utils/TupleInspector.hpp>
1413

1514
namespace wmtk {
1615
namespace {

src/wmtk/TriMesh.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,14 @@ class TriMesh : public MeshCRTP<TriMesh>
6767

6868
std::vector<Tuple> orient_vertices(const Tuple& t) const override;
6969

70-
protected:
7170
int64_t id(const Tuple& tuple, PrimitiveType type) const;
7271
using MeshCRTP<TriMesh>::id; // getting the (simplex) prototype
7372

7473
int64_t id_vertex(const Tuple& tuple) const { return id(tuple, PrimitiveType::Vertex); }
7574
int64_t id_edge(const Tuple& tuple) const { return id(tuple, PrimitiveType::Edge); }
7675
int64_t id_face(const Tuple& tuple) const { return id(tuple, PrimitiveType::Triangle); }
7776

77+
protected:
7878
/**
7979
* @brief internal function that returns the tuple of requested type, and has the global index
8080
* cid

src/wmtk/Tuple.cpp

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#include "Tuple.hpp"
2+
3+
#include <fmt/format.h>
4+
5+
namespace wmtk {
6+
7+
std::string Tuple::as_string() const
8+
{
9+
return fmt::format(
10+
"(gid {} : lids[v{},e{},f{}])",
11+
global_cid(),
12+
local_vid(),
13+
local_eid(),
14+
local_fid());
15+
}
16+
17+
Tuple::operator std::string() const
18+
{
19+
return as_string();
20+
}
21+
22+
std::ostream& operator<<(std::ostream& os, const Tuple& t)
23+
{
24+
os << t.as_string();
25+
return os;
26+
}
27+
28+
} // namespace wmtk

src/wmtk/Tuple.hpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22

33
#include <array>
44
#include <cstdint>
5+
#include <iostream>
6+
#include <string>
57
#include <tuple>
8+
#include <wmtk/PrimitiveType.hpp>
69

710
namespace wmtk {
811

@@ -53,7 +56,16 @@ class Tuple
5356
int8_t local_vid() const;
5457
int8_t local_eid() const;
5558
int8_t local_fid() const;
59+
60+
int8_t local_id(const PrimitiveType pt) const;
61+
62+
std::string as_string() const;
63+
explicit operator std::string() const;
64+
65+
friend std::ostream& operator<<(std::ostream& os, const Tuple& t);
5666
};
5767

68+
std::ostream& operator<<(std::ostream& os, const Tuple& t);
69+
5870
} // namespace wmtk
5971
#include "Tuple.hxx"

src/wmtk/Tuple.hxx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
#include "Tuple.hpp"
2+
3+
#include <cassert>
4+
15
namespace wmtk {
26

37
// v2
@@ -60,4 +64,16 @@ inline int8_t Tuple::local_fid() const
6064
return m_local_fid;
6165
}
6266

67+
inline int8_t Tuple::local_id(const PrimitiveType pt) const
68+
{
69+
switch (pt) {
70+
case PrimitiveType::Vertex: return local_vid();
71+
case PrimitiveType::Edge: return local_eid();
72+
case PrimitiveType::Triangle: return local_fid();
73+
case PrimitiveType::Tetrahedron:
74+
default: assert(false);
75+
}
76+
return -1;
77+
}
78+
6379
} // namespace wmtk

0 commit comments

Comments
 (0)