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 <string_view>
20
21namespace lagrange::polyddg {
22
25
30{
33 uint8_t nrosy = 4;
34
36 double lambda = 1.0;
37
43 std::string_view alignment_attribute = "";
44
51 double alignment_weight = 1.0;
52
54 std::string_view direction_field_attribute = "@smooth_direction_field";
55};
56
75template <typename Scalar, typename Index>
79 SmoothDirectionFieldOptions options = {});
80
82
83} // 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
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:33
Options for compute_smooth_direction_field().
Definition compute_smooth_direction_field.h:30
std::string_view alignment_attribute
Name of a per-vertex 3-D tangent vector field attribute used as alignment constraints.
Definition compute_smooth_direction_field.h:43
double lambda
Stabilization weight for the VEM projection term in the connection Laplacian.
Definition compute_smooth_direction_field.h:36
std::string_view direction_field_attribute
Output attribute name for the smooth direction field (3-D vector, per vertex).
Definition compute_smooth_direction_field.h:54
uint8_t nrosy
Symmetry order of the direction field (e.g.
Definition compute_smooth_direction_field.h:33
double alignment_weight
Scaling factor for the spectral shift in the alignment solve, following the fieldgen formulation (Knö...
Definition compute_smooth_direction_field.h:51