Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions matlab/@surfer/lap_n_op.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
function lapn = lap_n_op(obj)
% lapn = shape_op(S,p)
% This subroutine evaluates the surface Laplacian of the surface normal
% vector
%
% Input arguments:
% * obj: surfer object
%
% Output arguments:
% * lapn: double (3,S.npts)
%
n = obj.n;
[lapnx] = get_surface_laplacian(obj,n(1,:));
[lapny] = get_surface_laplacian(obj,n(2,:));
[lapnz] = get_surface_laplacian(obj,n(3,:));

lapn = [lapnx;lapny;lapnz];
end
38 changes: 38 additions & 0 deletions matlab/@surfer/shape_op.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
function shape = shape_op(obj)
% shape = shape_op(S)
% This subroutine evaluates the shape operator of a surface in
% cartesian coordinates.
%
% The shape operator is defined to be surface gradient of the surface
% normal.
%
% Input arguments:
% * obj: surfer object
%
% Output arguments:
% * shape: double (3,3,S.npts)
%
ffrm2 = cell2mat(obj.sfform);
ffrm2 = reshape(ffrm2, 2, obj.npatches, 2,[]);
ffrm2 = permute(ffrm2,[1,3,4,2]); ffrm2= ffrm2(:,:,:);

iffrm = cell2mat(obj.ffforminv);
iffrm = reshape(iffrm, 2, obj.npatches, 2,[]);
iffrm = permute(iffrm,[1,3,4,2]); iffrm= iffrm(:,:,:);

shape_red = pagemtimes(iffrm,ffrm2);
shape_red = pagemtimes(shape_red,iffrm);

du = obj.du;
dv = obj.dv;

X = zeros(3,2,obj.npts);
XT= zeros(2,3,obj.npts);

X(:,1,:) = du;
X(:,2,:) = dv;
XT(1,:,:) = du;
XT(2,:,:) = dv;

shape = pagemtimes(pagemtimes(X,shape_red),XT);
end
3 changes: 3 additions & 0 deletions matlab/@surfer/surfer.m
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
mean_curv % mean curvatures at nodes (npts*1)
ffform % cell array of first fundamental forms at nodes (2,2,npts)
ffforminv % cell array of inverses of ffforms at nodes (2,2,npts)
sfform % cell array of second fundamental forms at nodes (2,2,npts)
aspect_ratio % measure of local aspect ratio of patch, (npts,1);
patch_distortion % integral of aspect ratio
cms % centroid location of patches (3,npatches)
Expand Down Expand Up @@ -223,6 +224,7 @@
obj.mean_curv = zeros(obj.npts,1);
obj.ffforminv = cell(npatches,1);
obj.ffform = cell(npatches,1);
obj.sfform = cell(npatches,1);
obj.aspect_ratio = zeros(obj.npts,1);
obj.patch_distortion = zeros(obj.npatches,1);
obj.cms = zeros(3,obj.npatches);
Expand Down Expand Up @@ -282,6 +284,7 @@
sfform(2,1,iind) = M;
sfform(2,2,iind) = N;

obj.sfform{i} = sfform(:,:,iind);
% Mean curvature (LG-2MF+NE)/2(EG-F^2):
obj.mean_curv(iind) = -0.5*(L.*dvnormsq - ...
2*M.*duv + dunormsq.*N).*ddinv;
Expand Down
2 changes: 1 addition & 1 deletion matlab/src/get_oversampling_parameters.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function [novers, varargout] = get_oversampling_parameters(S, Q, eps)
function [novers,varargout] = get_oversampling_parameters(S,Q,eps)
%
% get_oversampling_parameters
% subroutine to estimate the oversampling paramters for a given
Expand Down