Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ include(cmake/vtk.cmake)

CPMAddPackage(
NAME ViennaCore
VERSION 2.1.2
VERSION 2.2.1
GIT_REPOSITORY "https://github.com/ViennaTools/ViennaCore"
OPTIONS "VIENNACORE_FORMAT_EXCLUDE build/"
EXCLUDE_FROM_ALL ${VIENNALS_BUILD_PYTHON})
Expand Down
2 changes: 1 addition & 1 deletion include/viennals/lsCalculateNormalVectors.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ enum class NormalCalculationMethodEnum {

/// This algorithm is used to compute the normal vectors for all points
/// with level set values <= maxValue (default 0.5). The result is saved in
/// the lsPointData of the lsDomain and can be retrieved with
/// the PointData of the lsDomain and can be retrieved with
/// lsDomain.getPointData().getVectorData("Normals").
///
/// The algorithm uses central differences to compute gradients and normalizes
Expand Down
3 changes: 1 addition & 2 deletions include/viennals/lsDomain.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@
#include <hrleDomain.hpp>
#include <hrleFillDomainWithSignedDistance.hpp>

#include <lsPointData.hpp>

#include <vcLogger.hpp>
#include <vcPointData.hpp>
#include <vcSmartPointer.hpp>
#include <vcVectorType.hpp>

Expand Down
18 changes: 15 additions & 3 deletions include/viennals/lsMesh.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
#include <iostream>
#include <vector>

#include <lsPointData.hpp>

#include <vcPointData.hpp>
#include <vcSmartPointer.hpp>
#include <vcVectorType.hpp>

Expand All @@ -32,6 +31,9 @@ template <class T = double> class Mesh {
Vec3D<T> minimumExtent{};
Vec3D<T> maximumExtent{};

constexpr static const char *materialIdsLabel = "MaterialIds";
constexpr static const char *normalsLabel = "Normals";

private:
// iterator typedef
using VectorIt = typename PointData<T>::VectorDataType::iterator;
Expand Down Expand Up @@ -99,6 +101,16 @@ template <class T = double> class Mesh {

const PointData<T> &getCellData() const { return cellData; }

// helper function to get normals
std::vector<Vec3D<T>> *getNormals(const char *label = normalsLabel) {
return cellData.getVectorData(label);
}

// helper function to get material ids
std::vector<T> *getMaterialIds(const char *label = materialIdsLabel) {
return cellData.getScalarData(label);
}

unsigned insertNextNode(const Vec3D<T> &node) {
nodes.push_back(node);
return nodes.size() - 1;
Expand Down Expand Up @@ -326,4 +338,4 @@ template <class T = double> class Mesh {
// add all template specialisations for this class
PRECOMPILE_PRECISION(Mesh);

} // namespace viennals
} // namespace viennals
Loading
Loading