itaSimulationInputItem

-CrossfadeWaveAndGaData() is now Hidden

itaSource
-now has an enum to specify omnidirectional sources in GA
parent 088fb270
......@@ -263,7 +263,7 @@ classdef itaMaterial < itaSimulationInputItem
end
%% Public functions
methods
methods(Hidden = true)
function obj = CrossfadeWaveAndGaData(this, crossfadeFreq)
%Cross-fades the wave-based material properties with the
%geometrical ones at a given frequency. Data is returned in as
......
......@@ -143,7 +143,7 @@ classdef itaReceiver < itaSpatialSimulationInputItem
end
%% Public functions
methods
methods(Hidden = true)
function obj = CrossfadeWaveAndGaData(this, crossfadeFreq)
%Since the receiver has no frequency dependent data yet, no
%crossfade is necessary
......
......@@ -25,6 +25,7 @@ classdef itaSource < itaSpatialSimulationInputItem
mDirectivityFile; %Char vector
mType = SourceType.PointSource; %SourceType
mSensitivityType = SensitivityType.UserDefined %SensitivityType
mDirectivityType = DirectivityType.UserDefined %DirectivityType
mPistonRadius; %Double scalar
end
......@@ -36,6 +37,7 @@ classdef itaSource < itaSpatialSimulationInputItem
properties(Dependent = true)
type; %Iindicates what the wave TF represents - PointSource, Piston, SurfaceDistribution (see SourceType)
sensitivityType; %Switch between a flat frequency response and a user-defined one.
directivityType; %Switch between a omnidirectional directivity and a user-defined one.
volumeFlowTf; %volume flow transfer function of the point source used for wave-based simulations
velocityTf;
......@@ -74,6 +76,19 @@ classdef itaSource < itaSpatialSimulationInputItem
end
end
%% Sensitivity Type
methods
function this = set.directivityType(this, directivityType)
assert(isa(directivityType, 'DirectivityType') && isscalar(directivityType), 'Can only assign a single object of type DirectivityType')
if this.mDirectivityType == directivityType; return; end
this.mDirectivityType = directivityType;
end
function out = get.directivityType(this)
out = char(this.mDirectivityType);
end
end
%% GA Properties
%------Set-------------------------------------------------------------
methods
......@@ -258,7 +273,7 @@ classdef itaSource < itaSpatialSimulationInputItem
bool = arrayfun(@(x) ~isempty(x.mWaveTf), this) | this.tfDefinedByType();
end
function bool = HasDirectivity(this)
bool = arrayfun(@(x) ~isempty(x.mDirectivityFile), this);
bool = arrayfun(@(x) ~isempty(x.mDirectivityFile), this) | this.directivityDefinedByType();
end
function bool = HasGaData(this)
......@@ -291,6 +306,9 @@ classdef itaSource < itaSpatialSimulationInputItem
function bool = tfDefinedByType(this)
bool = arrayfun(@(x) isequal(x.mSensitivityType, SensitivityType.Flat), this);
end
function bool = directivityDefinedByType(this)
bool = arrayfun(@(x) isequal(x.mDirectivityType, DirectivityType.Omnidirectional), this);
end
end
methods(Access = private, Static = true)
function bool = itaSuperHasCoordinates(obj)
......@@ -299,7 +317,7 @@ classdef itaSource < itaSpatialSimulationInputItem
end
%% Public functions
methods
methods(Hidden = true)
function obj = CrossfadeWaveAndGaData(this, crossfadeFreq)
%Cross-fades the wave-based source properties with the
%geometrical ones at a given frequency. Data is returned in as
......
classdef DirectivityType
%DirectivityType Used to distinguish between general and special cases
%of source directivities
enumeration
UserDefined, Omnidirectional;
end
end
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