Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ The Axom project release numbers follow [Semantic Versioning](http://semver.org/
- Adds the `AXOM_TEST_NUM_OMP_THREADS` configuration variable to control the default OpenMP thread count for tests.

### Changed
- Evaluation methods for line integrals in `axom::primal` have been generalized, and
`evaluate_scalar_line_integral` has been renamed to `evaluate_line_integral`.
- Treatment of materials on strided-structured Blueprint meshes has changed in `axom::mir`.
Materials are now expected to be defined only on the valid subset of zones in the mesh.
This more closely matches VisIt behavior.
Expand Down
1 change: 1 addition & 0 deletions src/axom/primal/geometry/BezierCurve.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ template <typename T, int NDIMS>
class BezierCurve
{
public:
using NumericType = T;
using PointType = Point<T, NDIMS>;
using VectorType = Vector<T, NDIMS>;
using SegmentType = Segment<T, NDIMS>;
Expand Down
34 changes: 4 additions & 30 deletions src/axom/primal/geometry/CurvedPolygon.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,31 +34,7 @@ namespace primal
namespace internal
{
///@{
/// \name Boilerplate to deduce the numeric type from the curve object
template <typename U>
struct get_numeric_type;

template <typename T, int NDIMS>
struct get_numeric_type<BezierCurve<T, NDIMS>>
{
using type = T;
};

template <typename T, int NDIMS>
struct get_numeric_type<NURBSCurve<T, NDIMS>>
{
using type = T;
};

template <typename T>
struct get_numeric_type<detail::NURBSCurveGWNCache<T>>
{
using type = T;
};
///@}

///@{
/// \name Boilerplate for a compile-time flag for the cached object
/// \name Type traits for a compile-time flag for the cached object
template <typename U>
struct has_cached_data : std::false_type
{ };
Expand All @@ -80,8 +56,7 @@ std::ostream& operator<<(std::ostream& os, const CurvedPolygon<CurveType>& poly)
/*!
* \class CurvedPolygon
*
* \brief Represents a polygon with curved edges defined by BezierCurves
* \tparam T the coordinate type, e.g., double, float, etc.
* \brief Represents a polygon with generic curves for edges
* \tparam NDIMS the number of dimensions
* \note The component curves should be ordered in a counter clockwise
* orientation with respect to the polygon's normal vector
Expand All @@ -90,8 +65,7 @@ template <typename CurveType>
class CurvedPolygon
{
public:
using T = typename internal::get_numeric_type<CurveType>::type;

using NumericType = typename CurveType::NumericType;
using PointType = typename CurveType::PointType;
using VectorType = typename CurveType::VectorType;
using BoundingBoxType = typename CurveType::BoundingBoxType;
Expand Down Expand Up @@ -164,7 +138,7 @@ class CurvedPolygon
void addEdge(CurveType&& c1) { m_edges.push_back(std::move(c1)); }

/// Splits an edge "in place"
void splitEdge(int idx, T t)
void splitEdge(int idx, NumericType t)
{
SLIC_ASSERT(idx >= 0 && idx < static_cast<int>(m_edges.size()));
AXOM_STATIC_ASSERT_MSG(!internal::has_cached_data<CurveType>::value,
Expand Down
1 change: 1 addition & 0 deletions src/axom/primal/geometry/NURBSCurve.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ template <typename T, int NDIMS>
class NURBSCurve
{
public:
using NumericType = T;
using PointType = Point<T, NDIMS>;
using VectorType = Vector<T, NDIMS>;
using SegmentType = Segment<T, NDIMS>;
Expand Down
37 changes: 12 additions & 25 deletions src/axom/primal/geometry/NURBSPatch.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3111,25 +3111,16 @@ class NURBSPatch
{
SLIC_ASSERT(NDIMS == 3);

// Split the patch along the unique knot values to improve convergence
auto split_patches = extractTrimmedBezier();

VectorType ret_vec;
for(int n = 0; n < split_patches.size(); ++n)
{
// Integrand for the surface area integral
auto& nPatch = split_patches[n];

for(int N = 0; N < 3; ++N)
{
auto avg_surface_normal_integrand = [&nPatch, &N](Point2D x) -> double {
return nPatch.normal(x[0], x[1])[N];
};

// Find the area of the resulting projection
ret_vec[N] +=
evaluate_area_integral(nPatch.getTrimmingCurves(), avg_surface_normal_integrand, npts);
}
// Split the patch along the unique knot values to improve convergence
for(const auto& nPatch : extractTrimmedBezier())
{
// Integrate the surface normal over the patches
ret_vec += evaluate_area_integral(
nPatch.getTrimmingCurves(),
[&nPatch](Point2D x) -> Vector<T, 3> { return nPatch.normal(x[0], x[1]); },
npts);
}

return ret_vec;
Expand Down Expand Up @@ -3397,11 +3388,9 @@ class NURBSPatch
const double sq_tol = 1e-14;
const double EPS = 1e-6;

// Extract the Bezier curves of the NURBS curve
auto beziers = curve.extractBezier();
// Extract the Bezier curves of the NURBS curve, checking each for intersection
axom::Array<T> knot_vals = curve.getKnots().getUniqueKnots();

// Check each Bezier segment for intersection
const auto beziers = curve.extractBezier();
for(int i = 0; i < beziers.size(); ++i)
{
axom::Array<T> temp_curve_p;
Expand Down Expand Up @@ -3849,11 +3838,9 @@ class NURBSPatch
const double sq_tol = 1e-14;
const double EPS = 1e-6;

// Extract the Bezier curves of the NURBS curve
auto beziers = curve.extractBezier();
// Extract the Bezier curves of the NURBS curve, and check each for intersection
axom::Array<T> knot_vals = curve.getKnots().getUniqueKnots();

// Check each Bezier segment for intersection
const auto beziers = curve.extractBezier();
for(int i = 0; i < beziers.size(); ++i)
{
axom::Array<T> temp_curve_p;
Expand Down
Loading