-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #418 from mtao/mtao/autogen_tests
adding some unit tests for autogen
- Loading branch information
Showing
16 changed files
with
392 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#include "is_ccw.hpp" | ||
#include <wmtk/Tuple.hpp> | ||
#include <wmtk/autogen/tet_mesh/is_ccw.hpp> | ||
#include <wmtk/autogen/tri_mesh/is_ccw.hpp> | ||
namespace wmtk::autogen { | ||
bool is_ccw(PrimitiveType pt, const Tuple& t) | ||
{ | ||
switch (pt) { | ||
case PrimitiveType::Face: return tri_mesh::is_ccw(t); | ||
case PrimitiveType::Tetrahedron: return tet_mesh::is_ccw(t); | ||
case PrimitiveType::Vertex: | ||
case PrimitiveType::Edge: | ||
default: throw "notimplemented"; | ||
} | ||
return false; | ||
} | ||
|
||
// validates whether the tuple local ids are valid for computing ccw'ness | ||
bool tuple_is_valid_for_ccw(PrimitiveType pt, const Tuple& t) | ||
{ | ||
switch (pt) { | ||
case PrimitiveType::Face: return tri_mesh::tuple_is_valid_for_ccw(t); | ||
case PrimitiveType::Tetrahedron: return tet_mesh::tuple_is_valid_for_ccw(t); | ||
case PrimitiveType::Vertex: | ||
case PrimitiveType::Edge: | ||
default: throw "notimplemented"; | ||
} | ||
return false; | ||
} | ||
} // namespace wmtk::autogen |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#pragma once | ||
#include <wmtk/Primitive.hpp> | ||
|
||
namespace wmtk { | ||
class Tuple; | ||
} | ||
|
||
// NOTE: this header primarily exists to simplify unit testing, not really for use | ||
namespace wmtk::autogen { | ||
bool is_ccw(PrimitiveType ptype, const Tuple& t); | ||
|
||
// validates whether the tuple local ids are valid for computing ccw'ness | ||
bool tuple_is_valid_for_ccw(PrimitiveType ptype, const Tuple& t); | ||
} // namespace wmtk::autogen |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#include "local_switch_tuple.hpp" | ||
#include <wmtk/autogen/tet_mesh/local_switch_tuple.hpp> | ||
#include <wmtk/autogen/tri_mesh/local_switch_tuple.hpp> | ||
namespace wmtk::autogen { | ||
Tuple local_switch_tuple(PrimitiveType mesh_type, const Tuple& t, PrimitiveType pt) | ||
{ | ||
switch (mesh_type) { | ||
case PrimitiveType::Face: return tri_mesh::local_switch_tuple(t, pt); | ||
case PrimitiveType::Tetrahedron: return tet_mesh::local_switch_tuple(t, pt); | ||
case PrimitiveType::Vertex: | ||
case PrimitiveType::Edge: throw "notimplemented"; | ||
} | ||
return Tuple(); | ||
} | ||
} // namespace wmtk::autogen |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
|
||
#pragma once | ||
#include <wmtk/Primitive.hpp> | ||
#include <wmtk/Tuple.hpp> | ||
|
||
// NOTE: this header primarily exists to simplify unit testing, not really for use | ||
namespace wmtk::autogen { | ||
Tuple local_switch_tuple(PrimitiveType mesh_type, const Tuple& t, PrimitiveType pt); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
#pragma once | ||
#include <array> | ||
#include <wmtk/Tuple.hpp> | ||
|
||
|
||
namespace wmtk::autogen::tet_mesh { | ||
// computes the offset of a tuple's local ids in the tables | ||
long local_id_table_offset(const Tuple& t); | ||
|
||
// returns a lvid/leid/lfid associated iwth a particular tuple offset | ||
std::array<long, 3> lvid_leid_lfid_from_table_offset(long table_offset); | ||
|
||
} // namespace wmtk::autogen::tet_mesh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
#pragma once | ||
#include <wmtk/Primitive.hpp> | ||
#include <wmtk/Tuple.hpp> | ||
|
||
namespace wmtk::autogen::tet_mesh { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,14 @@ | ||
#pragma once | ||
#include <array> | ||
#include <wmtk/Tuple.hpp> | ||
|
||
|
||
namespace wmtk::autogen::tri_mesh { | ||
// computes the offset of a tuple's local ids in the tables | ||
long local_id_table_offset(const Tuple& t); | ||
|
||
// returns a lvid/leid associated iwth a particular tuple offset | ||
std::array<long, 2> lvid_leid_from_table_offset(long table_offset); | ||
|
||
} // namespace wmtk::autogen::tri_mesh | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
#pragma once | ||
#include <wmtk/Primitive.hpp> | ||
#include <wmtk/Tuple.hpp> | ||
|
||
namespace wmtk::autogen::tri_mesh { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.