-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/fastalgorithms/chunkie in…
…to dev-chunkerkerneval
- Loading branch information
Showing
40 changed files
with
1,872 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# .readthedocs.yaml | ||
# Read the Docs configuration file | ||
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details | ||
|
||
# Required | ||
version: 2 | ||
|
||
# Set the OS, Python version and other tools you might need | ||
build: | ||
os: ubuntu-22.04 | ||
tools: | ||
python: "3.12" | ||
# You can also specify other tool versions: | ||
# nodejs: "19" | ||
# rust: "1.64" | ||
# golang: "1.19" | ||
|
||
# Build documentation in the "docs/" directory with Sphinx | ||
sphinx: | ||
configuration: docs/conf.py | ||
|
||
# Optionally build your docs in additional formats such as PDF and ePub | ||
# formats: | ||
# - epub | ||
|
||
# Optional but recommended, declare the Python requirements required | ||
# to build your documentation | ||
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html | ||
python: | ||
install: | ||
- requirements: docs/requirements.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,73 @@ | ||
classdef chunker | ||
%CHUNKER class which describes a curve divided into chunks (panels). | ||
%CHUNKER class which describes a curve divided into chunks (or "panels"). | ||
% | ||
% On each chunk the curve is represented by the values of its position, | ||
% first and second derivatives in parameter space on a Legendre grid. | ||
% first and second derivatives by scaled Legendre nodes. | ||
% | ||
% chunker properties: | ||
% k - integer, number of Legendre nodes on each chunk | ||
% nch - integer, number of chunks that make up the curve | ||
% dim - integer, dimension of the ambient space in which the curve is | ||
% embedded | ||
% npt - returns k*nch, the total number of points on the curve | ||
% r - dim x k x nch array, r(:,i,j) gives the coordinates of the ith | ||
% node on the jth chunk of the chunker | ||
% h - nch array of scaling factors for chunks. the chunk derivatives are | ||
% scaled as if the coordinates in r(:,:,j) are sampled on an | ||
% interval of length 2*h(j). This affects integration formulas. | ||
% d - dim x k x nch array, d(:,i,j) gives the time derivative of the | ||
% coordinate at the ith node on the jth chunk of the chunker | ||
% d2 - dim x k x nch array, d(:,i,j) gives the 2nd time derivative of the | ||
% coordinate at the ith node on the jth chunk of the chunker | ||
% n - dim x k x nch array of normals to the curve | ||
% data - datadim x k x nch array of data attached to chunker points | ||
% this data will be refined along with the chunker | ||
% adj - 2 x nch integer array. adj(1,j) is i.d. of the chunk that | ||
% precedes chunk j in parameter space. adj(2,j) is the i.d. of the | ||
% chunk which follows. if adj(i,j) is 0 then that end of the chunk | ||
% is a free end. if adj(i,j) is negative than that end of the chunk | ||
% meets with other chunk ends in a vertex. the specific negative | ||
% number acts as an i.d. of that vertex. | ||
% | ||
% chunker methods: | ||
% chunker(p,t,w) - construct an empty chunker with given preferences and | ||
% precomputed Legendre nodes/weights (optional) | ||
% obj = addchunk(obj,nchadd) - add nchadd chunks to the structure | ||
% (initialized with zeros) | ||
% obj = makedatarows(obj,nrows) - add nrows rows to the data storage. | ||
% [obj,info] = sort(obj) - sort the chunks so that adjacent chunks are | ||
% stored sequentially | ||
% [rn,dn,d2n,dist,tn,ichn] = nearest(obj,ref,ich,opts,u,xover,aover) - | ||
% find nearest point on chunker to ref | ||
% obj = reverse(obj) - reverse chunk orientation | ||
% rmin = min(obj) - minimum of coordinate values | ||
% rmax = max(obj) - maximum of coordinate values | ||
% wts = weights(obj) - scaled integration weights on curve | ||
% obj.n = normals(obj) - recompute normal vectors | ||
% onesmat = onesmat(obj) - matrix that corresponds to integration of a | ||
% density on the curve | ||
% rnormonesmat = normonesmat(obj) - matrix that corresponds to | ||
% integration of dot product of normal with vector density on | ||
% the curve | ||
% plot(obj,varargin) - plot the chunker curve | ||
% plot3(obj,idata,varargin) - 3D plot of the curve and one row of the | ||
% data storage | ||
% quiver(obj,varargin) - quiver plot of the chnkr points and normals | ||
% scatter(obj,varargin) - scatter plot of the chnkr nodes | ||
% tau = taus(obj) - unit tangents to curve | ||
% obj = refine(obj,varargin) - refine the curve | ||
% a = area(obj) - for a closed curve, area inside | ||
% s = arclength(obj) - get values of arclength along curve | ||
% kappa = signed_curvature(obj) - get signed curvature along curve | ||
% rflag = datares(obj,opts) - check if data in data rows is resolved | ||
% [rc,dc,d2c] = exps(obj) - get expansion coefficients for r,d,d2 | ||
% ier = checkadjinfo(obj) - checks that the adjacency info of the curve | ||
% is consistent | ||
% [inds,adjs,info] = sortinfo(obj) - attempts to sort the curve and finds | ||
% number of connected components, etc | ||
% [re,taue] = chunkends(obj,ich) - get the endpoints of chunks | ||
% flag = flagnear(obj,pts,opts) - flag points near the boundary | ||
|
||
|
||
% author: Travis Askham ([email protected]) | ||
|
||
|
@@ -49,6 +114,16 @@ | |
|
||
methods | ||
function obj = chunker(p,t,w) | ||
%CHUNKER construct an empty chunker with some default settings | ||
% | ||
% syntax: chnkr = chunker(p,t,w); | ||
% | ||
% optional input: | ||
% p - struct of preferences | ||
% p.k - integer, order to be used on chunks (16) | ||
% p.dim - integer, dimension of ambient space (2) | ||
% t, w - arrays of Legendre nodes and weights of order p.k | ||
% | ||
if nargin < 1 || isempty(p) | ||
p = chunkerpref(); | ||
else | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
function addpaths_loc() | ||
|
||
addpath('../'); | ||
addpath(genpath('../FLAM')); |
Oops, something went wrong.