Skip to content

Commit e0fba63

Browse files
committed
store second fundamental form
1 parent f336862 commit e0fba63

File tree

4 files changed

+11
-81
lines changed

4 files changed

+11
-81
lines changed

matlab/@surfer/shape_op.m

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
function shape = shape_op(obj)
2-
% shape = shape_op(S,p)
2+
% shape = shape_op(S)
33
% This subroutine evaluates the shape operator of a surface in
44
% cartesian coordinates.
55
%
@@ -12,16 +12,13 @@
1212
% Output arguments:
1313
% * shape: double (3,3,S.npts)
1414
%
15-
ffrm = get_first_fundamental_form(obj);
16-
ffrm2 = get_second_fundamental_form(obj);
17-
15+
ffrm2 = cell2mat(obj.sfform);
16+
ffrm2 = reshape(ffrm2, 2, obj.npatches, 2,[]);
17+
ffrm2 = permute(ffrm2,[1,3,4,2]); ffrm2= ffrm2(:,:,:);
1818

19-
dffrm = ffrm(1,1,:).*ffrm(2,2,:)-ffrm(1,2,:).*ffrm(2,1,:);
20-
iffrm = ffrm;
21-
iffrm(1,1,:) = ffrm(2,2,:)./dffrm;
22-
iffrm(2,2,:) = ffrm(1,1,:)./dffrm;
23-
iffrm(1,2,:) = -ffrm(1,2,:)./dffrm;
24-
iffrm(2,1,:) = -ffrm(2,1,:)./dffrm;
19+
iffrm = cell2mat(obj.ffforminv);
20+
iffrm = reshape(iffrm, 2, obj.npatches, 2,[]);
21+
iffrm = permute(iffrm,[1,3,4,2]); iffrm= iffrm(:,:,:);
2522

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

matlab/@surfer/surfer.m

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@
9292
mean_curv % mean curvatures at nodes (npts*1)
9393
ffform % cell array of first fundamental forms at nodes (2,2,npts)
9494
ffforminv % cell array of inverses of ffforms at nodes (2,2,npts)
95+
sfform % cell array of second fundamental forms at nodes (2,2,npts)
9596
aspect_ratio % measure of local aspect ratio of patch, (npts,1);
9697
patch_distortion % integral of aspect ratio
9798
cms % centroid location of patches (3,npatches)
@@ -223,6 +224,7 @@
223224
obj.mean_curv = zeros(obj.npts,1);
224225
obj.ffforminv = cell(npatches,1);
225226
obj.ffform = cell(npatches,1);
227+
obj.sfform = cell(npatches,1);
226228
obj.aspect_ratio = zeros(obj.npts,1);
227229
obj.patch_distortion = zeros(obj.npatches,1);
228230
obj.cms = zeros(3,obj.npatches);
@@ -282,6 +284,7 @@
282284
sfform(2,1,iind) = M;
283285
sfform(2,2,iind) = N;
284286

287+
obj.sfform{i} = sfform(:,:,iind);
285288
% Mean curvature (LG-2MF+NE)/2(EG-F^2):
286289
obj.mean_curv(iind) = -0.5*(L.*dvnormsq - ...
287290
2*M.*duv + dunormsq.*N).*ddinv;

matlab/fmm3dbie_routs.mw

Lines changed: 0 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -684,76 +684,6 @@ end
684684
%
685685
%
686686
%
687-
@ src/get_first_fundamental_form.m
688-
function [ffrm] = get_first_fundamental_form(S,p,varargin)
689-
%
690-
%
691-
%
692-
%
693-
% Input arguments:
694-
% * S: surfer object
695-
% * opts: options struct (optional)
696-
%
697-
% Output arguments:
698-
%
699-
700-
opts = [];
701-
if(nargin == 2)
702-
opts = varargin{1};
703-
end
704-
705-
% Extract arrays
706-
[srcvals,srccoefs,norders,ixyzs,iptype,wts] = extract_arrays(S);
707-
[n12,npts] = size(srcvals);
708-
[n9,~] = size(srccoefs);
709-
[npatches,~] = size(norders);
710-
npatp1 = npatches+1;
711-
712-
713-
ffrm = zeros(4,npts);
714-
# FORTRAN get_first_fundamental_form(int[1] npatches, int[npatches] norders, int[npatp1] ixyzs, int[npatches] iptype, int[1] npts, double[n9,npts] srccoefs, double[n12,npts] srcvals, inout double[4,npts] ffrm);
715-
716-
ffrm = reshape(ffrm,[2,2,npts]);
717-
718-
end
719-
720-
%
721-
%
722-
%
723-
%
724-
%
725-
@ src/get_second_fundamental_form.m
726-
function [ffrm] = get_second_fundamental_form(S,p,varargin)
727-
%
728-
%
729-
%
730-
%
731-
% Input arguments:
732-
% * S: surfer object
733-
% * opts: options struct (optional)
734-
%
735-
% Output arguments:
736-
%
737-
738-
opts = [];
739-
if(nargin == 2)
740-
opts = varargin{1};
741-
end
742-
743-
% Extract arrays
744-
[srcvals,srccoefs,norders,ixyzs,iptype,wts] = extract_arrays(S);
745-
[n12,npts] = size(srcvals);
746-
[n9,~] = size(srccoefs);
747-
[npatches,~] = size(norders);
748-
npatp1 = npatches+1;
749-
750-
751-
ffrm = zeros(4,npts);
752-
# FORTRAN get_second_fundamental_form(int[1] npatches, int[npatches] norders, int[npatp1] ixyzs, int[npatches] iptype, int[1] npts, double[n9,npts] srccoefs, double[n12,npts] srcvals, inout double[4,npts] ffrm);
753-
754-
ffrm = reshape(ffrm,[2,2,npts]);
755-
756-
end
757687

758688
%-------------------------------------------------
759689
%

matlab/src/get_oversampling_parameters.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
function [novers, varargout] = get_oversampling_parameters(S, Q, eps)
1+
function [novers,varargout] = get_oversampling_parameters(S,Q,eps)
22
%
33
% get_oversampling_parameters
44
% subroutine to estimate the oversampling paramters for a given

0 commit comments

Comments
 (0)