Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create a class for mixed mesh support #82

Merged
merged 35 commits into from
Feb 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
7c28c9a
wip
cwsmith Jan 19, 2024
15cb9ed
refactor: move mixed functions to mixed mesh class
cwsmith Jan 22, 2024
8f516c0
restore rc func
cwsmith Jan 22, 2024
e03fff4
disable mixed tests for now
cwsmith Jan 22, 2024
d741e2e
move mixed mesh funcs to Omega_h_mixedMesh.cpp
cwsmith Jan 22, 2024
0c8a413
remove unused mixed function: classify_equal_order
cwsmith Jan 22, 2024
3978cc4
compiles... does not link
cwsmith Jan 22, 2024
61b05ed
compiles, links, all enabled tests pass
cwsmith Jan 22, 2024
b7d7e7d
mixed is always enabled
cwsmith Jan 22, 2024
9cd4b40
wip: compiling with sim on
cwsmith Jan 22, 2024
dfe8166
wip: refactor meshsim reading
cwsmith Jan 23, 2024
a57ed19
wip: compiles
cwsmith Jan 23, 2024
e19ab9d
wip: edge reader
cwsmith Jan 23, 2024
7a92506
wip: face reader
cwsmith Jan 23, 2024
e83ac68
wip: add isMixed
cwsmith Jan 23, 2024
da69014
read regions
cwsmith Jan 23, 2024
a55d0f8
clean up edges and verts
cwsmith Jan 23, 2024
6b48065
call mixed or mono
cwsmith Jan 23, 2024
16891f9
set type counts
cwsmith Jan 23, 2024
01f7a7c
init ent counts
cwsmith Jan 23, 2024
832b68b
fix bugs and typos
cwsmith Jan 23, 2024
d0d294a
face reading cleanup
cwsmith Jan 23, 2024
4186b89
incorrect reader
cwsmith Jan 24, 2024
744a75e
missed adj
cwsmith Jan 24, 2024
b805a22
typo
cwsmith Jan 24, 2024
bd8b725
missed another adj
cwsmith Jan 24, 2024
7896174
remove broken test #81
cwsmith Jan 24, 2024
1864aec
update the d3d gold meshes
cwsmith Jan 24, 2024
2308f14
helper function for setting ent-to-vtxId
cwsmith Jan 25, 2024
b1fdc13
remove extra copy
cwsmith Jan 25, 2024
5613f79
remove model2d files
cwsmith Jan 25, 2024
2fd19f3
mixedmesh does not inherit from mesh
cwsmith Feb 2, 2024
2bc7ded
mixed_test: write vtu files
cwsmith Feb 2, 2024
625e170
wrong file extension
cwsmith Feb 2, 2024
6820949
mixed_test: remove vtu writing
cwsmith Feb 2, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified meshes/d3d/d3d-coreMesh-gold.osh/0.osh
Binary file not shown.
Binary file modified meshes/d3d/d3d-coreMesh-numbered-gold.osh/0.osh
Binary file not shown.
7 changes: 2 additions & 5 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ set(Omega_h_SOURCES
Omega_h_math_lang.cpp
Omega_h_matrix.cpp
Omega_h_mesh.cpp
Omega_h_mixedMesh.cpp
Omega_h_rcFields.cpp
Omega_h_metric.cpp
Omega_h_metric_input.cpp
Expand Down Expand Up @@ -413,11 +414,6 @@ function(test_func_impl TEST_NAME NUM_PROCS)
${CMAKE_SOURCE_DIR}/meshes)

osh_add_exe(periodic_test)
set(TEST_EXES ${TEST_EXES} periodic_test)
test_func(periodic_test 2 ./periodic_test
${CMAKE_SOURCE_DIR}/meshes/wedge_matchZ_12elem.sms
${CMAKE_SOURCE_DIR}/meshes/wedge_match.smd
${CMAKE_SOURCE_DIR}/meshes/wedge_matchZ_12elem_sync_2.osh 2)
endif()

