Lagrange
Loading...
Searching...
No Matches
compute_smooth_direction_field.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 <optional>
20#include <string_view>
21
22namespace lagrange::polyddg {
23
26
31{
34 uint8_t nrosy = 4;
35
43
46 double lambda = 1.0;
47
58 std::string_view alignment_attribute = "";
59
65 std::optional<std::string_view> direction_field_attribute;
66};
67
89template <typename Scalar, typename Index>
93 SmoothDirectionFieldOptions options = {});
94
98template <typename Scalar, typename Index>
101 SmoothDirectionFieldOptions options = {});
102
104
105} // 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
AttributeElement
Type of element to which the attribute is attached.
Definition AttributeFwd.h:26
@ Vertex
Per-vertex mesh attributes.
Definition AttributeFwd.h:28
LA_POLYDDG_API AttributeId compute_smooth_direction_field(SurfaceMesh< Scalar, Index > &mesh, const DifferentialOperators< Scalar, Index > &ops, SmoothDirectionFieldOptions options={})
Compute the globally smoothest n-direction field on a surface mesh.
Definition compute_smooth_direction_field.cpp:316
Options for compute_smooth_direction_field().
Definition compute_smooth_direction_field.h:31
std::string_view alignment_attribute
Name of an alignment constraint attribute used as soft constraints.
Definition compute_smooth_direction_field.h:58
double lambda
Stabilization weight for the VEM projection term in the connection Laplacian (vertex-based path only)...
Definition compute_smooth_direction_field.h:46
AttributeElement output_element_type
Controls where the output direction field is stored.
Definition compute_smooth_direction_field.h:42
std::optional< std::string_view > direction_field_attribute
Output attribute name for the smooth direction field.
Definition compute_smooth_direction_field.h:65
uint8_t nrosy
Symmetry order of the direction field (e.g.
Definition compute_smooth_direction_field.h:34