Skip to content
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

456 improve semantics of functions to clarify what simplex they operate on #457

Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
110 commits
Select commit Hold shift + click to select a range
f791701
adding get root and making sure get child doesnt go down in simplex d…
mtao Oct 7, 2023
b842cfb
implemented visitor and starting to implement updated versions of upd…
mtao Oct 7, 2023
f3073f0
continuing progress on multimesh ops
mtao Oct 7, 2023
61180a3
Merge remote-tracking branch 'base/main' into mtao/multimesh_operations
mtao Oct 7, 2023
db8049b
adding failed line from merge
mtao Oct 7, 2023
b59cf8a
update builds
mtao Oct 7, 2023
4858b6e
adding mesh variants
mtao Oct 8, 2023
eb728bb
further progress on visitor - now uses variant and a second level of …
mtao Oct 8, 2023
50ba616
Compare input with output vertices after performing Delaunay triangul…
daniel-zint Oct 10, 2023
fc8906a
Set 3d Delaunay tests active.
daniel-zint Oct 10, 2023
588a8b4
Fix delaunay tests for the case that the triangulation has Steiner po…
daniel-zint Oct 11, 2023
f635b73
Set test for full Delaunay component to active.
daniel-zint Oct 11, 2023
5dacdfd
Fixing index out of bounds bug in Delaunay tests.
daniel-zint Oct 11, 2023
b988488
Add tests for invalid input to Delaunay component.
daniel-zint Oct 11, 2023
2700d1f
adding base derived variant traits
mtao Oct 12, 2023
17f586a
minor updates
mtao Oct 12, 2023
d8bc0f2
adding generic ability to call functors and cache return values
mtao Oct 12, 2023
e4ff46e
hiding multi split test because this is a subtask of fixing it
mtao Oct 12, 2023
55dc821
Merge remote-tracking branch 'base/main' into mtao/multimesh_operations
mtao Oct 12, 2023
0dbb74c
starting to fill mesh variant traits
mtao Oct 12, 2023
317211a
Merge remote-tracking branch 'base/main' into mtao/multimesh_operations
mtao Oct 13, 2023
5090656
updating mesh variant for const refs too
mtao Oct 13, 2023
e350714
rm of accidental empty file
mtao Oct 13, 2023
1f081d3
mesh variant basic test works
mtao Oct 13, 2023
32fbca0
multimesh visitor can work with basic runner
mtao Oct 13, 2023
4b94b33
fixing exeuctor, moving computers
mtao Oct 13, 2023
ffcb539
basically a stash of mionr changes
mtao Oct 13, 2023
c20bd9b
Merge remote-tracking branch 'base/main' into mtao/multimesh_operations
mtao Oct 15, 2023
feedb8e
handling default warning
mtao Oct 15, 2023
d2fa0c9
fixing variant test names to metaprogramming
mtao Oct 16, 2023
5ac1610
implementation of tuple helpers for removing voids and making things …
mtao Oct 16, 2023
9385b55
Merge pull request #452 from mtao/mtao/filtering_unique_remove_tuples
mtao Oct 16, 2023
8f391c7
Add test case that catches the current `split_edge` bug.
daniel-zint Oct 16, 2023
eac4e4e
Merge branch 'main' into mtao/multimesh_operations
mtao Oct 16, 2023
2e47ecf
Fix test for `split_edge` return tuple.
daniel-zint Oct 16, 2023
e373930
Swap incident face data, if they do not align with the expected retur…
daniel-zint Oct 16, 2023
2a71efd
Replace `is_valid_slow` by `is_valid` in TriMeshOperationExecutor.
daniel-zint Oct 16, 2023
dabb7e4
Fix swap test.
daniel-zint Oct 16, 2023
2c5bb60
starting t oadd variant to tuple things
mtao Oct 16, 2023
21901a0
Merge branch 'hackthon/yunfan/energy' into 456-improve-semantics-of-f…
mtao Oct 16, 2023
b1c2c56
Merge branch 'hackthon/yunfan/energy' of https://github.com/wildmeshi…
yunfanzhou Oct 16, 2023
5317bcc
Added Halfedge primitive type and refactored primitive type indexing
rjc8237 Oct 16, 2023
9405d33
persimplex functions draft (not compiled)
yunfanzhou Oct 16, 2023
0067ccc
get mesh in persimplexfunction
yunfanzhou Oct 16, 2023
fc99c8e
Merge pull request #433 from wildmeshing/dzint/413-add-a-test-for-del…
daniel-zint Oct 16, 2023
d13e71b
Merge pull request #454 from wildmeshing/dzint/453-return-tuple-of-sp…
daniel-zint Oct 16, 2023
103588b
split operation compiles and seems to run
mtao Oct 17, 2023
123b659
fixing multimesh map_to_child not removing duplicate copies of single…
mtao Oct 17, 2023
838dfe5
Refactored usage of primitive type ids
rjc8237 Oct 18, 2023
5e48159
Replaced simplex dimension with primitive type id for comparison oper…
rjc8237 Oct 18, 2023
81d8bf2
doesnt compile but made sure code for updating hashes for arbitrary m…
mtao Oct 18, 2023
51b298c
add implementation
zlyfunction Oct 18, 2023
c060f20
add implementation and test
zlyfunction Oct 19, 2023
64f9f4d
clean compile issues
zlyfunction Oct 19, 2023
ec94316
reducing warnings in edge swap
mtao Oct 19, 2023
27eeba0
minor changes to api for updating tuple maps
mtao Oct 19, 2023
ebebd6f
adding more updates to faces
mtao Oct 19, 2023
5809732
more faeces updates
mtao Oct 19, 2023
68ee18e
more faeces updates
mtao Oct 19, 2023
ed4fb6c
test warnings
mtao Oct 19, 2023
ff8f168
find the upper level cofaces of a simplex in TriMesh. Tests passed. H…
yunfanzhou Oct 19, 2023
c34185c
realized multimesh hash updates are being done backwards. simplifying…
mtao Oct 20, 2023
486ddf3
refactoring basic operations to use loops a bit
mtao Oct 20, 2023
5ecb6b2
add public function for getting attribute primitive type in MeshAttrH…
yunfanzhou Oct 20, 2023
d591a8e
upper level cofaces using general Mesh type
yunfanzhou Oct 20, 2023
0bf9576
define persimplexfunction
yunfanzhou Oct 20, 2023
d2a6819
Differentiable extension of the persimplexfunction
yunfanzhou Oct 20, 2023
933ab8a
New function class and locally differnetiable function class using th…
yunfanzhou Oct 20, 2023
dcb51dd
cmake for differentiable function refactor
yunfanzhou Oct 20, 2023
a6122d1
comment functionevaluator in cmake out for compilation
yunfanzhou Oct 20, 2023
08cd7fe
add test cases which require throws
zlyfunction Oct 20, 2023
c3d08d9
Merge pull request #467 from wildmeshing/466-add-local_switch_tuple-f…
zlyfunction Oct 20, 2023
6679828
fixed tuple search and added tests among many other checks
mtao Oct 21, 2023
4d51e76
Added an include and removed primitive type dimension deprecations
rjc8237 Oct 21, 2023
903aeca
Added vector include
rjc8237 Oct 21, 2023
9ee0721
updates
mtao Oct 22, 2023
90e5805
fixing simplex lexicographical order + making it a cpp'
mtao Oct 22, 2023
a141ea9
collapse works now
mtao Oct 22, 2023
c42cdf7
fixed variant unit tests for single reteurn value
mtao Oct 22, 2023
72aaedc
Merge branch 'main' into mtao/multimesh_operations
mtao Oct 22, 2023
cebec3c
fixing things that failed after last merge change
mtao Oct 22, 2023
8d9f7a4
adding template specifiers for clang/mvsc
mtao Oct 22, 2023
10b345b
reducing structured binding use in visit for clang?
mtao Oct 22, 2023
bebe0c1
more template statements
mtao Oct 22, 2023
9c5e00c
more template statements
mtao Oct 22, 2023
67b68f3
giving some throwing impl to throwing code
mtao Oct 22, 2023
4004acb
hopefully fixing edge mesh ref in update
mtao Oct 22, 2023
d9f9355
hoping class -> struct fixes ref issues
mtao Oct 22, 2023
50bf393
fixing tupleinspector class warning in tuple.hpp
mtao Oct 22, 2023
f57735a
somre struct to class changes
mtao Oct 22, 2023
0661dc5
Merge pull request #460 from rjc8237/halfedge_primitive
mtao Oct 22, 2023
af20596
Merge branch 'main' into mtao/multimesh_operations
mtao Oct 23, 2023
e3e6cc9
Merge pull request #428 from mtao/mtao/multimesh_operations
mtao Oct 23, 2023
4780770
AutodiffFunction takes input primitive type
yunfanzhou Oct 24, 2023
8504b99
add Sipmlex Type to AMIPS constructor
yunfanzhou Oct 24, 2023
4d5fcc2
take out mesh from Function and locally differentiable function
yunfanzhou Oct 24, 2023
2e2f4d1
perSimplexFunction deconstructor
yunfanzhou Oct 24, 2023
48f9401
change member variable names add assertions to position amips 2d
yunfanzhou Oct 24, 2023
a71ba52
add per simplex valence function, change previous valence function to…
yunfanzhou Oct 24, 2023
be219db
chnage energy tests for compilation
yunfanzhou Oct 24, 2023
a930ba0
Merge branch 'main' into 456-improve-semantics-of-functions-to-clarif…
mtao Oct 25, 2023
669b591
restricting get_gradient and hessian to only the differnetiableFuncti…
yunfanzhou Oct 25, 2023
d690f0c
add simplex type in constructor for PerSImplexFunction. Check type va…
yunfanzhou Oct 25, 2023
fef47da
returning per simplex function in Function
yunfanzhou Oct 25, 2023
2d09286
change naming get_function_type and get_local_gradient
yunfanzhou Oct 25, 2023
54c1b63
Taking DifferentiableEvaluator in base smoothing
yunfanzhou Oct 25, 2023
0f7d280
compilation in smoothing gradient descent
yunfanzhou Oct 25, 2023
cbd1db0
change top level to upper level in LineSearch class
yunfanzhou Oct 25, 2023
3b3f2f4
Merge branch '456-improve-semantics-of-functions-to-clarify-what-simp…
yunfanzhou Oct 25, 2023
fb26313
warning. add upper_level_cofaces to cmake
yunfanzhou Oct 25, 2023
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
1 change: 1 addition & 0 deletions src/wmtk/attribute/AttributeHandle.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ class MeshAttributeHandle
m_primitive_type == o.m_primitive_type;
}
bool is_valid() const { return m_base_handle.is_valid(); }
PrimitiveType primitive_type() const { return m_primitive_type; }
};
} // namespace attribute
using AttributeHandle = attribute::AttributeHandle;
Expand Down
2 changes: 1 addition & 1 deletion src/wmtk/function/AMIPS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace wmtk::function {
AMIPS::AMIPS(const TriMesh& mesh, const MeshAttributeHandle<double>& vertex_attribute_handle)
: AutodiffFunction(mesh, vertex_attribute_handle)
: AutodiffFunction(mesh, PrimitiveType::Face, vertex_attribute_handle)
{}

} // namespace wmtk::function
9 changes: 5 additions & 4 deletions src/wmtk/function/AMIPS2D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,24 @@ namespace wmtk::function {
AMIPS2D::AMIPS2D(const TriMesh& mesh, const MeshAttributeHandle<double>& vertex_attribute_handle)
: AMIPS(mesh, vertex_attribute_handle)
{
assert(get_vertex_attribute_handle().is_valid());
assert(get_variable_attribute_handle().is_valid());
// check the dimension of the position
assert(embedded_dimension() == 2);
}


auto AMIPS2D::get_value_autodiff(const Tuple& tuple) const -> DScalar
auto AMIPS2D::get_value_autodiff(const Simplex& simplex) const -> DScalar
{
return function_eval<DScalar>(tuple);
assert(simplex.primitive_type() == PrimitiveType::Vertex);
return function_eval<DScalar>(simplex.tuple());
}

template <typename T>
T AMIPS2D::function_eval(const Tuple& tuple) const
{
// get_autodiff_value sets the autodiff size if necessary
// get the uv coordinates of the triangle
ConstAccessor<double> pos = mesh().create_const_accessor(get_vertex_attribute_handle());
ConstAccessor<double> pos = mesh().create_const_accessor(get_variable_attribute_handle());

auto tuple_value = pos.const_vector_attribute(tuple);
Vector2<T> uv0;
Expand Down
2 changes: 1 addition & 1 deletion src/wmtk/function/AMIPS2D.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class AMIPS2D : public AMIPS
AMIPS2D(const TriMesh& mesh, const MeshAttributeHandle<double>& vertex_attribute_handle);

protected:
DScalar get_value_autodiff(const Tuple& tuple) const override;
DScalar get_value_autodiff(const Simplex& simplex) const override;


template <typename T>
Expand Down
9 changes: 5 additions & 4 deletions src/wmtk/function/AMIPS3D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,24 @@ namespace wmtk::function {
AMIPS3D::AMIPS3D(const TriMesh& mesh, const MeshAttributeHandle<double>& vertex_attribute_handle)
: AMIPS(mesh, vertex_attribute_handle)
{
assert(get_vertex_attribute_handle().is_valid());
assert(get_variable_attribute_handle().is_valid());
// check the dimension of the position
assert(embedded_dimension() == 3);
}


auto AMIPS3D::get_value_autodiff(const Tuple& tuple) const -> DScalar
auto AMIPS3D::get_value_autodiff(const Simplex& simplex) const -> DScalar
{
return function_eval<DScalar>(tuple);
assert(simplex.primitive_type() == PrimitiveType::Vertex);
return function_eval<DScalar>(simplex.tuple());
}

template <typename T>
T AMIPS3D::function_eval(const Tuple& tuple) const
{
// get_autodiff_value sets the autodiff size if necessary
// get the pos coordinates of the triangle
ConstAccessor<double> pos = mesh().create_const_accessor(get_vertex_attribute_handle());
ConstAccessor<double> pos = mesh().create_const_accessor(get_variable_attribute_handle());

auto tuple_value = pos.const_vector_attribute(tuple);
Vector3<T> pos0;
Expand Down
2 changes: 1 addition & 1 deletion src/wmtk/function/AMIPS3D.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class AMIPS3D : public AMIPS
AMIPS3D(const TriMesh& mesh, const MeshAttributeHandle<double>& vertex_attribute_handle);

protected:
DScalar get_value_autodiff(const Tuple& tuple) const override;
DScalar get_value_autodiff(const Simplex& simplex) const override;

template <typename T>
T function_eval(const Tuple& tuple) const;
Expand Down
17 changes: 9 additions & 8 deletions src/wmtk/function/AutodiffFunction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,26 @@ namespace wmtk::function {

AutodiffFunction::AutodiffFunction(
const Mesh& mesh,
const MeshAttributeHandle<double>& vertex_attribute_handle)
: DifferentiableFunction(mesh, vertex_attribute_handle)
const PrimitiveType& simplex_type,
const MeshAttributeHandle<double>& variable_attribute_handle)
: DifferentiablePerSimplexFunction(mesh, simplex_type, variable_attribute_handle)
{}

AutodiffFunction::~AutodiffFunction() = default;
double AutodiffFunction::get_value(const Tuple& tuple) const
double AutodiffFunction::get_value(const Simplex& simplex) const
{
auto scope = utils::AutoDiffRAII(embedded_dimension());
return get_value_autodiff(tuple).getValue();
return get_value_autodiff(simplex).getValue();
}
Eigen::VectorXd AutodiffFunction::get_gradient(const Tuple& tuple) const
Eigen::VectorXd AutodiffFunction::get_gradient(const Simplex& simplex) const
{
auto scope = utils::AutoDiffRAII(embedded_dimension());
auto v = get_value_autodiff(tuple);
auto v = get_value_autodiff(simplex);
return v.getGradient();
}
Eigen::MatrixXd AutodiffFunction::get_hessian(const Tuple& tuple) const
Eigen::MatrixXd AutodiffFunction::get_hessian(const Simplex& simplex) const
{
auto scope = utils::AutoDiffRAII(embedded_dimension());
return get_value_autodiff(tuple).getHessian();
return get_value_autodiff(simplex).getHessian();
}
} // namespace wmtk::function
17 changes: 10 additions & 7 deletions src/wmtk/function/AutodiffFunction.hpp
Original file line number Diff line number Diff line change
@@ -1,25 +1,28 @@
#pragma once
#include <wmtk/function/utils/autodiff.h>
#include "DifferentiableFunction.hpp"
#include "DifferentiablePerSimplexFunction.hpp"
namespace wmtk::function {

class AutodiffFunction : public DifferentiableFunction
class AutodiffFunction : public DifferentiablePerSimplexFunction
{
public:
using DScalar = DScalar2<double, Eigen::Matrix<double, -1, 1>, Eigen::Matrix<double, -1, -1>>;
using Scalar = typename DScalar::Scalar;
static_assert(
std::is_same_v<Scalar, double>); // MTAO: i'm leaving scalar here but is it ever not double?
AutodiffFunction(const Mesh& mesh, const MeshAttributeHandle<double>& vertex_attribute_handle);
AutodiffFunction(
const Mesh& mesh,
const PrimitiveType& simplex_type,
const attribute::MeshAttributeHandle<double>& variable_attribute_handle);

virtual ~AutodiffFunction();

public:
double get_value(const Tuple& tuple) const override;
Eigen::VectorXd get_gradient(const Tuple& tuple) const override;
Eigen::MatrixXd get_hessian(const Tuple& tuple) const override;
double get_value(const Simplex& simplex) const override;
Eigen::VectorXd get_gradient(const Simplex& simplex) const override;
Eigen::MatrixXd get_hessian(const Simplex& simplex) const override;

protected:
virtual DScalar get_value_autodiff(const Tuple& tuple) const = 0;
virtual DScalar get_value_autodiff(const Simplex& simplex) const = 0;
};
} // namespace wmtk::function
14 changes: 11 additions & 3 deletions src/wmtk/function/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,14 @@
set(SRC_FILES
Function.hpp
Function.cpp
DifferentiableFunction.cpp
DifferentiableFunction.hpp

LocallyDifferentiableFunction.hpp
LocallyDifferentiableFunction.cpp
PerSimplexFunction.hpp
PerSimplexFunction.cpp
DifferentiablePerSimplexFunction.hpp
DifferentiablePerSimplexFunction.cpp

AMIPS.hpp
AMIPS.cpp
AMIPS2D.hpp
Expand All @@ -12,9 +18,11 @@ set(SRC_FILES
AMIPS3D.cpp
PositionMapAMIPS2D.hpp
PositionMapAMIPS2D.cpp

ValenceEnergyPerEdge.hpp
ValenceEnergyPerEdge.cpp
TriMeshValenceFunction.hpp
TriMeshValenceFunction.cpp

AutodiffFunction.hpp
AutodiffFunction.cpp
)
Expand Down
40 changes: 40 additions & 0 deletions src/wmtk/function/DifferentiablePerSimplexFunction.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#include "DifferentiablePerSimplexFunction.hpp"

namespace wmtk {
namespace function {
DifferentiablePerSimplexFunction::DifferentiablePerSimplexFunction(
const Mesh& mesh,
const PrimitiveType& simplex_type,
const attribute::MeshAttributeHandle<double>& variable_attribute_handle)
: PerSimplexFunction(mesh, simplex_type)
, m_attribute_handle(variable_attribute_handle)
{}

DifferentiablePerSimplexFunction::~DifferentiablePerSimplexFunction() = default;

const MeshAttributeHandle<double>& DifferentiablePerSimplexFunction::get_variable_attribute_handle()
const
{
return m_attribute_handle;
}

long DifferentiablePerSimplexFunction::embedded_dimension() const
{
return mesh().get_attribute_dimension(get_variable_attribute_handle());
}


void DifferentiablePerSimplexFunction::assert_function_type(const PrimitiveType& s_type) const
{
yunfanzhou marked this conversation as resolved.
Show resolved Hide resolved
if (get_variable_attribute_handle().primitive_type() != s_type) {
throw std::runtime_error("Differentiation of the DifferentiableFunction must be taken wrt "
"the attribute of the simplex type ");
}
if (get_simplex_type() < s_type) {
throw std::runtime_error(
"The DifferentiableFunction must be defined on the cofaces of higher dimension to the "
"simplex type ");
}
}
} // namespace function
} // namespace wmtk
45 changes: 45 additions & 0 deletions src/wmtk/function/DifferentiablePerSimplexFunction.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#pragma once
#include <wmtk/Primitive.hpp>
#include <wmtk/attribute/AttributeHandle.hpp>
#include <wmtk/attribute/MeshAttributes.hpp>
#include "PerSimplexFunction.hpp"
namespace wmtk {
namespace function {
class DifferentiablePerSimplexFunction : public PerSimplexFunction
{
public:
/**
* @brief Construct a new DifferentiablePerSimplexFunction object where the function is defined
* over simplices of simplex_type. And the differentiation is taken wrt the
* attribute_handle.primitive_type()
*
* @param mesh
* @param simplex_type
*/
DifferentiablePerSimplexFunction(
const Mesh& mesh,
const PrimitiveType& simplex_type,
const attribute::MeshAttributeHandle<double>& variable_attribute_handle);
virtual ~DifferentiablePerSimplexFunction();

public:
virtual Eigen::VectorXd get_gradient(const Simplex& s) const = 0;
virtual Eigen::MatrixXd get_hessian(const Simplex& s) const = 0;

const attribute::MeshAttributeHandle<double>& get_variable_attribute_handle() const;

/**
* @brief the function should be defined on the simplex of type A and the differntiation is
* taken wrt simplex type B. The definition mandate (1) A should be coface with B, (2) the type
* of the attribute_handle should be of the same type as B.
*
* @param s_type simplex Type B as defined above
*/
void assert_function_type(const PrimitiveType& s_type) const;
long embedded_dimension() const;

private:
const attribute::MeshAttributeHandle<double> m_attribute_handle;
};
} // namespace function
} // namespace wmtk
28 changes: 6 additions & 22 deletions src/wmtk/function/Function.cpp
Original file line number Diff line number Diff line change
@@ -1,30 +1,14 @@
#include "Function.hpp"
#include <wmtk/simplex/top_level_cofaces.hpp>
namespace wmtk::function {
namespace wmtk {
namespace function {

Function::Function(const Mesh& mesh)
: m_mesh(mesh)
Function::Function(std::unique_ptr<PerSimplexFunction>&& function)
: m_function(std::move(function))
{}

Function::~Function() = default;

double Function::get_one_ring_value(const Tuple& vertex) const
{
auto simplices =
simplex::top_level_cofaces_tuples(mesh(), Simplex(PrimitiveType::Vertex, vertex));
return get_value_sum(simplices);
}
double Function::get_value_sum(const std::vector<Tuple>& top_level_simplices) const
{
double v = 0;
for (const Tuple& cell : top_level_simplices) {
v += get_value(cell);
}
return v;
}

const Mesh& Function::mesh() const
{
return m_mesh;
}
} // namespace wmtk::function
} // namespace function
} // namespace wmtk
20 changes: 8 additions & 12 deletions src/wmtk/function/Function.hpp
Original file line number Diff line number Diff line change
@@ -1,25 +1,21 @@
#pragma once
#include <wmtk/Mesh.hpp>
#include <wmtk/Tuple.hpp>
#include <memory>
#include <wmtk/Primitive.hpp>
#include "PerSimplexFunction.hpp"
namespace wmtk {
namespace function {
class Function
{
private:
const Mesh& m_mesh;


public:
Function(const Mesh& mesh);
Function(std::unique_ptr<PerSimplexFunction>&& function);
virtual ~Function();

const Mesh& mesh() const;
double get_one_ring_value(const Tuple& vertex) const;
double get_value_sum(const std::vector<Tuple>& top_level_simplices) const;

public:
// evaluate the function on the top level simplex of the tuple
virtual double get_value(const Tuple& top_level_simplex) const = 0;
virtual double get_value(const Simplex& simplex) const = 0;

private:
std::unique_ptr<PerSimplexFunction> m_function;
};
} // namespace function
} // namespace wmtk
Loading