Skip to content

Define 2d model class and Simmetrix GeomSim model loader#96

Open
cwsmith wants to merge 93 commits into
masterfrom
cws/model2dSim
Open

Define 2d model class and Simmetrix GeomSim model loader#96
cwsmith wants to merge 93 commits into
masterfrom
cws/model2dSim

Conversation

@cwsmith

@cwsmith cwsmith commented Apr 1, 2024

Copy link
Copy Markdown

Adds a Model2D class and support for filling the Model2D data structures from a Simmetrix GeomSim model (.smd).

  • tests GeomSim loading on 2d square
  • tests GeomSim loading on a 3d model - expected result is failure (see will_fail_test_func(...) CMake macro)
  • Simmetrix initialization and finalization were moved into the Omega_h::Library constructor.

@cwsmith cwsmith changed the title Define 2d model class and Simmetrix GeomSim loader Define 2d model and mesh class and Simmetrix GeomSim model loader Apr 1, 2024

@jacobmerson jacobmerson left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mostly commented on high level design choices so far.

Comment thread src/Omega_h_meshsim.cpp
Comment thread src/Omega_h_simModel2d.cpp
Comment thread src/simModel2dLoad_square.cpp
@joshia5

joshia5 commented May 1, 2024

Copy link
Copy Markdown
Collaborator

looks good to me overall, some comments attached

@cwsmith

cwsmith commented May 22, 2024

Copy link
Copy Markdown
Author

notes from discussion with @jacobmerson

  • this is a 'stub' for future development that will add APIs to access this data during mesh adaptation
  • Model2d is intended to be immutable
    • return Model2d as const
    • make vtxTol and edgeTol as const
    • possibly delete Model2d copy constructor to avoid modification

CKegel and others added 9 commits June 20, 2025 12:24
Stores topological data in private fields and provides a "getter" api to access topological data. Also adds in code doxygen documentation.
Adds topological queries to the Model2D Class by:

- Making the Model2D Fields private, and providing inline "getter" functions
- Reworking the Model2D loading routine. It now utilizes private helper functions to populate the Model2D Fields
- Adding documentation with doxygen

This PR also bumps the maximum version of Simmetrix to 2025.1.250507.
@cwsmith

cwsmith commented Aug 27, 2025

Copy link
Copy Markdown
Author

/runtests

@github-actions

Copy link
Copy Markdown

Test Result: success (details)

@cwsmith

cwsmith commented Aug 27, 2025

Copy link
Copy Markdown
Author

/runtests

@github-actions

Copy link
Copy Markdown

Test Result: success (details)

Comment thread src/Omega_h_mesh2d.cpp
}

std::optional<Model2D> Mesh2D::getModel() const {
std::optional<const Model2D> Mesh2D::getModel() const {

@jacobmerson jacobmerson Sep 14, 2025

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may not be what you want. I'm pretty sure this will make a copy of the model to return since std::optional owns the data. If you don’t want a copy a pointer is probably the way to go here, but with an added note in the docs that it may be null since our users may not be as careful with checking for nullptr as they should be.

If you return a pointer, you can also mark this function noexcept

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants