"""
pysurfacefun
============
High-order patch-based tools for solving variable-coefficient elliptic
partial differential equations on smooth surfaces.
The implementation uses Chebyshev surface patches, strong-form surface
differentiation, local patch solution operators, and hierarchical
Schur-complement merging for fast repeated elliptic solves.
"""
from .core import (
PDO,
SurfaceFunction,
SurfaceMesh,
SurfaceOp,
SurfaceVectorFunction,
boundingbox,
chebpts,
chebpts2,
compose,
conj,
cos,
cross,
div,
divergence,
diff,
diffmat,
diffx,
diffy,
diffz,
dot,
exp,
from_rhino,
grad,
gradient,
hodge,
imag,
integral,
integral2,
lap,
laplacian,
log,
log10,
maxEst,
mean2,
minEst,
norm,
normal,
normalize,
plot_surface,
plot_vector_field,
prolong,
real,
real_spherical_harmonic,
randnfun3,
resample as _quad_resample,
resample_mesh as _quad_resample_mesh,
sin,
solve_laplace_beltrami_sphere,
sphere,
sqrt,
stellarator,
surfacearea,
surfacefun,
surfacefunv,
surfaceop,
sum2,
torus,
vector_norm,
write_vtu,
smooth_random_function_3d,
)
from .tri import (
LevelSetSurface,
TriangleSurfaceFunction,
TriangleSurfaceMesh,
TriangleSurfaceOp,
extract_tri_mesh_arrays,
icosphere_tri,
koornwinder_pkd,
levelset_surface,
levelset_surface_quad,
levelset_surface_tri,
levelset_surface_tri_from_mat,
load_mat_tri_mesh,
load_mat_surface_mesh,
node_family_points,
orient_tri_faces_outward,
plot_wireframe,
plot_tri_surface,
project_to_levelset,
recursive_nodes,
refine_quad_mesh,
refine_surface_mesh,
refine_tri_mesh,
reference_triangle_quadrature_weights,
shifted_lobatto_nodes,
surface_mesh_arrays,
triangle_boundary_meshio_mesh,
triangle_meshio_mesh,
triangle_surface_mesh_arrays,
tri_edge_indices,
tri_patch_boundary_segments,
tri_wireframe_edge_indices,
tri_resample,
tri_resample_mesh,
tri_resampled_patch_geometry,
tri_resampled_patch_values,
tri_diff,
tri_integral2,
tri_lap,
tri_reference_nodes,
tri_strong_diffmat,
tri_surfacearea,
tri_surfacefun,
tri_surfaceop,
triangulate_faces,
trilattice,
write_tri_patch_boundaries_vtp,
write_tri_vtp,
write_tri_vtu,
write_triangle_meshio,
wireframe,
)
[docs]
def resample(obj, n: int):
"""Resample a scalar surface function or surface mesh."""
if isinstance(obj, TriangleSurfaceFunction):
return tri_resample(obj, n)
if isinstance(obj, TriangleSurfaceMesh):
return tri_resample_mesh(obj, n)
if isinstance(obj, SurfaceFunction):
return _quad_resample(obj, n)
if isinstance(obj, SurfaceMesh):
return _quad_resample_mesh(obj, n)
raise TypeError("resample expects a surface function or surface mesh")
[docs]
def resample_mesh(dom, n: int):
"""Resample a quadrilateral or triangular surface mesh."""
if isinstance(dom, TriangleSurfaceMesh):
return tri_resample_mesh(dom, n)
if isinstance(dom, SurfaceMesh):
return _quad_resample_mesh(dom, n)
raise TypeError("resample_mesh expects a surface mesh")
__all__ = [
"PDO",
"SurfaceFunction",
"SurfaceMesh",
"SurfaceOp",
"SurfaceVectorFunction",
"boundingbox",
"chebpts",
"chebpts2",
"compose",
"conj",
"cos",
"cross",
"div",
"divergence",
"diff",
"diffmat",
"diffx",
"diffy",
"diffz",
"dot",
"exp",
"from_rhino",
"grad",
"gradient",
"hodge",
"imag",
"integral",
"integral2",
"lap",
"laplacian",
"log",
"log10",
"maxEst",
"mean2",
"minEst",
"norm",
"normal",
"normalize",
"plot_surface",
"plot_vector_field",
"prolong",
"real",
"real_spherical_harmonic",
"randnfun3",
"resample",
"resample_mesh",
"sin",
"solve_laplace_beltrami_sphere",
"sphere",
"sqrt",
"stellarator",
"smooth_random_function_3d",
"surfacearea",
"surfacefun",
"surfacefunv",
"surfaceop",
"sum2",
"torus",
"vector_norm",
"write_vtu",
"LevelSetSurface",
"TriangleSurfaceFunction",
"TriangleSurfaceMesh",
"TriangleSurfaceOp",
"extract_tri_mesh_arrays",
"icosphere_tri",
"koornwinder_pkd",
"levelset_surface",
"levelset_surface_quad",
"levelset_surface_tri",
"levelset_surface_tri_from_mat",
"load_mat_tri_mesh",
"load_mat_surface_mesh",
"node_family_points",
"orient_tri_faces_outward",
"plot_wireframe",
"plot_tri_surface",
"project_to_levelset",
"recursive_nodes",
"refine_quad_mesh",
"refine_surface_mesh",
"refine_tri_mesh",
"reference_triangle_quadrature_weights",
"shifted_lobatto_nodes",
"surface_mesh_arrays",
"triangle_boundary_meshio_mesh",
"triangle_meshio_mesh",
"triangle_surface_mesh_arrays",
"tri_edge_indices",
"tri_patch_boundary_segments",
"tri_wireframe_edge_indices",
"tri_resample",
"tri_resample_mesh",
"tri_resampled_patch_geometry",
"tri_resampled_patch_values",
"tri_diff",
"tri_integral2",
"tri_lap",
"tri_reference_nodes",
"tri_strong_diffmat",
"tri_surfacearea",
"tri_surfacefun",
"tri_surfaceop",
"triangulate_faces",
"trilattice",
"write_tri_patch_boundaries_vtp",
"write_tri_vtp",
"write_tri_vtu",
"write_triangle_meshio",
"wireframe",
]