Skip to content

Commit

Permalink
update builds
Browse files Browse the repository at this point in the history
  • Loading branch information
mtao committed Oct 7, 2023
1 parent db8049b commit b59cf8a
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 40 deletions.
2 changes: 2 additions & 0 deletions src/wmtk/multimesh/MultiMeshVisitor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class MultiMeshVisitor
execute_PT<PrimitiveType::Tetrahedron>(mesh, simplex);
break;
}
default: throw "notimplemented"; break;
}
}

Expand Down Expand Up @@ -133,6 +134,7 @@ class MultiMeshVisitor
child_simplex);
break;
}
default: throw "notimplemented";
}
}
}
Expand Down
5 changes: 5 additions & 0 deletions src/wmtk/operations/Operation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,15 @@ template <typename T>
struct OperationSettings
{
};
namespace utils {
class MultiMeshEdgeSplitFunctor;

}

class Operation
{
public:
friend class MultiMeshEdgeSplitFunctor;
// main entry point of the operator by the scheduler
bool operator()();
virtual std::string name() const = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@
namespace wmtk::operations::utils {
void UpdateEdgeOperationMultiMeshMapFunctor::operator()(
TriMesh& parent_mesh,
const TriMeshOperationExecutor& parent_tmoe,
const tri_mesh::EdgeOperationData& parent_tmoe,
TriMesh& child_mesh,
const TriMeshOperationExecutor& child_tmoe)
const tri_mesh::EdgeOperationData& child_tmoe) const
{
/*
const auto& parent_incident_data = parent_tmoe.incident_face_datas();
const auto& child_incident_data = child_tmoe.incident_face_datas();
Expand All @@ -29,7 +30,7 @@ void UpdateEdgeOperationMultiMeshMapFunctor::operator()(
auto child_to_parent_accessor = child_mesh.create_accessor(child_to_parent_handle);
auto parent_to_child_accessor = my_mesh.create_accessor(parent_to_child_handle);
using IncidentData = TriMeshOperationExecutor::IncidentFaceData;
using IncidentData = tri_mesh::EdgeOperationData::IncidentFaceData;
auto update_from_incident_data = [&](const IncidentData& parent_data,
const IncidentData& child_data) {
const auto child_split_f = child_data.split_f;
Expand Down Expand Up @@ -62,5 +63,6 @@ void UpdateEdgeOperationMultiMeshMapFunctor::operator()(
// update_hash on neighboring cells
update_hash_in_map(child_mesh);
*/
}
} // namespace wmtk::operations::utils
Original file line number Diff line number Diff line change
Expand Up @@ -8,34 +8,40 @@ class EdgeMesh;
class TriMesh;
class TetMesh;

namespace operations {
class EdgeMeshOperationExecutor;
class TriMeshOperationExecutor;
class TetMeshOperationExecutor;
namespace tri_mesh {
class EdgeOperationData;
}
namespace tet_mesh {
class EdgeOperationData;
}
} // namespace operations

namespace operations::utils {

struct UpdateEdgeOperationMultiMeshMapFunctor
{
void operator()(
TriMesh& parent_mesh,
const TriMeshOperationExecutor& parent_tmoe,
const tri_mesh::EdgeOperationData& parent_tmoe,
TriMesh& child_mesh,
const TriMeshOperationExecutor& child_tmoe);
const tri_mesh::EdgeOperationData& child_tmoe) const;
void operator()(
EdgeMesh&,
const EdgeMeshOperationExecutor&,
EdgeMesh&,
EdgeMeshOperationExecutor&) const;
const EdgeMeshOperationExecutor&) const;
void operator()(
TriMesh&,
const TriMeshOperationExecutor&,
const tri_mesh::EdgeOperationData&,
EdgeMesh&,
const EdgeMeshOperationExecutor&) const;
void operator()(
TetMesh&,
const TetMeshOperationExecutor&,
const tet_mesh::EdgeOperationData&,
TriMesh&,
const TriMeshOperationExecutor&) const;
const tri_mesh::EdgeOperationData&) const;
};
} // namespace operations::utils
} // namespace wmtk
35 changes: 10 additions & 25 deletions src/wmtk/operations/utils/multi_mesh_edge_split.cpp
Original file line number Diff line number Diff line change
@@ -1,38 +1,23 @@

#include <wmtk/TetMeshOperationExecutor.hpp>
#include <wmtk/TriMeshOperationExecutor.hpp>
#include "multi_mesh_edge_split.hpp"
#include <wmtk/invariants/InvariantCollection.hpp>
#include <wmtk/multimesh/MultiMeshVisitor.hpp>
#include <wmtk/operations/utils/MultiMeshEdgeSplitFunctor.hpp>
#include <wmtk/operations/utils/UpdateEdgeOperationMultiMeshMapFunctor.hpp>
#include <wmtk/utils/mesh_type_from_primitive_type.hpp>

#include <wmtk/TriMesh.hpp>

namespace wmtk::operations::utils {
namespace {

struct EdgeSplitFunctor
std::shared_ptr<InvariantCollection> multimesh_edge_split_invariants(const Mesh& m)
{
void operator()(const Mesh&, const Simplex&) const { throw "Unimplemented!"; }
TriMesh::TriMeshOperationExecutor operator()(const TriMesh& m, const Simplex& s) const
{
Accessor<long> hash_accessor = m.get_cell_hash_accessor();
TriMesh::TriMeshOperationExecutor exec(m, t, hash_accessor);
exec.split_edge();
return exec;
}
TetMeshOperationExecutor operator()(const TetMesh& m, const Simplex& s) const
{
Accessor<long> hash_accessor = m.get_cell_hash_accessor();
TetMesh::TetMeshOperationExecutor exec(m, t, hash_accessor);
exec.split_edge();
return exec;
}
};

return std::make_shared<InvariantCollection>();
}

void multi_mesh_split_edge(Mesh& mesh, const Tuple& t);
void multi_mesh_edge_split(Mesh& mesh, const Tuple& t)
{
multimesh::MultiMeshVisitor visitor(
EdgeSplitFunctor{},
MultiMeshEdgeSplitFunctor{},
UpdateEdgeOperationMultiMeshMapFunctor{});
visitor.execute_from_root(mesh, Simplex(PrimitiveType::Edge, t));
}
} // namespace wmtk::operations::utils
9 changes: 5 additions & 4 deletions src/wmtk/operations/utils/multi_mesh_edge_split.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,18 @@
#include <memory>

namespace wmtk {
class Mesh;
class Tuple;

namespace invariants {
class InvariantCollection;
}
namespace operations::utils {


// Initializes any invariants for splitting (which is None by default, but enabling a pattern
// with other operations)
std::shared_ptr<InvariantCollection> multimesh_split_edge_invariants(const Mesh& m);
void multi_mesh_split_edge(Mesh& mesh, const Tuple& t);
std::shared_ptr<InvariantCollection> multimesh_edge_split_invariants(const Mesh& m);

void multi_mesh_edge_split(Mesh& mesh, const Tuple& t);


} // namespace operations::utils
Expand Down

0 comments on commit b59cf8a

Please sign in to comment.