Skip to content

Commit

Permalink
Refactor dmas scripts/funs
Browse files Browse the repository at this point in the history
  • Loading branch information
tsipkens committed Jul 9, 2022
1 parent fe46f65 commit abc876d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
12 changes: 6 additions & 6 deletions +kernel/gen_dmas_grid.m
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@

% GEN_DMA_DMA_GRID Evaluate kernel/transfer functions for DMA-DMA.
% GEN_DMAS_GRID Evaluate kernel/transfer functions for DMA-DMA.
% This function exploits the grid structure of the data and
% reconstruction domain to speed computation.
%
% A = kernel.gen_pma_dma_grid(GRID_B,GRID_I) uses the data grid, GRID_B,
% A = kernel.gen_dmas_grid(GRID_B,GRID_I) uses the data grid, GRID_B,
% and integration grid, GRID_I, which is generally higher resolution.
%
% A = kernel.gen_pma_dma_grid(GRID_B,GRID_I,PROP_DMA1) uses the
% A = kernel.gen_dmas_grid(GRID_B,GRID_I,PROP_DMA1) uses the
% pre-computed DMA properties in PROP_DMA1 for the first DMA.
%
% A = kernel.gen_pma_dma_grid(GRID_B,GRID_I,PROP_DMA1,PROP_DMA2) adds an
% A = kernel.gen_dmas_grid(GRID_B,GRID_I,PROP_DMA1,PROP_DMA2) adds an
% inputs for the properties of the second DMA.
%
% A = kernel.gen_pma_dma_grid(...,B_NEUT) adds a boolean flag of whether
% A = kernel.gen_dmas_grid(...,B_NEUT) adds a boolean flag of whether
% the particles are reneutralized.
%
% ------------------------------------------------------------------------
Expand All @@ -24,7 +24,7 @@
%
% AUTHOR: Timothy Sipkens, 2018-11-27

function A = gen_dma_dma_grid(grid_b, grid_i, prop_dma1, prop_dma2, b_neut, varargin)
function A = gen_dmas_grid(grid_b, grid_i, prop_dma1, prop_dma2, b_neut, varargin)

if ~exist('prop_dma1','var'); prop_dma1 = []; end
if ~exist('prop_dma2','var'); prop_dma2 = []; end
Expand Down
9 changes: 4 additions & 5 deletions main_dma_dma.m → main_dmas.m
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@

% MAIN_DMA_DMA Script for doing tandem DMA inversion.
% MAIN_DMAS Script for doing tandem DMA inversion.
% This case is for a HTDMA setup also showing growth factors.
%
% Author: Timothy Sipkens, 2022-06-28
%=========================================================================%

clear;
clc;
Expand Down Expand Up @@ -31,7 +30,7 @@

%== Generate x vector on coarser grid ====================================%
% This will be used later to gauge accuracy of reconstructions
n_x = [70,80]; % number of elements per dimension in x
n_x = [20,32]; % number of elements per dimension in x
% [20,32]; % used for plotting projections of basis functions
% [40,64]; % used in evaluating previous versions of regularization

Expand Down Expand Up @@ -63,8 +62,8 @@
prop_dma = kernel.prop_dma

% Generate A matrix based on grid for x and b.
A = kernel.gen_dma_dma_grid(grid_b, grid_x, prop_dma, prop_dma);
A2 = kernel.gen_dma_dma_grid(grid_b, grid_x, prop_dma, prop_dma, 0);
A = kernel.gen_dmas_grid(grid_b, grid_x, prop_dma, prop_dma);
A2 = kernel.gen_dmas_grid(grid_b, grid_x, prop_dma, prop_dma, 0);

idx = round(2 * grid_b.Ne / 3);
grid_b.elements(idx,:)
Expand Down

0 comments on commit abc876d

Please sign in to comment.