Lagrange
Loading...
Searching...
No Matches
hodge_decomposition.h
1/*
2 * Copyright 2026 Adobe. All rights reserved.
3 * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License. You may obtain a copy
5 * of the License at http://www.apache.org/licenses/LICENSE-2.0
6 *
7 * Unless required by applicable law or agreed to in writing, software distributed under
8 * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9 * OF ANY KIND, either express or implied. See the License for the specific language
10 * governing permissions and limitations under the License.
11 */
12#pragma once
13
14#include <lagrange/SurfaceMesh.h>
15#include <lagrange/polyddg/DifferentialOperators.h>
16#include <lagrange/polyddg/api.h>
17
18#include <cstdint>
19#include <string_view>
20
21namespace lagrange::polyddg {
22
25
34{
36 double lambda = 1.0;
37
43 uint8_t nrosy = 1;
44
48 std::string_view input_attribute = "@hodge_input";
49
53 std::string_view exact_attribute = "@hodge_exact";
54
58 std::string_view coexact_attribute = "@hodge_coexact";
59
63 std::string_view harmonic_attribute = "@hodge_harmonic";
64};
65
84
85// ---- 1-form level -----------------------------------------------------------
86
113template <typename Scalar, typename Index>
117 HodgeDecompositionOptions options = {});
118
122template <typename Scalar, typename Index>
123LA_POLYDDG_API HodgeDecompositionResult hodge_decomposition_1_form(
125 HodgeDecompositionOptions options = {});
126
127// ---- Per-vertex vector field level ------------------------------------------
128
159template <typename Scalar, typename Index>
160LA_POLYDDG_API HodgeDecompositionResult hodge_decomposition_vector_field(
161 SurfaceMesh<Scalar, Index>& mesh,
162 const DifferentialOperators<Scalar, Index>& ops,
163 HodgeDecompositionOptions options = {});
164
168template <typename Scalar, typename Index>
170 SurfaceMesh<Scalar, Index>& mesh,
171 HodgeDecompositionOptions options = {});
172
174
175} // namespace lagrange::polyddg
A general purpose polygonal mesh class.
Definition SurfaceMesh.h:73
Polygonal mesh discrete differential operators.
Definition DifferentialOperators.h:38
uint32_t AttributeId
Identified to be used to access an attribute.
Definition AttributeFwd.h:73
constexpr AttributeId invalid_attribute_id()
Invalid attribute id.
Definition AttributeFwd.h:76
LA_POLYDDG_API HodgeDecompositionResult hodge_decomposition_vector_field(SurfaceMesh< Scalar, Index > &mesh, const DifferentialOperators< Scalar, Index > &ops, HodgeDecompositionOptions options={})
Compute the Helmholtz-Hodge decomposition of a per-vertex vector field on a surface mesh.
Definition hodge_decomposition.cpp:226
LA_POLYDDG_API HodgeDecompositionResult hodge_decomposition_1_form(SurfaceMesh< Scalar, Index > &mesh, const DifferentialOperators< Scalar, Index > &ops, HodgeDecompositionOptions options={})
Compute the Helmholtz-Hodge decomposition of a 1-form on a closed surface mesh.
Definition hodge_decomposition.cpp:40
Options for Hodge decomposition functions.
Definition hodge_decomposition.h:34
std::string_view harmonic_attribute
Output attribute name for the harmonic component.
Definition hodge_decomposition.h:63
double lambda
Stabilization weight for the VEM 1-form inner product.
Definition hodge_decomposition.h:36
std::string_view exact_attribute
Output attribute name for the exact component.
Definition hodge_decomposition.h:53
std::string_view coexact_attribute
Output attribute name for the co-exact component.
Definition hodge_decomposition.h:58
std::string_view input_attribute
Input attribute name.
Definition hodge_decomposition.h:48
uint8_t nrosy
N-rosy symmetry order.
Definition hodge_decomposition.h:43
Result of Hodge decomposition functions.
Definition hodge_decomposition.h:74
AttributeId harmonic_id
Attribute ID of the harmonic component.
Definition hodge_decomposition.h:82
AttributeId coexact_id
Attribute ID of the co-exact component.
Definition hodge_decomposition.h:79
AttributeId exact_id
Attribute ID of the exact component.
Definition hodge_decomposition.h:76