Commit 58289564 authored by Andreas Zilian's avatar Andreas Zilian
Browse files

Allow inspection of solution components (full, homeogeneous, particular). Less verbose.

parent c2bd15e8
......@@ -186,8 +186,8 @@ classdef FeAnalysisDynamicFD < mafe.FeAnalysis
% due to the appearance of xh_ii as complex conjugates,
% the homogeneous solution should consist of real values only
norm_imag = norm( imag(xh), 2 );
if norm_imag > 1.e-8
disp('Warning: Solution has imaginary component!')
if norm_imag > 1.e-6
disp(sprintf('Warning: Solution has imaginary component! (norm = %2.3e)', norm_imag));
end
% return the real part only
xh = real(xh);
......@@ -223,11 +223,26 @@ classdef FeAnalysisDynamicFD < mafe.FeAnalysis
% return the real part only
xp = real(xp);
end
%% put xh+xp to dof solution
function putSolToDof(self, time)
u = self.solHomogeneous(time,0) + self.solInhomogeneous(time,0);
v = self.solHomogeneous(time,1) + self.solInhomogeneous(time,1);
a = self.solHomogeneous(time,2) + self.solInhomogeneous(time,2);
%% put a specific solution component to dof
function putSolToDof(self, time, component)
if ~exist('component', 'var')
component = 'full';
end
% extract solution
switch(component)
case 'full'
u = self.solHomogeneous(time,0) + self.solInhomogeneous(time,0);
v = self.solHomogeneous(time,1) + self.solInhomogeneous(time,1);
a = self.solHomogeneous(time,2) + self.solInhomogeneous(time,2);
case 'homogeneous'
u = self.solHomogeneous(time,0);
v = self.solHomogeneous(time,1);
a = self.solHomogeneous(time,2);
case 'particular'
u = self.solInhomogeneous(time,0);
v = self.solInhomogeneous(time,1);
a = self.solInhomogeneous(time,2);
end
% --- POST-PROCESSING ---
% get local force vector at specific time
p = zeros(self.fep.ndofs,1);
......@@ -251,8 +266,8 @@ classdef FeAnalysisDynamicFD < mafe.FeAnalysis
if nargin < 2
component = 'real';
end
lambda = self.L(mode)
a = self.A(mode)
lambda = self.L(mode);
a = self.A(mode);
switch component
case 'imag'
u = imag( a * self.X(:,mode) );
......@@ -261,7 +276,7 @@ classdef FeAnalysisDynamicFD < mafe.FeAnalysis
otherwise
u = a * self.X(:,mode);
end
u = 1./norm(u,2) * u
u = 1./norm(u,2) * u;
% compute reaction forces
K = self.fep.assembleSystemStiffnessMatrix();
f = self.fep.assembleSystemForceVector();
......
Supports Markdown
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