Skip to content

Commit

Permalink
removed warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
teseoch committed Oct 18, 2023
1 parent fb5d6e4 commit 2cccc3a
Show file tree
Hide file tree
Showing 18 changed files with 46 additions and 37 deletions.
2 changes: 0 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,6 @@ add_library(wildmeshing_toolkit)
add_library(wmtk::toolkit ALIAS wildmeshing_toolkit)
target_link_libraries(wildmeshing_toolkit PUBLIC wmtk_coverage_config)


set_property(TARGET wildmeshing_toolkit PROPERTY COMPILE_WARNING_AS_ERROR ON)
add_subdirectory(src)

# Group source files for IDEs
Expand Down
7 changes: 4 additions & 3 deletions src/wmtk/SimplicialComplex.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class SimplicialComplex

bool operator==(const SimplicialComplex& other) const;

SimplicialComplex& operator=(const SimplicialComplex&) = default;
// SimplicialComplex& operator=(const SimplicialComplex&) = default;

SimplicialComplex(const Mesh& mm)
: _slf(mm)
Expand Down Expand Up @@ -112,9 +112,10 @@ class SimplicialComplex
* @brief check if the intersection of simplices with their boundary is an empty set
*/
static bool simplices_w_boundary_intersect(const Mesh& m, const Simplex& s1, const Simplex& s2);

