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

classification in simmetrix mesh converter #7

Closed
cwsmith opened this issue Feb 25, 2021 · 2 comments
Closed

classification in simmetrix mesh converter #7

cwsmith opened this issue Feb 25, 2021 · 2 comments

Comments

@cwsmith
Copy link

cwsmith commented Feb 25, 2021

From the discussion in the TOMMS issue here: https://github.com/SCOREC/tomms/issues/17

The simmetrix -> omegah mesh converter is calling classify_equal_order to set the geometric model entity id and dimension:

classify_equal_order(mesh, ent_dim, eqv2v, host_class_id.write());

clasify_equal_order is defined here:

void classify_equal_order(
Mesh* mesh, Int ent_dim, LOs eqv2v, Read<ClassId> eq_class_ids) {
LOs eq2e;
if (ent_dim == mesh->dim()) {
/* assuming elements were constructed in the same order ! */
eq2e = LOs(mesh->nelems(), 0, 1);
} else if (ent_dim == VERT) {
eq2e = eqv2v;
} else {
Write<LO> eq2e_w;
Write<I8> codes;
auto ev2v = mesh->ask_verts_of(ent_dim);
auto v2e = mesh->ask_up(VERT, ent_dim);
find_matches(mesh->family(), ent_dim, eqv2v, ev2v, v2e, &eq2e_w, &codes);
eq2e = eq2e_w;
}
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_dim), I8(mesh->dim()), 1);
auto class_id = map_onto(eq_class_ids, eq2e, mesh->nents(ent_dim), -1, 1);
mesh->add_tag<I8>(ent_dim, "class_dim", 1, class_dim);
mesh->add_tag<ClassId>(ent_dim, "class_id", 1, class_id);

It isn't clear if this is necessary since we are explicitly querying the classification info from simmetrix; I suspect we can just set the "class_dim" and "class_id" tags directly.

@joshia5
Copy link
Collaborator

joshia5 commented Mar 10, 2021

@cwsmith , setting the "class_dim" and "class_id" tags directly will only work for elements and vertices, not for other entities because they are created using omegah build functions:

build_from_elems_and_coords(

I think a thorough fix would be to create omegah mesh entities while preserving mapping of ids with simmetrix mesh ents and then we can set the tags directly. This build process was implemented for mixed mesh here:

mesh->set_ents(Topo_type::edge, Topo_type::vertex, Adj(ev2v));
although iirc specific omegah functions for mixed mesh building were created for that.

@cwsmith
Copy link
Author

cwsmith commented Jun 15, 2021

This is resolved with #15 .

@cwsmith cwsmith closed this as completed Jun 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants