Skip to content

Commit

Permalink
Use GaussLegendre quadrature for computation of Taylor factor
Browse files Browse the repository at this point in the history
GaussLegendre quadrature needs less evaluation points but is slightly more expansive in NSOFT.
In the case of the taylor model the evaluation process is very expansive.
  • Loading branch information
num3RIK committed Sep 5, 2023
1 parent bdc11a7 commit 7e3e495
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
8 changes: 6 additions & 2 deletions SO3Fun/@SO3FunHarmonic/quadrature.m
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,12 @@
% Curtis quadrature grid in fundamental region.
% Therefore adjust the bandwidth to crystal and specimen symmetry.
bw = adjustBandwidth(N,SRight,SLeft);
SO3G = quadratureSO3Grid(bw,'ClenshawCurtis',SRight,SLeft,'ABG');

if check_option(varargin,'GaussLegendre')
SO3G = quadratureSO3Grid(bw,'GaussLegendre',SRight,SLeft,'ABG');
else
SO3G = quadratureSO3Grid(bw,'ClenshawCurtis',SRight,SLeft,'ABG');
end

% Only evaluate unique orientations
values = f.eval(SO3G);

Expand Down
3 changes: 2 additions & 1 deletion TensorAnalysis/@strainTensor/calcTaylor.m
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@
bw = get_option(varargin,'bandwidth',32);
numOut = nargout;
F = SO3FunHandle(@(rot) calcTaylorFun(rot,eps,sS,numOut,varargin{:}),sS.CS,eps.CS);
SO3F = SO3FunHarmonic(F,'bandwidth',bw);
% Use Gauss-Legendre quadrature, since the evaluation process is very expansive
SO3F = SO3FunHarmonic(F,'bandwidth',bw,'GaussLegendre');
M = SO3F(1);
if nargout>1
b = [];
Expand Down

0 comments on commit 7e3e495

Please sign in to comment.