/**
* @brief get all the the top_simplex of m which is a coface of Simplex s, this function can be used in computing closed_star and open_star
* @brief get all the the top_simplex of m which is a coface of Simplex s, this function can be
* used in computing closed_star and open_star
*/
static SimplicialComplex top_coface_simplex(const Mesh& m, const Simplex& s);
/**
Expand Down
4 changes: 3 additions & 1 deletion src/wmtk/TetMesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,9 @@ Tuple TetMesh::switch_tuple(const Tuple& tuple, PrimitiveType type) const
assert(is_valid_slow(res));
return res;
}
default: return autogen::tet_mesh::local_switch_tuple(tuple, type);
case PrimitiveType::Vertex:
case PrimitiveType::Edge:
case PrimitiveType::Face: return autogen::tet_mesh::local_switch_tuple(tuple, type);
}
}

Expand Down
4 changes: 3 additions & 1 deletion src/wmtk/TriMesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,9 @@ Tuple TriMesh::switch_tuple(const Tuple& tuple, PrimitiveType type) const
assert(is_valid(res, hash_accessor));
return res;
}
default: return autogen::tri_mesh::local_switch_tuple(tuple, type);
case PrimitiveType::Vertex:
case PrimitiveType::Edge: return autogen::tri_mesh::local_switch_tuple(tuple, type);
case PrimitiveType::Tetrahedron: assert(false);
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/wmtk/TriMeshOperationExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ namespace wmtk {

auto TriMesh::TriMeshOperationExecutor::get_incident_face_data(Tuple t) -> IncidentFaceData
{
// / \
// / \
// ear1 / \ ear2
// / \
// / \
// / \
// / \
// X----t----

// make sure that edge and vertex of the tuple are the same
Expand Down
3 changes: 2 additions & 1 deletion src/wmtk/attribute/AttributeScopeStack.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ struct AttributeManager;


template <typename T>
struct AttributeScopeStack
class AttributeScopeStack
{
public:
// stack is implemented by a parent pointing graph, so we track a pointer
// to the leaf
AttributeScopeStack();
Expand Down
3 changes: 2 additions & 1 deletion src/wmtk/attribute/PerThreadAttributeScopeStacks.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
namespace wmtk::attribute {

template <typename T>
struct PerThreadAttributeScopeStacks
class PerThreadAttributeScopeStacks
{
public:
AttributeScopeStack<T>& local() { return m_stacks.local(); }
const AttributeScopeStack<T>& local() const { return m_stacks.local(); }
mutable tbb::enumerable_thread_specific<AttributeScopeStack<T>> m_stacks;
Expand Down
2 changes: 1 addition & 1 deletion src/wmtk/operations/Operation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class InvariantCollection;

namespace operations {
template <typename T>
struct OperationSettings
class OperationSettings
{
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ VertexAttributesUpdateBase::VertexAttributesUpdateBase(
const OperationSettings<VertexAttributesUpdateBase>& settings)
: TriMeshOperation(m)
, TupleOperation(settings.invariants, t)
, m_settings{settings}
//, m_settings(settings)
{}

std::string VertexAttributesUpdateBase::name() const
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class VertexAttributesUpdateBase : public TriMeshOperation, protected TupleOpera

private:
Tuple m_output_tuple;
const OperationSettings<VertexAttributesUpdateBase>& m_settings;
// const OperationSettings<VertexAttributesUpdateBase>& m_settings;
};

} // namespace tri_mesh
Expand Down
17 changes: 9 additions & 8 deletions src/wmtk/simplex/top_level_cofaces.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ namespace wmtk::simplex {
namespace {


std::vector<Tuple> top_level_cofaces_tuples_vertex(const TriMesh& mesh, const Tuple& t)
std::vector<Tuple> top_level_cofaces_tuples_vertex(const TriMesh& mesh, const Tuple& t_in)
{
std::vector<Tuple> collection;

std::set<Tuple, wmtk::utils::TupleCellLessThan> touched_cells;
std::queue<Tuple> q;
q.push(t);
q.push(t_in);
while (!q.empty()) {
const Tuple t = q.front();
q.pop();
Expand Down Expand Up @@ -60,12 +60,12 @@ std::vector<Tuple> top_level_cofaces_tuples_face(const TriMesh& mesh, const Tupl
return {t};
}

std::vector<Tuple> top_level_cofaces_tuples_vertex(const TetMesh& mesh, const Tuple& t)
std::vector<Tuple> top_level_cofaces_tuples_vertex(const TetMesh& mesh, const Tuple& t_in)
{
std::vector<Tuple> collection;
std::set<Tuple, wmtk::utils::TupleCellLessThan> touched_cells;
std::queue<Tuple> q;
q.push(t);
q.push(t_in);
while (!q.empty()) {
const Tuple t = q.front();
q.pop();
Expand Down Expand Up @@ -96,12 +96,12 @@ std::vector<Tuple> top_level_cofaces_tuples_vertex(const TetMesh& mesh, const Tu
}
return collection;
}
std::vector<Tuple> top_level_cofaces_tuples_edge(const TetMesh& mesh, const Tuple& t)
std::vector<Tuple> top_level_cofaces_tuples_edge(const TetMesh& mesh, const Tuple& t_in)
{
std::vector<Tuple> collection;
std::set<Tuple, wmtk::utils::TupleCellLessThan> touched_cells;
std::queue<Tuple> q;
q.push(t);
q.push(t_in);
while (!q.empty()) {
const Tuple t = q.front();
q.pop();
Expand Down Expand Up @@ -163,7 +163,7 @@ std::vector<Tuple> top_level_cofaces_tuples(const TriMesh& mesh, const Simplex&
collection = top_level_cofaces_tuples_face(mesh, simplex.tuple());
break;
}
default: assert(false); break;
case PrimitiveType::Tetrahedron: assert(false); break;
}


Expand Down Expand Up @@ -205,7 +205,8 @@ std::vector<Tuple> top_level_cofaces_tuples(const Mesh& mesh, const Simplex& sim
return top_level_cofaces_tuples(static_cast<const TriMesh&>(mesh), simplex);
case PrimitiveType::Tetrahedron:
return top_level_cofaces_tuples(static_cast<const TetMesh&>(mesh), simplex);
default: assert(false); throw "unknown mesh type in top_level_cofaces_tuples";
case PrimitiveType::Vertex:
case PrimitiveType::Edge: assert(false); throw "unknown mesh type in top_level_cofaces_tuples";
}
}

Expand Down
15 changes: 9 additions & 6 deletions src/wmtk/utils/TupleCellLessThanFunctor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@
#include <wmtk/Tuple.hpp>

namespace wmtk::utils {
struct TupleCellLessThan {
bool operator()(const Tuple& a, const Tuple& b) const {
return a.m_global_cid < b.m_global_cid;
}
};
}
class TupleCellLessThan
{
public:
bool operator()(const Tuple& a, const Tuple& b) const
{
return a.m_global_cid < b.m_global_cid;
}
};
} // namespace wmtk::utils
5 changes: 3 additions & 2 deletions src/wmtk/utils/TupleInspector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@

namespace wmtk::utils {
// NOTE: this is just for helping with autogen accessing tuple intenrals. DO NOT USE ELSEWHERE
struct TupleInspector
class TupleInspector
{
public:
static long local_vid(const Tuple& t) { return t.m_local_vid; }
static long local_eid(const Tuple& t) { return t.m_local_eid; }
static long local_fid(const Tuple& t) { return t.m_local_fid; }

static long global_cid(const Tuple& t) { return t.m_global_cid; }
static long hash(const Tuple& t) { return t.m_hash; }
};
} // namespace wmtk::autogen::utils
} // namespace wmtk::utils
2 changes: 1 addition & 1 deletion tests/components/test_component_isotropic_remeshing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ TEST_CASE("smoothing_simple_examples", "[components][isotropic_remeshing][2D]")
for (size_t i = 0; i < 10; ++i) {
scheduler.run_operation_on_all(PrimitiveType::Vertex, "vertex_smooth");
v4 = mesh.tuple_from_id(PrimitiveType::Vertex, 4);
Eigen::Vector3d p4_after_smooth = pos.vector_attribute(v4);
/*Eigen::Vector3d p4_after_smooth =*/pos.vector_attribute(v4);
}

