MeshTools::all_rbb() to generate IGA rational quadratic meshes#4442
MeshTools::all_rbb() to generate IGA rational quadratic meshes#4442roystgnr wants to merge 29 commits into
Conversation
This takes an interpolated quadratic Lagrange mesh and turns it into an IGA (Rational Bezier-Bernstein) mapped mesh, assuming that all curves are intended to be circular/cylindrical/spherical.
1D on the X axis is pointless, but 1D meshes embedded in 2D or 3D space may still benefit from perfect circles.
This still gets us isogeometry on aligned cylinders, but also on cones and some types of spheres, and gets us a sort of optimality on non-exactly-representable surfaces.
It's the same either way but it just read wrong the other way.
I was about to stop capturing it, to fix an unused var warning, but this is better.
| /** | ||
| * The goal of this test is to verify proper operation of the Mesh Extruder | ||
| * with the optional object callback for setting custom subdomain IDs. | ||
| * We pass a custom object for generating subdomains based on the old element | ||
| * ID and the current layer and assert the proper values. | ||
| */ |
There was a problem hiding this comment.
| /** | |
| * The goal of this test is to verify proper operation of the Mesh Extruder | |
| * with the optional object callback for setting custom subdomain IDs. | |
| * We pass a custom object for generating subdomains based on the old element | |
| * ID and the current layer and assert the proper values. | |
| */ |
or update
| const Real w = node->get_extra_datum<Real>(weight_index); | ||
|
|
||
| CPPUNIT_ASSERT_EQUAL(Real(1), w); | ||
| } |
There was a problem hiding this comment.
volume should be easy to check too
as well as hmin/hmax ? these change with the mapping right
There was a problem hiding this comment.
None change in this trivial remapping, but all are good to check
| MeshTools::Generation::build_sphere (interior_mesh, radius, | ||
| n_refinements, QUAD9); | ||
|
|
||
| // Get just the outer EDGE9 circle mesh |
There was a problem hiding this comment.
| // Get just the outer EDGE9 circle mesh | |
| // Get just the outer EDGE3 circle mesh |
|
|
||
| // We only use [4,8) but matching indices is nice and stack is | ||
| // cheap. | ||
| // that we're only using what we set, though. |
There was a problem hiding this comment.
Somehow missed a line deletion when I was making a huge change; thanks!
| almost_equal(w[22], w[24])) | ||
| extrude_dir = 0; | ||
|
|
||
| if (almost_equal(w[0], w[3]) && |
| almost_equal(w[21], w[23])) | ||
| extrude_dir = 1; | ||
|
|
||
| if (almost_equal(w[0], w[4]) && |
Thanks to Guillaume for catching these
This is still a hack I'm working on replacing, but now it's a *slightly faster* hack!
Just because it's trivial doesn't definitely mean it's not broken!
Even a p=1 face can have a different volume if the vertex weights differ and the face is embedded in 3D with non-coplanar vertices.
I'm not sure when we'll try using RBB polygons, but if we started now we actually wouldn't need the specialization for this one.
The R part is working but I didn't realize we'd never implemented the BB part, and that'll be a separate PR.
I was trying to be clever with my if statements but I was missing out on all sorts of complications; the code was fine but the tests weren't even close.
|
|
||
| Node & midnode = face.node_ref(8); | ||
| midnode.set_extra_datum<Real>(weight_index, w_mid); | ||
| midnode = ((1+w_mid)/(w_xi+w_eta) * (w_xi*xi_avg + w_eta*eta_avg) - vertex_avg)/w_mid; |
There was a problem hiding this comment.
| midnode = ((1+w_mid)/(w_xi+w_eta) * (w_xi*xi_avg + w_eta*eta_avg) - vertex_avg)/w_mid; | |
| midnode = ((1.+w_mid)/(w_xi+w_eta) * (w_xi*xi_avg + w_eta*eta_avg) - vertex_avg)/w_mid; |
| almost_equal(w[11], w[24]) && | ||
| almost_equal(w[20], w[25])) | ||
| extrude_dir = 2; | ||
|
|
There was a problem hiding this comment.
should you assert the coordinates fit a 2.5D extrusion, not just the weights?
There was a problem hiding this comment.
if the elements are coming from a regular mesh the weights are all defaults at this point?
|
btw I can't resolve threads with this level of permissions either |
This needs proper test coverage before merging but I've been letting it sit in a separate branch for too long and I want to at least make sure it's not interfering with any CI builds.