Commit 476328d5 authored by Markus Mueller-Trapet's avatar Markus Mueller-Trapet

minor changes (language, typos, etc)

parent 00957f0f
......@@ -6,10 +6,16 @@ function value = getValueAtFrequency(varargin)
% </ITA-Toolbox>
if nargin < 4
if isa(varargin{1},'itaMeshBoundaryC'),this = varargin{1};
else error('getValueAtFrequency:: Wrong input argument'); end
if isnumeric(varargin{2}),freq = varargin{2};
else error('getValueAtFrequency:: Wrong input argument'); end
if isa(varargin{1},'itaMeshBoundaryC')
this = varargin{1};
else
error('getValueAtFrequency:: Wrong input argument');
end
if isnumeric(varargin{2})
freq = varargin{2};
else
error('getValueAtFrequency:: Wrong input argument');
end
if nargin == 2
%disp('getValueAtFrequency:: When I have no fluid informations, I choose c=343.7 m/s and rho = 1.2 kg/m!');
Z0 = 343.7*1.2;
......
......@@ -42,7 +42,7 @@ omegaO = 2*pi*(fGr+deltaFreqMax);
if fdependent == 0 % no frequency dependent boundary conditions
% eigenvalues / eigenvectors
[eVector, eValue] = polyeig(SysMat.S,1i*aYn,-SysMat.M/fluid.c^2);
h = waitbar(0,'Komplex Modulation: Pressure calculation is running...');
h = waitbar(0,'Complex Modulation: Pressure calculation is running...');
tic
% sort eigenvectors
[~, pos2] = sort(real(eValue));
......@@ -103,11 +103,11 @@ if fdependent == 0 % no frequency dependent boundary conditions
end
t2 = toc;
disp(' ');
disp('Time komplex');
disp('Time complex');
disp('-------------------------------------------------------------------');
disp(['Sortieren: ' num2str(t1)]);
disp(['Schleife : ' num2str(t2)]);
disp(['Gesamt : ' num2str(t1+t2)]);
disp(['Sorting: ' num2str(t1)]);
disp(['Loop : ' num2str(t2)]);
disp(['Total : ' num2str(t1+t2)]);
disp(' ');
close(h)
else % frequency dependent boundary conditions
......
......@@ -26,7 +26,7 @@ if nargin <6
else
if isnan(varargin{6})
mode = varargin{6};
if ~strcmp(mode,'komplex') && ~strcmp(mode,'matrix')
if ~strcmp(mode,'complex') && ~strcmp(mode,'matrix')
error('ModalAnalysis:: Wrong input Parameter mode!')
end
else
......@@ -42,7 +42,7 @@ if fTmp == 0, noEx=1; end
if noEx==0
switch mode % solver method
case 'komplex' % Modal analysis with komplex eigenvectors
case 'complex' % Modal analysis with complex eigenvectors
try
ind = 0;
for i1 = 1:length(SysMat.A)
......@@ -54,7 +54,7 @@ if noEx==0
disp('=============================');
else
p = MAkomplex(SysMat, GUI, dMax, groupMaterial, fluid);
disp('Solution: modal analysis komplex');
disp('Solution: modal analysis complex');
disp('================================');
end
catch
......
......@@ -2,7 +2,7 @@ function varargout = ita_ModeSolve(varargin)
% This function is the main function from the fe solver.
% It can be used from gui or by manual data (see function manualInput).
% When this function is used by gui no data is given back and when it is
% used by manual data input a struct with the calculated pressure
% used by manual data input a struct with the calculated pressure
% (ModeSolveOut.p) and solver data (ModeSolveOut.data) is given back
% <ITA-Toolbox>
......@@ -14,17 +14,22 @@ function varargout = ita_ModeSolve(varargin)
%% object of coordinates, elements, groups, group porperties and fluid
sArgs = struct('pos1_data',[], 'display', 1, 'SystemMatrix',[]);
[GUI,sArgs] = ita_parse_arguments(sArgs,varargin);
if ~isstruct(GUI)
error('Wrong input parameter!')
end
structField = fieldnames(GUI);
structField = fieldnames(GUI);
if isempty(strfind(structField{1},'coord')) % old or manual version
ita_ModeSolveManualInput(GUI);
[coord, elements, groupMaterial] = niceObject(GUI.meshFilename, GUI.propertyFilename); % generate coordinate, element and group material objects
if size(elements{2}.nodes,2)<10, elements = {elements{1} elements{2}};
else elements = {elements{2} elements{1}}; end
if nargout ~= 1, error('Wrong number of outputs'); end
if size(elements{2}.nodes,2)<10
elements = {elements{1} elements{2}};
else
elements = {elements{2} elements{1}};
end
if nargout ~= 1
error('Wrong number of outputs');
end
else % GUI version: This version uses renumberated groups and elements
coord = GUI.coord;
elements ={GUI.volElem, GUI.surfElem};
......@@ -37,12 +42,13 @@ fluid = itaMeshFluid(1,'ModeSolve',343.7,1.2);
%% System matrices
if isempty(sArgs.SystemMatrix)
SysMat = sys_mat(coord, elements, groupMaterial);
else SysMat = sArgs.SystemMatrix;
else
SysMat = sArgs.SystemMatrix;
end
%% Pressure calculation
if strcmp(GUI.solveMode,'particular') % particular solution of fe- helmholtzequation
[p] = particularS(GUI,SysMat, coord, elements, groupMaterial, fluid);
elseif strcmp(GUI.solveMode,'komplex') || strcmp(GUI.solveMode,'real') % pressure calculation with modalanalysis
elseif strcmp(GUI.solveMode,'complex') || strcmp(GUI.solveMode,'real') % pressure calculation with modalanalysis
dMax = sqrt((max(coord.x)-min(coord.x))^2+(max(coord.y)-min(coord.y))^2+(max(coord.z)-min(coord.z))^2);
[p, GUI] = ModalAnalysis(SysMat, GUI, dMax, groupMaterial, fluid);
else % eigenvalue and frequency calculation
......@@ -53,7 +59,6 @@ end
%% Output
if isempty(strfind(structField{1},'coord')) || sArgs.display == 0 % old or manual version
pRes = itaResult;
pRes.freqVector = GUI.Freq';
pRes.freqData = p.';
......
......@@ -55,7 +55,8 @@ for i1 = 1:length(GUI.Freq) % loop over all frequencies
p_knownElem = unique(elements{2}(groupMaterial{dirichlet(i4,1)}.ID,:));
p_unknownElem(p_knownElem) = [];
K_temp =K; l_knownElem = length(p_knownElem);
K_temp = K;
l_knownElem = length(p_knownElem);
K_temp(p_knownElem,p_knownElem) = eye(l_knownElem,l_knownElem);
K_temp(p_knownElem,p_unknownElem) = zeros(length(p_knownElem),length(p_unknownElem));
K_temp(p_unknownElem,p_knownElem) = zeros(length(p_unknownElem),length(p_knownElem));
......@@ -78,6 +79,6 @@ end
t3 = toc;
disp('Time particular');
disp('-------------------------------------------------------------------');
disp(['Gesamt : ' num2str(t3)]);
disp(['Total : ' num2str(t3)]);
disp(' ');
close(h);
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment