setGeomSim

Set geometry and simulation.

Contents

Syntax

seti = setGeomSim(seti)
seti = setGeomSim(seti,dispDepth)
seti = setGeomSim(seti,dispDepth,out)

Description

seti = setGeomSim(seti) sets geometry and simulation, i.e. essentially set general settings for figures, the grids (computational domain (CD) and region of interest (ROI)), the kernel, the experimental set-up, and the predefined contrast.

seti = setGeomSim(seti,dispDepth) does the same, but allows to control the depth of displayed messages by dispDepth.

seti = setGeomSim(seti,dispDepth,out) additionally plots the figures in case of out = 1 and also saves them in case of out = 2.

Example

init;
seti = struct;
seti = setGeomSim(seti);

Input Arguments

Optional Input Arguments

Output Arguments

Following parameters can be set by user (otherwise default is set):

Subfunction: setFigureSettings

Following parameters can be set by user (otherwise default is set):

References

See Also

Code: setGeomSim

function seti = setGeomSim(seti,varargin)

if nargin == 2
    dispDepth = varargin{1};
    out = 0;
elseif nargin == 3
    dispDepth = varargin{1};
    out = varargin{2};
else
    dispDepth = 0;
    out = 0;
end

seti = checkfield(seti,'tol',1E-6,dispDepth); % used in solveLippmannSchwinger (as GMRES tolerance)

seti = setFigureSettings(seti,dispDepth);

dispMessage(' - setGrid - ',dispDepth);
seti = setGrid(seti,dispDepth);

dispMessage(' - setReshapeVecMat - ',dispDepth);
seti = setReshapeVecMat(seti);

dispMessage(' - setGridScale - ',dispDepth);
seti = setGridScale(seti,dispDepth);

dispMessage(' - setIdImagReal - ',dispDepth);
seti = setIdImagReal(seti);

dispMessage(' - setKernel - ',dispDepth);
seti = setKernel(seti,dispDepth);

dispMessage(' - expSetup - ',dispDepth);
seti = expSetup(seti,dispDepth,out);

dispMessage(' - setContrast - ',dispDepth);
seti = setContrast(seti,dispDepth,out);
if dispDepth >= 1
    fprintf('   qROIexact: real [%+3.2f,%+3.2f], imag [%+3.2f,%+3.2f].\n',...
        min(real(seti.qROIexact)),max(real(seti.qROIexact)),min(imag(seti.qROIexact)),max(imag(seti.qROIexact)));
end

seti = checkfield(seti,'mCD',0,dispDepth);
if seti.mCD ~= 0 % no coarse grid is used (default)
    dispMessage(' ',dispDepth);
    dispMessage(' - set coarse grid - ',dispDepth);
    dispMessage('Warning: changes in seti have to be copied to seti.setiM from now on!) --',dispDepth);
    dispMessage('---- setCoarse start ------------------------------',dispDepth);
    seti = setCoarse(seti);
    dispMessage('---- setCoarse end --------------------------------',dispDepth);
    dispMessage(' ',dispDepth);
end

end

Code: subfunction: dispMessage

function dispMessage(string,dispDepth)
if dispDepth >= 1
    disp(string)
end
end

Code: subfunction: setFigureSettings

Set general settings for figures.

function seti  = setFigureSettings(seti,varargin)

if nargin == 2
    dispDepth = varargin{1};
else
    dispDepth = 0;
end

seti = checkfield(seti,'plotFreq',1,dispDepth); % of outer iteration...

seti = checkfield(seti,'colormap','litman',dispDepth);

seti = checkfield(seti,'usecbarlim',1,dispDepth);

if seti.usecbarlim == 1
    seti = checkfield(seti,'cbarlim',[-0.2,1.4],dispDepth); % for contrasts
end

seti = checkfield(seti,'faceColor3D','red',dispDepth); % FaceColor in contourPlotROI

seti = checkfield(seti,'plotPublish',0,dispDepth);
seti = checkfield(seti,'pubFontSize',20,dispDepth);

seti = checkfield(seti,'plotVisible','off',dispDepth); % on or off (default)

% Image formats
seti = checkfield(seti,'savepng',1,dispDepth);
seti = checkfield(seti,'saveepsc',0,dispDepth);
seti = checkfield(seti,'savefig',0,dispDepth);

% Frequency of plots inside pda (not in public version... is experimentally...)
% (is used in pda.m to call plotInsidePda.m)
seti = checkfield(seti,'plotFreqiPda',0,dispDepth);

end