Eigen::Vector3d p4_after_smooth = pos.vector_attribute(v4);
Expand Down
2 changes: 1 addition & 1 deletion tests/test_2d_operation_construction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ namespace {

constexpr PrimitiveType PV = PrimitiveType::Vertex;
constexpr PrimitiveType PE = PrimitiveType::Edge;
constexpr PrimitiveType PF = PrimitiveType::Face;
// constexpr PrimitiveType PF = PrimitiveType::Face;

// because TriMesh::split_edge isn'ta waare of preconditions we need to tell the system whether
// something should succeed
Expand Down
1 change: 0 additions & 1 deletion tests/test_3d_operations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ using TMOE = decltype(std::declval<DEBUG_TetMesh>().get_tmoe(
wmtk::Tuple(),
std::declval<Accessor<long>&>()));

constexpr PrimitiveType PV = PrimitiveType::Vertex;
constexpr PrimitiveType PE = PrimitiveType::Edge;
constexpr PrimitiveType PF = PrimitiveType::Face;
constexpr PrimitiveType PT = PrimitiveType::Tetrahedron;
Expand Down
4 changes: 2 additions & 2 deletions tests/test_multi_mesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ TEST_CASE("test_register_child_mesh", "[multimesh][2D]")

// test id computation
REQUIRE(parent.absolute_multi_mesh_id().empty());
REQUIRE(child0.absolute_multi_mesh_id() == std::vector<long>{{0}});
REQUIRE(child1.absolute_multi_mesh_id() == std::vector<long>{{1}});
REQUIRE(child0.absolute_multi_mesh_id() == std::vector<long>{0});
REQUIRE(child1.absolute_multi_mesh_id() == std::vector<long>{1});

// test attribute contents
{
Expand Down
2 changes: 1 addition & 1 deletion tests/test_simplex_collection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ using namespace simplex;
constexpr PrimitiveType PV = PrimitiveType::Vertex;
constexpr PrimitiveType PE = PrimitiveType::Edge;
constexpr PrimitiveType PF = PrimitiveType::Face;
constexpr PrimitiveType PT = PrimitiveType::Tetrahedron;
// constexpr PrimitiveType PT = PrimitiveType::Tetrahedron;
namespace {
template <typename MeshType> // use a DEBUG mesh type
void check_match_below_simplex_type(const MeshType& mesh, const Simplex& a, const Simplex& b)
Expand Down

0 comments on commit 2cccc3a

Please sign in to comment.