Adding test running propagation simulation on GRAS scene 5

parent d34b5094
......@@ -23,3 +23,12 @@ vista_install( CombinedModelTest )
vista_create_default_info_file( CombinedModelTest )
set_property( TARGET CombinedModelTest PROPERTY FOLDER "ITAGeometricalAcoustics/Tests/ITAPropagationPathSim/CombinedModel" )
add_executable( GRAS_scene5 GRAS_scene5.cpp )
target_link_libraries( GRAS_scene5 ${VISTA_USE_PACKAGE_LIBRARIES} )
vista_configure_app( GRAS_scene5 )
vista_install( GRAS_scene5 )
vista_create_default_info_file( GRAS_scene5 )
set_property( TARGET GRAS_scene5 PROPERTY FOLDER "ITAGeometricalAcoustics/Tests/ITAPropagationPathSim/CombinedModel" )
/*
* ----------------------------------------------------------------
*
* ITA geometrical acoustics
* (c) Copyright Institute of Technical Acoustics (ITA)
* RWTH Aachen University, Germany, 2015-2018
*
* ----------------------------------------------------------------
* ____ __________ _______
* // / //__ ___/ // _ |
* // / // / // /_| |
* // / // / // ___ |
* //__/ //__/ //__/ |__|
*
* ----------------------------------------------------------------
*
* Tests the image (source) model algorithm.
*
*/
#include <ITAStopWatch.h>
#include <ITAStringUtils.h>
#include <ITAPropagationPathSim/CombinedModel/PropagationEngine.h>
#include <ITAGeo/Base.h>
#include <ITAGeo/Utils.h>
#include <ITAGeo/SketchUp/Model.h>
#include <ITAGeo/Material/Material.h>
#include <ITAGeo/Material/Manager.h>
#include <cassert>
using namespace std;
using namespace ITAGeo;
using namespace ITAPropagationPathSim;
#if 1 //#ifdef WITH_JSON_SUPPORT
#include <libjson.h>
#endif
int main( int iNumInArgs, char* pcInArgs[] )
{
std::string sInFile = "GRAS_scene5_geometry.skp";
auto pMeshModelList = make_shared< ITAGeo::Halfedge::CMeshModelList>();
if( pMeshModelList->Load( sInFile ) )
{
cout << "Successfully loaded '" << sInFile << "'" << endl;
}
else
{
cerr << "Could not load " << sInFile << endl;
return 255;
}
// Configuration
const bool bOnlyNeighbouredEdgeDiffraction = false;
const bool bDiffractionOnlyIntoShadowedEdges = false;//
const bool bFilterNotVisiblePathsBetweenEdges = false; //Intersection test between edges(expensive)
const bool bFilterNotVisiblePointToEdge = true; //Intersection test between emitter/sensor and edges
const bool bFilterNotVisiblePaths = true; //Intersection test of calculated sub paths
const float fIntersectionTestResolution = 0.001;
const int iNumIterations = 4;//!< Number of iterations for the calculation of the aperture points
const int fMaxAccumulatedDiffractionAngle = -ITAConstants::PI_F;
const float fLevelDropThreshhold = -90.f - 30.f - 11.f; //90 dB Power level of Diesel; 30 dB masking; 11 dB initial power level drop
const float fReflectionPenalty = -10 * log10f( 0.8 ); //Level reduction of a reflection with reflection factor rho = 0.8 from ISO9613-2
const float fDiffractionPenalty = 2.5f; // Minimum level reduction of a diffracted signal into the shadow region for a low frequency (Taken from BA Filbert Figure 16. UTD)
const int iMaxDiffractionOrder = 3;
const int iMaxReflectionOrder = 3;
const int iMaxCombinedOrder = 5;
ITAStopWatch sw; sw.start();
auto pSensor = make_shared< CSensor >( VistaVector3D( 8.512f, 2.985f, 1.235f ) );
pSensor->qOrient = VistaQuaternion( Vista::ZeroVector, VistaVector3D( -1.0f, 0.0f, 0.0f ) );
pSensor->sName = "MP01_FABIAN";
auto pEmitter = make_shared< CEmitter >( VistaVector3D( 2.487f, 2.985f, 2.0f ) );
pEmitter->sName = "LS02_Genelec8020c";
auto pPathEngine = make_shared<CombinedModel::CPathEngine>();
cout << "Calculation time initialization path engine: " << timeToString( sw.stop() ) << endl;
sw.start();
pPathEngine->Configure( bOnlyNeighbouredEdgeDiffraction, bDiffractionOnlyIntoShadowedEdges, bFilterNotVisiblePathsBetweenEdges, bFilterNotVisiblePointToEdge, bFilterNotVisiblePointToEdge, bFilterNotVisiblePaths, iNumIterations, fIntersectionTestResolution );
pPathEngine->SetAbortionCriteria( iMaxDiffractionOrder, iMaxReflectionOrder, iMaxCombinedOrder, fLevelDropThreshhold, fReflectionPenalty, fDiffractionPenalty, fMaxAccumulatedDiffractionAngle );
cout << "Calculation time configuring filter: " << timeToString( sw.stop() ) << endl;
sw.start();
pPathEngine->InitializePathEnvironment( pMeshModelList );
cout << "Calculation time initialization path environment: " << timeToString( sw.stop() ) << endl;
sw.start();
pPathEngine->ApplyEmitter( pEmitter );
cout << "Calculation time applying emitter: " << timeToString( sw.stop() ) << endl;
cout << "Number propagation path candidates after source insertion: " << pPathEngine->GetNumberPropagationPathCandidates() << endl;
sw.start();
pPathEngine->ApplySensor( pSensor );
cout << "Calculation time applying sensor: " << timeToString( sw.stop() ) << endl;
CPropagationPathList oPathList;
cout << "Calculation time applying sensor: " << timeToString( sw.stop() ) << endl;
sw.start();
pPathEngine->ConstructPropagationPaths( oPathList );
//pPathEngine->ConstructPropagationPathsWithStopWatch(oPathListAll);
cout << "Calculation time propagation path creation: " << timeToString( sw.stop() ) << endl;
cout << "Visible paths: " << to_string( oPathList.size() ) << endl;
SketchUp::CModel oGeoModel_Viz;
if( oGeoModel_Viz.Load( sInFile ) )
{
cout << "Successfully loaded '" << sInFile << "'" << endl;
}
else
{
cerr << "Could not load " << sInFile << endl;
return 255;
}
oGeoModel_Viz.AddEmitterVisualization( *pEmitter, pEmitter->sName );
oGeoModel_Viz.AddSensorVisualization( *pSensor, pSensor->sName );
cout << "The path with the longest length is " << oPathList.GetMaxLength() << " m." << endl;
size_t numberOfPaths[ iMaxDiffractionOrder + 1 ][ iMaxReflectionOrder + 1 ] = { 0 };
for( auto& oPath : oPathList )
{
long iNumReflections = ( long ) oPath.GetNumReflections();
long iNumDiffractions = ( long ) oPath.GetNumDiffractions();
numberOfPaths[ iNumDiffractions ][ iNumReflections ]++;
}
for( auto& oPath : oPathList )
{
long iNumReflections = ( long ) oPath.GetNumReflections();
long iNumDiffractions = ( long ) oPath.GetNumDiffractions();
string sPathName = "Refl_Order_" + to_string( iNumReflections ) + "_Diffr_Order_" + to_string( iNumDiffractions ) + "_Path_Amount_" + to_string( numberOfPaths[ iNumDiffractions ][ iNumReflections ] );
oGeoModel_Viz.AddPropagationPathVisualization( oPath, sPathName );
}
oPathList.Store( "GRAS_scene5_propagation_paths.json" );
oGeoModel_Viz.Store( "GRAS_scene5_visualization.skp" );
return 0;
}
B໿SketchUp Modelࣿ{18.0.1}휅ࣕ婚䜔삌榤ꛦ༓諿C:\dev\ITAGeometricalAcoustics\ITAPropagationPathSim\tests\CombinedModel\GRAS\05 diffraction (infinite wedge)\Geometry\scene5_geometry.skp岴￿ 噃牥楳湯慍ー￾䌉䄀爀挀䌀甀爀瘀攀̀＀￾䌊䄀琀琀爀椀戀甀琀攀＀￾䌓䄀琀琀爀椀戀甀琀攀䌀漀渀琀愀椀渀攀爀＀￾䌏䄀琀琀爀椀戀甀琀攀一愀洀攀搀Ā＀￾䌐䈀愀挀欀最爀漀甀渀搀䤀洀愀最攀਀＀￾䌇䌀愀洀攀爀愀Ԁ＀￾䌊䌀漀洀瀀漀渀攀渀琀଀＀￾䌒䌀漀洀瀀漀渀攀渀琀䈀攀栀愀瘀椀漀爀Ԁ＀￾䌔䌀漀洀瀀漀渀攀渀琀䐀攀昀椀渀椀琀椀漀渀଀＀￾䌒䌀漀洀瀀漀渀攀渀琀䤀渀猀琀愀渀挀攀؀＀￾䌕䌀漀渀猀琀爀甀挀琀椀漀渀䜀攀漀洀攀琀爀礀＀￾䌑䌀漀渀猀琀爀甀挀琀椀漀渀䰀椀渀攀Ā＀￾䌒䌀漀渀猀琀爀甀挀琀椀漀渀倀漀椀渀琀＀￾䌆䌀甀爀瘀攀Ѐ＀￾䌏䐀攀昀椀渀椀琀椀漀渀䰀椀猀琀＀￾䌄䐀椀戀̀＀￾䌊䐀椀洀攀渀猀椀漀渀Ā＀￾䌐䐀椀洀攀渀猀椀漀渀䰀椀渀攀愀爀؀＀￾䌐䐀椀洀攀渀猀椀漀渀刀愀搀椀愀氀Ȁ＀￾䌏䐀椀洀攀渀猀椀漀渀匀琀礀氀攀Ѐ＀￾䌏䐀爀愀眀椀渀最䔀氀攀洀攀渀琀ऀ＀￾䌅䔀搀最攀Ȁ＀￾䌈䔀搀最攀唀猀攀Ā＀￾䌇䔀渀琀椀琀礀Ԁ＀￾䌅䘀愀挀攀̀＀￾䌒䘀愀挀攀吀攀砀琀甀爀攀䌀漀漀爀搀猀Ѐ＀￾䌌䘀漀渀琀䴀愀渀愀最攀爀＀￾䌆䜀爀漀甀瀀Ā＀￾䌆䤀洀愀最攀Ā＀￾䌆䰀愀礀攀爀Ȁ＀￾䌍䰀愀礀攀爀䴀愀渀愀最攀爀Ѐ＀￾䌅䰀漀漀瀀Ā＀￾䌉䴀愀琀攀爀椀愀氀ఀ＀￾䌐䴀愀琀攀爀椀愀氀䴀愀渀愀最攀爀Ѐ＀￾䌉倀愀最攀䰀椀猀琀Ā＀￾䌋倀漀氀礀氀椀渀攀㌀搀＀￾䌍刀攀氀愀琀椀漀渀猀栀椀瀀＀￾䌐刀攀氀愀琀椀漀渀猀栀椀瀀䴀愀瀀＀￾䌑刀攀渀搀攀爀椀渀最伀瀀琀椀漀渀猀─＀￾䌋匀挀栀攀洀愀䘀椀氀攀Ā＀￾䌑匀挀栀攀洀愀䘀椀氀琀攀爀䘀椀氀攀＀￾䌎匀挀栀攀洀愀娀椀瀀䘀椀氀攀Ā＀￾䌍匀攀挀琀椀漀渀倀氀愀渀攀̀＀￾䌋匀栀愀搀漀眀䤀渀昀漀܀＀￾䌇匀欀䘀漀渀琀Ā＀￾䌉匀欀攀琀挀栀䌀匀＀￾䌎匀欀攀琀挀栀唀瀀䴀漀搀攀氀ᰀ＀￾䌍匀欀攀琀挀栀唀瀀倀愀最攀Ā＀￾䌉匀欀瀀匀琀礀氀攀Ā＀￾䌐匀欀瀀匀琀礀氀攀䴀愀渀愀最攀爀Ȁ＀￾䌅吀攀砀琀ऀ＀￾䌊吀攀砀琀匀琀礀氀攀Ԁ＀￾䌈吀攀砀琀甀爀攀؀＀￾䌊吀栀甀洀戀渀愀椀氀Ā＀￾䌇嘀攀爀琀攀砀＀￾䌉嘀椀攀眀倀愀最攀ఀ＀￾䌊圀愀琀攀爀洀愀爀欀Ā＀￾䌑圀愀琀攀爀洀愀爀欀䴀愀渀愀最攀爀Ȁ＀￾䔒渀搀ⴀ伀昀ⴀ嘀攀爀猀椀漀渀ⴀ䴀愀瀀Ā뀀Ā笀ö＀ϿЀ䌀楄Ѣ眀褀乐േᨊ
This diff is collapsed.
B໿SketchUp Model೿{18.0.18664}䯻澤쭬䃤⮺紸핛ÿ岴￿ 噃牥楳湯慍ー￾䌉䄀爀挀䌀甀爀瘀攀̀＀￾䌊䄀琀琀爀椀戀甀琀攀＀￾䌓䄀琀琀爀椀戀甀琀攀䌀漀渀琀愀椀渀攀爀＀￾䌏䄀琀琀爀椀戀甀琀攀一愀洀攀搀Ā＀￾䌐䈀愀挀欀最爀漀甀渀搀䤀洀愀最攀਀＀￾䌇䌀愀洀攀爀愀Ԁ＀￾䌊䌀漀洀瀀漀渀攀渀琀଀＀￾䌒䌀漀洀瀀漀渀攀渀琀䈀攀栀愀瘀椀漀爀Ԁ＀￾䌔䌀漀洀瀀漀渀攀渀琀䐀攀昀椀渀椀琀椀漀渀଀＀￾䌒䌀漀洀瀀漀渀攀渀琀䤀渀猀琀愀渀挀攀؀＀￾䌕䌀漀渀猀琀爀甀挀琀椀漀渀䜀攀漀洀攀琀爀礀＀￾䌑䌀漀渀猀琀爀甀挀琀椀漀渀䰀椀渀攀Ā＀￾䌒䌀漀渀猀琀爀甀挀琀椀漀渀倀漀椀渀琀＀￾䌆䌀甀爀瘀攀Ѐ＀￾䌏䐀攀昀椀渀椀琀椀漀渀䰀椀猀琀＀￾䌄䐀椀戀̀＀￾䌊䐀椀洀攀渀猀椀漀渀Ā＀￾䌐䐀椀洀攀渀猀椀漀渀䰀椀渀攀愀爀؀＀￾䌐䐀椀洀攀渀猀椀漀渀刀愀搀椀愀氀Ȁ＀￾䌏䐀椀洀攀渀猀椀漀渀匀琀礀氀攀Ѐ＀￾䌏䐀爀愀眀椀渀最䔀氀攀洀攀渀琀ऀ＀￾䌅䔀搀最攀Ȁ＀￾䌈䔀搀最攀唀猀攀Ā＀￾䌇䔀渀琀椀琀礀Ԁ＀￾䌅䘀愀挀攀̀＀￾䌒䘀愀挀攀吀攀砀琀甀爀攀䌀漀漀爀搀猀Ѐ＀￾䌌䘀漀渀琀䴀愀渀愀最攀爀＀￾䌆䜀爀漀甀瀀Ā＀￾䌆䤀洀愀最攀Ā＀￾䌆䰀愀礀攀爀Ȁ＀￾䌍䰀愀礀攀爀䴀愀渀愀最攀爀Ѐ＀￾䌅䰀漀漀瀀Ā＀￾䌉䴀愀琀攀爀椀愀氀ఀ＀￾䌐䴀愀琀攀爀椀愀氀䴀愀渀愀最攀爀Ѐ＀￾䌉倀愀最攀䰀椀猀琀Ā＀￾䌋倀漀氀礀氀椀渀攀㌀搀＀￾䌍刀攀氀愀琀椀漀渀猀栀椀瀀＀￾䌐刀攀氀愀琀椀漀渀猀栀椀瀀䴀愀瀀＀￾䌑刀攀渀搀攀爀椀渀最伀瀀琀椀漀渀猀─＀￾䌋匀挀栀攀洀愀䘀椀氀攀Ā＀￾䌑匀挀栀攀洀愀䘀椀氀琀攀爀䘀椀氀攀＀￾䌎匀挀栀攀洀愀娀椀瀀䘀椀氀攀Ā＀￾䌍匀攀挀琀椀漀渀倀氀愀渀攀̀＀￾䌋匀栀愀搀漀眀䤀渀昀漀܀＀￾䌇匀欀䘀漀渀琀Ā＀￾䌉匀欀攀琀挀栀䌀匀＀￾䌎匀欀攀琀挀栀唀瀀䴀漀搀攀氀ᰀ＀￾䌍匀欀攀琀挀栀唀瀀倀愀最攀Ā＀￾䌉匀欀瀀匀琀礀氀攀Ā＀￾䌐匀欀瀀匀琀礀氀攀䴀愀渀愀最攀爀Ȁ＀￾䌅吀攀砀琀ऀ＀￾䌊吀攀砀琀匀琀礀氀攀Ԁ＀￾䌈吀攀砀琀甀爀攀؀＀￾䌊吀栀甀洀戀渀愀椀氀Ā＀￾䌇嘀攀爀琀攀砀＀￾䌉嘀椀攀眀倀愀最攀ఀ＀￾䌊圀愀琀攀爀洀愀爀欀Ā＀￾䌑圀愀琀攀爀洀愀爀欀䴀愀渀愀最攀爀Ȁ＀￾䔒渀搀ⴀ伀昀ⴀ嘀攀爀猀椀漀渀ⴀ䴀愀瀀Ā뀀阀Āÿ೿NamedOptionsÿ௿PageOptions໿ShowTransitionć໿TransitionTime_￾＀￾匐氀椀搀攀猀栀漀眀伀瀀琀椀漀渀猀＀￾䰍漀漀瀀匀氀椀搀攀猀栀漀眀܀!￾匉氀椀搀攀吀椀洀攀؀㿰ÿ೿UnitsOptions࿿LengthPrecisionЄ＀￾䰌攀渀最琀栀䘀漀爀洀愀琀Ѐ૿LengthUnit＀￾䰑攀渀最琀栀匀渀愀瀀䔀渀愀戀氀攀搀܀!￾䰐攀渀最琀栀匀渀愀瀀䰀攀渀最琀栀؀㾰໿AnglePrecisionĄ＀￾䄐渀最氀攀匀渀愀瀀䔀渀愀戀氀攀搀܀!￾匉渀愀瀀䄀渀最氀攀؀䀮ᓿSuppressUnitsDisplayჿForceInchDisplayÿ￿䅃瑴楲畢整潃瑮楡敮r￿䅃瑴楲畢整慎敭d࿿ModelProperties೿IsClassified৿IsDynamicӿName*￾＀￾＀׿܀䌀慃敭慲䀀䁿㿰㿰䀀䂏㸀@悠@Ā＀￾㿰Ȁ￿＀肀タĀࠀĀЀ￈肀￈㿨㿠Ā뿰뿰āꖌ￿錿_㈁昀赮샿샀￿ӿ̀ÿ蠁ᡊ홗Ŀÿ＀촁쳌쳌?Ŀ馚香香㿩ā<￿ 䵃瑡牥慩lۿ<auto>￿㐀ÿ祺祹祹㿩ँ€߿<auto>1￿ᤀÿ㿬ँ€߿<auto>2￿䨀ÿ뚶뚶뚶㿦ँ€߿<auto>3￿刀ÿ떶떵떵㿥ँ€߿<auto>4￿崀ÿ呔呔呔㿤ँ€߿<auto>5￿帀ÿ㐴㐴㐴㿤ँ€߿<auto>6￿帀ÿ㐴㐴㐴㿤ँ€߿<auto>7￿吀ÿ當畵畵㿥ँ€߿<auto>8￿帀ÿ㐴㐴㐴㿤ँ€߿<auto>9￿崀ÿ呔呔呔㿤ँ€ࣿ<auto>10￿帀ÿ㐴㐴㐴㿤ँ€ࣿ<auto>11￿帀ÿ㐴㐴㐴㿤ँ€ࣿ<auto>12￿开ÿᐔᐔᐔ㿤ँ€ࣿ<auto>13￿帀ÿ㐴㐴㐴㿤ँ€ࣿ<auto>14￿匀ÿ閖閕閕㿥ँ€ࣿ<auto>15￿帀ÿ㐴㐴㐴㿤ँ€ࣿ<auto>16￿儀ÿ헖헕헕㿥ँ€ࣿ<auto>17￿ᤀÿ㿬ँ€ࣿ<auto>18￿帀ÿ㐴㐴㐴㿤ँ€ࣿ<auto>19￿ᤀÿ㿬ँ€ࣿ<auto>20ᤀÿ㿬ँ€ࣿ<auto>21ᤀÿ㿬ँ€ࣿ<auto>22ᤀÿ㿬ँ€ࣿ<auto>23ᤀÿ㿬ँ€ࣿ<auto>24ᤀÿ㿬ँ€ࣿ<auto>25ᤀÿ㿬ँ€ࣿ<auto>26ᤀÿ㿬ँ€ࣿ<auto>27ᤀÿ㿬ँ€ࣿ<auto>28ᤀÿ㿬ँ€ࣿ<auto>29ᤀÿ㿬ँ€ࣿ<auto>30ᤀÿ㿬ँ€ࣿ<auto>31ᤀÿ㿬ँ€ࣿ<auto>32ᤀÿ㿬ँ€ࣿ<auto>33ᤀÿ㿬ँ€ࣿ<auto>34ᤀÿ㿬ँ€ࣿ<auto>35ᤀÿ㿬ँ€ࣿ<auto>36∀ÿ뮼뮻뮻㿫ँ€ࣿ<auto>37℀ÿ㿫ँ€ࣿ<auto>38℀ÿ㿫ँ€ࣿ<auto>39℀ÿ㿫ँ€ࣿ<auto>40∀ÿ뮼뮻뮻㿫ँ€ࣿ<auto>41℀ÿ㿫ँ€ࣿ<auto>42␀ÿ筼筻筻㿫ँ€ࣿ<auto>43⌀ÿ鮜鮛鮛㿫ँ€ࣿ<auto>44⌀ÿ鮜鮛鮛㿫ँ€ࣿ<auto>45⌀ÿ鮜鮛鮛㿫ँ€ࣿ<auto>46쵿ᤀÿ㿬ँ€ࣿ<auto>47힙ᤀÿ㿬ँ€ࣿ<auto>48힙ᤀÿ㿬ँ€ࣿ<auto>49힙ᤀÿ㿬ँ€ࣿ<auto>50힙ᤀÿ㿬ँ€ࣿ<auto>51힙ᤀÿ㿬ँ€ࣿ<auto>52힙ᤀÿ㿬ँ€ࣿ<auto>53힙ᤀÿ㿬ँ€ࣿ<auto>54힙ᤀÿ㿬ँ€ࣿ<auto>55힙ᤀÿ㿬ँ€ࣿ<auto>56힙ᤀÿ㿬ँ€ࣿ<auto>57힙ᤀÿ㿬ँ€᳿ITA_Acoustics_DefaultEmitter㟈찀ÿ馘香香㿉ँ€᯿ITA_Acoustics_DefaultSensor㈀첾ÿ馘香香㿉
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