-
Notifications
You must be signed in to change notification settings - Fork 188
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #318 from mtex-toolbox/develop
MTEX 5.0.1
- Loading branch information
Showing
73 changed files
with
824 additions
and
204 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 |
---|---|---|
@@ -1 +1 @@ | ||
help/doc/ReleaseNotes/mtex_about.m | ||
doc/ReleaseNotes/mtex_about.m |
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 +1 @@ | ||
help/doc/ReleaseNotes/changelog.m | ||
doc/ReleaseNotes/changelog.m |
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 |
---|---|---|
@@ -1 +1 @@ | ||
help/doc/GettingStarted/installation.m | ||
doc/GettingStarted/installation.m |
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,11 @@ | ||
classdef S2AxisField | ||
% a class represeneting a axis field on the sphere | ||
|
||
methods | ||
|
||
function AF = S2AxisField(varargin) | ||
end | ||
|
||
end | ||
|
||
end |
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,53 @@ | ||
classdef S2AxisFieldTri < S2AxisField | ||
% a class represeneting a function on the sphere | ||
|
||
properties | ||
tri % S2Triangulation | ||
values = vector3d % function values | ||
end | ||
|
||
properties (Dependent = true) | ||
vertices | ||
antipodal | ||
end | ||
|
||
methods | ||
|
||
function sVF = S2AxisFieldTri(nodes,values) | ||
% initialize a spherical vector field | ||
|
||
if nargin == 0, return; end | ||
|
||
if isa(nodes,'function_handle') | ||
n = equispacedS2Grid('resolution',1.5*degree); | ||
values = nodes(n); | ||
nodes = n; | ||
end | ||
|
||
if isa(nodes,'S2Triangulation') | ||
sVF.tri = nodes; | ||
else | ||
sVF.tri = S2Triangulation(nodes); | ||
end | ||
|
||
sVF.values = values; | ||
|
||
end | ||
|
||
function v = get.vertices(S2F) | ||
v = S2F.tri.vertices; | ||
end | ||
|
||
function v = get.antipodal(S2F) | ||
v = S2F.tri.antipodal; | ||
end | ||
|
||
function S2F = set.vertices(S2F,v) | ||
if ~isempty(S2F.values), S2F.values = S2F.eval(v); end | ||
S2F.tri.vertices = v; | ||
S2F.tri.update; | ||
end | ||
|
||
end | ||
|
||
end |
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,16 @@ | ||
function sF = angle(varargin) | ||
% | ||
% Syntax | ||
% sVF = angle(sVF,sVF2) | ||
% sVF = angle(sVF,v) | ||
% | ||
% Input | ||
% sVF - @S2AxisFieldTri | ||
% sVF2 - @S2AxisField | ||
% v - @vector3d | ||
% | ||
% Output | ||
% sF - @S2FunTri | ||
% | ||
sF = dot(varargin{:}); | ||
sF.values = acos(sF.values); |
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,30 @@ | ||
function sVF = cross(sVF, a) | ||
% | ||
% Syntax | ||
% sVF = cross(sVF1,sVF2) | ||
% sVF = cross(sVF1,v) | ||
% | ||
% Input | ||
% sVF1 - @S2VectorFieldTri | ||
% sVF2 - @S2VectorField | ||
% v - @vector3d | ||
% | ||
% Output | ||
% sF - @S2VectorFieldTri | ||
% | ||
|
||
% first should be S2VectorFieldTri | ||
if ~isa(sVF,'S2AxisFieldTri') | ||
sVF = -cross(a, sVF); | ||
return | ||
end | ||
|
||
if isa(a,'vector3d') | ||
sVF.values = cross(sVF.values, a); | ||
elseif isa(a,'S2AxisFieldTri') || isa(a,'S2VectorFieldTri') | ||
sVF.values = cross(sVF.values, b.values); | ||
else | ||
sVF.values = cross(sVF.values, b.eval(sVF.vertices)); | ||
end | ||
|
||
end |
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,27 @@ | ||
function sF = dot(sVF, a, varargin) | ||
% | ||
% Syntax | ||
% sVF = dot(sVF,sVF2) | ||
% sVF = dot(sVF,v) | ||
% | ||
% Input | ||
% sVF - @S2AxisFieldTri | ||
% sVF2 - @S2AxisField | ||
% v - @vector3d | ||
% | ||
% Output | ||
% sF - @S2FunTri | ||
% | ||
|
||
% first should be S2VectorFieldTri | ||
if ~isa(sVF,'S2AxisFieldTri'), [sVF,a] = deal(a,sVF); end | ||
|
||
if isa(a,'vector3d') | ||
sF = S2FunTri(sVF.tri, dot(sVF.values, a, varargin{:})); | ||
elseif isa(a,'S2AxisFieldTri') || isa(a,'S2VectorFieldTri') | ||
sF = S2FunTri(sVF.tri, dot(sVF.values, b.values, varargin{:})); | ||
else | ||
sF = S2FunTri(sVF.tri, dot(sVF.values, b.eval(sVF.vertices), varargin{:})); | ||
end | ||
|
||
end |
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,29 @@ | ||
function v = eval(sVF,nodes) | ||
% | ||
% Syntax | ||
% v = eval(sFV,nodes) | ||
% | ||
% Input | ||
% sFV - @S2VectorField | ||
% nodes - interpolation nodes @vector3d | ||
% | ||
% Output | ||
% v - @vector3d | ||
% | ||
|
||
% compute bariocentric coordinates for interpolation | ||
bario = calcBario(sVF.tri,nodes); | ||
|
||
% interpolate in the space of symmetric 3x3 matrixes | ||
[x,y,z] = double(sVF.values); | ||
m = [x(:).*x(:),x(:).*y(:),y(:).*y(:),x(:).*z(:),y(:).*z(:),z(:).*z(:)]; | ||
M = bario * m; | ||
|
||
% go back to vectors by computing the eigen vectors of the interpolated 3x3 | ||
% matrices | ||
[v,~] = eig3(M(:,1),M(:,2),M(:,4),M(:,3),M(:,5),M(:,6)); | ||
|
||
% take only the largest eigenvector | ||
v = v(3,:).'; | ||
|
||
end |
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
Oops, something went wrong.