test_basefunc(run_arrayops 1 ./arrayops_test)
Expand Down Expand Up @@ -636,6 +632,7 @@ set(Omega_h_HEADERS
Omega_h_math_lang.hpp
Omega_h_matrix.hpp
Omega_h_mesh.hpp
Omega_h_mixedMesh.hpp
Omega_h_metric.hpp
Omega_h_mpi.h
Omega_h_owners.hpp
Expand Down
28 changes: 0 additions & 28 deletions src/Omega_h_class.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,32 +190,4 @@ void classify_equal_order(
mesh->add_tag<ClassId>(ent_dim, "class_id", 1, class_id);
}

/* TODO this function is included as work in progress and is not tested */
void classify_equal_order(
Mesh* mesh, Topo_type ent_type, LOs eqv2v, Read<ClassId> eq_class_ids) {
LOs eq2e;
if (ent_type == Topo_type::vertex) {
eq2e = eqv2v;
}
else {
Write<LO> eq2e_w;
Write<I8> codes;
auto ev2v = mesh->ask_verts_of(ent_type);
auto v2e = mesh->ask_up(Topo_type::vertex, ent_type);
find_matches(ent_type, eqv2v, ev2v, v2e, &eq2e_w, &codes);
eq2e = eq2e_w;
}

auto ent_dim = mesh->ent_dim(ent_type);

auto neq = eqv2v.size() / (ent_dim + 1);
auto eq_class_dim = Read<I8>(neq, I8(ent_dim));
auto class_dim =
map_onto(eq_class_dim, eq2e, mesh->nents(ent_type), I8(mesh->dim()), 1);
auto class_id = map_onto(eq_class_ids, eq2e, mesh->nents(ent_type), -1, 1);
mesh->add_tag<I8>(ent_type, "class_dim", 1, class_dim);
mesh->add_tag<ClassId>(ent_type, "class_id", 1, class_id);
}
/* */

} // end namespace Omega_h
22 changes: 20 additions & 2 deletions src/Omega_h_file.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <Omega_h_defines.hpp>
#include <Omega_h_filesystem.hpp>
#include <Omega_h_mesh.hpp>
#include <Omega_h_mixedMesh.hpp>
#include <Omega_h_tag.hpp>

namespace Omega_h {
Expand All @@ -31,6 +32,13 @@ void write_sol(Mesh* mesh, std::string const& filepath,

#ifdef OMEGA_H_USE_SIMMODSUITE
namespace meshsim {
/**
* Return if the mesh is mixed or mono topology
* @param[in] mesh path to Simmetrix .sms mesh file
* @param[in] model path to Simmetrix GeomSim .smd model file
*/
bool isMixed(filesystem::path const& mesh, filesystem::path const& model);

/**
* Convert a serial Simmetrix sms mesh classified on the specified model to an
* Omega_h mesh instance.
Expand All @@ -41,7 +49,8 @@ namespace meshsim {
Mesh read(filesystem::path const& mesh, filesystem::path const& model,
CommPtr comm);
/**
* Convert a serial Simmetrix sms mesh classified on the specified model to an
* Convert a mono topology (i.e., all tets, all triangles, all hex, etc.)
* serial Simmetrix sms mesh classified on the specified model to an
* Omega_h mesh instance and attach a Simmetrix MeshNex vertex numbering.
* @param[in] mesh path to Simmetrix .sms mesh file
* @param[in] model path to Simmetrix GeomSim .smd model file
Expand All @@ -50,6 +59,15 @@ Mesh read(filesystem::path const& mesh, filesystem::path const& model,
*/
Mesh read(filesystem::path const& mesh, filesystem::path const& model,
filesystem::path const& numbering, CommPtr comm);
/**
* Convert a mixed topology (i.e., tet + wedge) serial Simmetrix sms mesh
* classified on the specified model to an Omega_h mesh instance.
* @param[in] mesh path to Simmetrix .sms mesh file
* @param[in] model path to Simmetrix GeomSim .smd model file
* @param[in] comm path to Omega_h communicator instance
*/
MixedMesh readMixed(filesystem::path const& mesh, filesystem::path const& model,
CommPtr comm);
void matchRead(filesystem::path const& mesh_fname, filesystem::path const& model,
CommPtr comm, Mesh *mesh, I8 is_in);
} // namespace meshsim
Expand Down Expand Up @@ -125,7 +143,7 @@ void write_vtu(std::string const& filename, Mesh* mesh, Int cell_dim,
void write_vtu(std::string const& filename, Mesh* mesh,
bool compress = OMEGA_H_DEFAULT_COMPRESS);

void write_vtu(filesystem::path const& filename, Mesh* mesh, Topo_type max_type,
void write_vtu(filesystem::path const& filename, MixedMesh* mesh, Topo_type max_type,
bool compress = OMEGA_H_DEFAULT_COMPRESS);

void write_parallel(filesystem::path const& path, Mesh* mesh, Int cell_dim,
Expand Down
Loading