Skip to content

Commit

Permalink
MATLAB examples update, fix projection default args (#38)
Browse files Browse the repository at this point in the history
* Remove old interface example
* Fix deafault args on projection
* Fix element integral demos
  • Loading branch information
samuelpowell authored Oct 20, 2022
1 parent b5dc206 commit aa811c9
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 223 deletions.
5 changes: 1 addition & 4 deletions NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,16 @@

- Investigate `warning C4910` on MSVC - some declspec conflict
- Look at `fwdsolver_mw.h` instantiation requirements, determine appropriate preprocessor gaurd (e.g. Clang?)
- MATLAB QM are always complex, will crash on forward solve with real (NB interleaved API motivation)
- MATLAB gmsh reader out of date
- MATLAB complex outputs on QM
- MATLAB flourescence example performance
- MATLAB Fix `element_integrals.m` example dimensionality problems
- Interleaved API permits shallow copy of various inputs in the MATLAB interface to reduce round-trip, exploit
- Review element types in libfe, some contain unfinished defintions of operators and constants, remove
- Move semantics for mathlib vectors and matrices
- Improved initialisation for element entries
- Check propensity for structural nonzeros viz. direct solvers
- Resolve versioning
- Python interface build assumes Release paths on Windows
- Default link list after make mesh appears arbitrary, resulting in enormous linklist/qmvec
- Real qvec on forward solver crash

## Perfromance

Expand Down
209 changes: 0 additions & 209 deletions script/matlab/demos/toast_tut1.m

This file was deleted.

12 changes: 6 additions & 6 deletions script/matlab/examples/element_integrals.m
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@
% Now do the same with a numerical quadrature rule
qwght = 1/6 * [1 1 1];
qabsc = [1/2,0; 0,1/2; 1/2,1/2]';
fun = el.ShapeFun(qabsc);
der = el.ShapeDer(qabsc);
fun = el.ShapeFun(qabsc); % nn x np
der = el.ShapeDer(qabsc'); % nn x d x np
intf_numeric = zeros(3,1);
for q=1:3
jac = der(:,:,q)*vtx;
jac = der(:,:,q)'*vtx;
v = qwght(q) * det(jac);
intf_numeric = intf_numeric + v*fun(:,q);
end
Expand All @@ -63,7 +63,7 @@
% And the numerical quadrature version
intff_numeric = zeros(3,3);
for q=1:3
jac = der(:,:,q)*vtx;
jac = der(:,:,q)'*vtx;
v = qwght(q) * det(jac);
intff_numeric = intff_numeric + v * (fun(:,q) * fun(:,q)');
end
Expand All @@ -86,10 +86,10 @@
% And the numerical quadrature version
intdd_numeric = zeros(3,3);
for q=1:3
jac = der(:,:,q)*vtx;
jac = der(:,:,q)'*vtx;
ijac = inv(jac);
v = qwght(q) * det(jac);
ider = ijac*der(:,:,q);
ider = ijac*der(:,:,q)';
intdd_numeric = intdd_numeric + v * (ider' * ider);
end

Expand Down
2 changes: 1 addition & 1 deletion script/matlab/examples/fwd1_aniso3D.m
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
function tmp
close all

meshdir = '.../meshes/3D/';
meshdir = '../meshes/3D/';
hmesh = toastMesh([meshdir 'cyl3.msh']);
hmesh.ReadQM([meshdir 'cyl_3ring.qm']);

Expand Down
8 changes: 5 additions & 3 deletions script/matlab/toast/toastProject.m
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,14 @@
% is, unused source-detector combinations are removed from the result.

% Subsititute missing parameters with defaults
if nargin < 8
solver = 'direct';
elseif nargin < 9
if nargin < 9
tol = 1e-10;
end

if nargin < 8
solver = 'direct';
end

% Calculate system matrix
phi = toastFields(hMesh, 0, qvec, mua, mus, ref, omega, solver, tol, 'auto');

Expand Down

0 comments on commit aa811c9

Please sign in to comment.