-
Notifications
You must be signed in to change notification settings - Fork 44
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
Enable 1D and 3D: mesh construction and X3D parsing. #633
Conversation
+ Add optional face type (nodes per face) argument to mesh ctor. + Use face type to compute dimension-agnostic cell connectivity. + Add 1D and 2D tests to tstDraco_Mesh.cc.
+ Add default boundary data generation when face types are given. + Add test of default boundary generation to new 1D unit test.
+ Instantiate reader with optional use_face_type parameter. + Set cell type and as faces per cell when use_face_type is true. + Preserve cell->face->node in linkage when use_face_type is true. + Set face_type vector in mesh builder when use_face_type is true. + Enforce use_face_type in mesh reader virtual base class. + Add corresponding function stubs to RTT (not implemented). + Update unit test to test alternate mesh reader/builder.
+ Remove DLL_PUBLIC macros from X3D and RTT functions. + Update X3D unit test with newer failure macros.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks really nice. I've added a few comments but nothing that should prevent this from being merged. Let me know if you want to make one more set of changes or if you want me to merge this one.
src/mesh/Draco_Mesh.cc
Outdated
|
||
#include "Draco_Mesh.hh" | ||
#include "ds++/Assert.hh" | ||
#include <algorithm> | ||
#include <iostream> | ||
// #include <iostream> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this isn't needed, go ahead and delete this line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for catching this - it has been removed.
src/mesh/Draco_Mesh_Builder.t.hh
Outdated
@@ -166,7 +177,8 @@ Draco_Mesh_Builder<FRT>::build_mesh(rtt_mesh_element::Geometry geometry) { | |||
|
|||
std::shared_ptr<Draco_Mesh> mesh(new Draco_Mesh( | |||
dimension, geometry, cell_type, cell_to_node_linkage, side_set_flag, | |||
side_node_count, side_to_node_linkage, coordinates, global_node_number)); | |||
side_node_count, side_to_node_linkage, coordinates, global_node_number, | |||
{}, {}, {}, {}, face_type)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not crazy about the empty brackets here. It's not hard to look up the argument list as defined by the constructor, but maybe we could use inline named argument declarations here. What do you think? Is it worth the hassle?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are keyword arguments possible? Apologies for my confusion... Some variables have been initialized as empty and used here, with consistent naming.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure about it for this UseCase. Have you tried {} --> vector<int> foobar{}
or a similar signature?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It didn't appear to work... vector<int>()
works, which is somewhat more descriptive. What about this?
@@ -34,14 +34,15 @@ private: | |||
|
|||
public: | |||
//! Constructor | |||
DLL_PUBLIC_mesh explicit RTT_Draco_Mesh_Reader(const std::string filename_); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Nice to see these disappearing slowly. Alex and have a plan to remove all the remaining entries after the release. (except for the handful that are still needed.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No problem - good to know!
size_t /*face*/) const { | ||
Insist(false, "cell-face nodes not implemented with RTT reader."); | ||
return std::vector<unsigned>(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You might want to add the function decoration [[noreturn]]
(see ds++/Assert.hh
for an example) to avoid any compiler confusion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the recommendation - this is a useful feature. A [[noreturn]]
decoration has been added and the return
line has been removed.
Also - CDash is reporting this warning: |
+ Put variable unused in release builds in Remember macro. + Add noreturn decorator to function that only throws assertion. + Remove commented out code.
The unused |
LGTM. merging... |
Background
Draco_Mesh
class only supports 2D mesh objects.Layout
data structures inDraco_Mesh
are already compatible with 1D and 3D cell topologies.Purpose of Pull Request
Draco_Mesh_Builder
.Draco_Mesh
stores (cell_type
,cell_to_node_linkage
).Description of changes
Draco_Mesh
ctor,face_type
, which is the number of nodes per face per cell.face_type
is given (size > 0):cell_type
as the number of faces per cell instead of the number of nodes per cell,compute_cell_to_cell_linkage
that usesface_type
.X3D_Draco_Mesh_Reader
,use_face_types
, which tells the class to provide data to buildface_type
inDraco_Mesh_Builder
.Layout
data is unchanged in 2D when using newcompute_cell_to_cell_linkage
in tstDraco_Mesh.cc.use_face_types=true
in tstX3D_Draco_Mesh_Reader.cc.Status