Skip to content

Enhance SamplingShaper so it can work on low order Blueprint meshes - #1875

Open
BradWhitlock wants to merge 96 commits into
developfrom
feature/whitlock/sampling_low_order_blueprint_mesh
Open

Enhance SamplingShaper so it can work on low order Blueprint meshes#1875
BradWhitlock wants to merge 96 commits into
developfrom
feature/whitlock/sampling_low_order_blueprint_mesh

Conversation

@BradWhitlock

@BradWhitlock BradWhitlock commented May 27, 2026

Copy link
Copy Markdown
Member

This PR resolves #1692 so the quest::SamplingShaper can operate on Blueprint low order meshes.

  • Moved SamplingShaper MFEM state into a state object that can be used among helper routines
  • Added a BlueprintState object to support Blueprint state
  • Enhanced various methods to operate on both types of state, templating as needed
  • Separated "shaping_helpers.{cpp,hpp}" into MFEM and Blueprint files
  • Quadrature enhancements: an enum and some more methods to generate quadrature points
  • Blueprint sampling will generate sample points at quadrature as with HO and then sample shapes at those points, ultimately converting to material fields on the Blueprint mesh
  • Changed CMake logic so SamplingShaper can be built when either MFEM or Conduit (or both) are present -- enables a shaper that works without MFEM
  • When MFEM is present, we can shape MFEM contours onto Blueprint mesh in 2D
  • Enhanced shaping_driver so it can work with blueprint only mode, currently selected via inline blueprint mesh
  • Added a test of Blueprint-only mode for STL spheres
  • Made IntersectionShaper use BlueprintState where needed
  • Enhancements that allow shaping on Blueprint meshes via conduit::Node or via sidre::Group.

return it->second;
}

void compute_interpolatory_weights(const axom::Array<double>& nodes,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think this method could use a brief doxygen header to explain what it does, even if it isn't user-facing.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Done

for(int npts = 1; npts <= maxNpts; ++npts)
{
const auto rule = getRule(npts);
const int exactDegree = getExactDegree(npts);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Now that there's a lot of quadrature rules to keep track of, do you think it's generally useful enough to have a helper function like get_exact_degree(numerics::QuadartureType, npts)? Even if it isn't necessary to actually execute it most of the time, its source code could provide a useful compendium of which rules evaluate which order polynomials.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I had codex move code into a get_exact_degree helper function and update the tests.


assert("Unhandled Axom quadrature type." && false);
return 2 * npts - 1;
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is very helpful, thank you!

* \param allocator_id The allocator id to use when allocating new coordinate memory.
*/
static void execute(conduit::Node &n_coordset,
int allocator_id = axom::execution_space<ExecSpace>::allocatorID())

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is maybe a dumb question, but when would I want to use this method instead of the one I was using before in axom::bump::views::make_explicit_coordset? Is it because this one gets done in place?

@BradWhitlock BradWhitlock Jul 23, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

axom::bump::views::make_explicit_coordset makes a view of an existing explicit coordset whereas MakeExplicitCoordset takes a conduit::Node containing some other coordset type and converts it into an explicit coordset (it might do some work and data allocation).

*/
QuadratureRule get_quadrature_rule(QuadratureType quadratureType,
int npts,
int allocatorID = axom::getDefaultAllocatorID());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Some functions here are missing Doxygen comments for allocatorID param.

public:
AXOM_HOST_DEVICE function() : invoke(nullptr) { }

/**

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do we want to preserve the some of the doxygen comment blocks being deleted in this file here?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I'll add that back in. Codex was needlessly aggressive about trying to remove doxygen comments. This may have been before I complained to it.

}
}
template <typename MeshState>
void checkSampleResolution(const MeshState& meshState,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Doxygen comment here for consistency.

Comment on lines +67 to +70
void deleteShapeFunction(const std::string& AXOM_UNUSED_PARAM(name))
{
// TODO: remove the function from m_inoutShapeQFuncs if it exists.
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Does this still need to be resolved?

axom::ArrayView<int> sampleResolution,
axom::numerics::QuadratureType quadratureType);

void computeVolumeFractionsIdentity(mfem::DataCollection* dc,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Doxygen comment here for consistency

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

Successfully merging this pull request may close these issues.

Support (low order) blueprint meshes in sample-based shaper

3 participants