From abc876d7797d9360709f87fba06a4131b7b95116 Mon Sep 17 00:00:00 2001 From: Timothy Sipkens Date: Fri, 8 Jul 2022 21:10:37 -0400 Subject: [PATCH] Refactor dmas scripts/funs --- +kernel/gen_dmas_grid.m | 12 ++++++------ main_dma_dma.m => main_dmas.m | 9 ++++----- 2 files changed, 10 insertions(+), 11 deletions(-) rename main_dma_dma.m => main_dmas.m (89%) diff --git a/+kernel/gen_dmas_grid.m b/+kernel/gen_dmas_grid.m index 6534935..ce5370d 100644 --- a/+kernel/gen_dmas_grid.m +++ b/+kernel/gen_dmas_grid.m @@ -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. % % ------------------------------------------------------------------------ @@ -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 diff --git a/main_dma_dma.m b/main_dmas.m similarity index 89% rename from main_dma_dma.m rename to main_dmas.m index a0864a4..c001dca 100644 --- a/main_dma_dma.m +++ b/main_dmas.m @@ -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; @@ -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 @@ -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,:)