[asl] 54/177: Updating examples

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Thu Aug 27 09:22:40 UTC 2015


This is an automated email from the git hooks/post-receive script.

ghisvail-guest pushed a commit to branch master
in repository asl.

commit e2819f6b19e42b25c3ed12f759aef21145261d11
Author: Avtech Scientific <AvtechScientific at users.noreply.github.com>
Date:   Fri Jun 26 14:18:42 2015 +0300

    Updating examples
---
 examples/elastic/acousticWaves.cc             | 17 +++++++----------
 examples/elastic/cubeGravity.cc               |  6 +++---
 examples/elastic/cubeIncompressibleGravity.cc |  8 +++++---
 examples/elastic/cubePoroelasticGravity.cc    |  8 +++++---
 examples/elastic/poroelastic.cc               | 10 +++++-----
 examples/flow/multiphase_flow.cc              | 17 +++++++----------
 examples/flow/pitot_tube_ice.cc               | 17 +++++++----------
 examples/jumpingObjects/jumpingBox.cc         |  7 ++++---
 examples/levelSet/levelSetBasic.cc            |  7 ++++---
 examples/levelSet/levelSetFacetedGrowth.cc    |  7 ++++---
 examples/levelSet/levelSetNormalGrowth.cc     |  7 ++++---
 11 files changed, 55 insertions(+), 56 deletions(-)

diff --git a/examples/elastic/acousticWaves.cc b/examples/elastic/acousticWaves.cc
index 8bbc72d..c7b79ac 100644
--- a/examples/elastic/acousticWaves.cc
+++ b/examples/elastic/acousticWaves.cc
@@ -50,7 +50,7 @@ class Parameters
 		void init();
 
   public:
-		asl::ParametersManager parametersManager;
+		asl::ApplicationParametersManager appParamsManager;
 		string folder;
 
 		asl::Block::DV size;
@@ -74,15 +74,14 @@ class Parameters
 		asl::UValue<double> bulkMNum;
 		asl::UValue<double> shearMNum;
 		
-		void load(int argc, char * argv[],
-		          string programName,
-		          string programVersion);
+		void load(int argc, char * argv[]);
 		Parameters();
 		void updateNumValues();
 };
 
 
 Parameters::Parameters():
+	appParamsManager("acousticWaves", "0.1", "acousticWaves.ini"),
 	size(3),
 	dx(1e-3,"dx", "dx"),
 	bulkModulus(160e9,"bulk_modulus", "bulk modulus"),
@@ -102,12 +101,10 @@ Parameters::Parameters():
 }
 
 
-void Parameters::load(int argc, char * argv[],
-                      string programName,
-                      string programVersion)
+void Parameters::load(int argc, char * argv[])
 {
-	parametersManager.load(argc, argv, programName, programVersion);
-	folder = parametersManager.getFolderWithSlash();
+	appParamsManager.load(argc, argv);
+	folder = appParamsManager.getFolderWithSlash();
 
 	init();
 }
@@ -168,7 +165,7 @@ asl::AVec<float> getAmplitude(double it)
 int main(int argc, char* argv[])
 {
 	Parameters params;
-	params.load(argc, argv, "acousticWaves", "0.1");
+	params.load(argc, argv);
 		
 	std::cout<<"acoustic waves: Data initialization..."<<flush;
 
diff --git a/examples/elastic/cubeGravity.cc b/examples/elastic/cubeGravity.cc
index 7db045b..9d8b0ff 100644
--- a/examples/elastic/cubeGravity.cc
+++ b/examples/elastic/cubeGravity.cc
@@ -47,7 +47,7 @@ typedef asl::UValue<FlT> Param;
 
 int main(int argc, char* argv[])
 {
-	asl::ParametersManager parametersManager;
+	asl::ApplicationParametersManager appParamsManager("cubeGravity", "1.0", "cubeGravity.ini");
 	asl::Parameter<asl::AVec<int> > size("size", "size 3D");
 	asl::Parameter<cl_float> dx("dx", "dx");
 	asl::Parameter<cl_float> dt("dt", "dt");
@@ -59,7 +59,7 @@ int main(int argc, char* argv[])
 	asl::Parameter<unsigned int> tsim("num_iterations", "number of iterations");
 	asl::Parameter<unsigned int> tout("num_it_out", "number of iterations between outputs");
 	
-	parametersManager.load(argc, argv, "cubeGravity");
+	appParamsManager.load(argc, argv);
 
 	Param bulkModulusNum(bulkModulus.v()/rho.v()/dx.v()/dx.v());
 	Param shearModulusNum(shearModulus.v()/rho.v()/dx.v()/dx.v());
@@ -78,7 +78,7 @@ int main(int argc, char* argv[])
 	initData(mapX->getEContainer(), map->getEContainer());
 
 	
-	asl::WriterVTKXML writer(parametersManager.getFolderWithSlash() + "cubeGravity");
+	asl::WriterVTKXML writer(appParamsManager.getFolderWithSlash() + "cubeGravity");
 	writer.addScalars("map", *mapX);
 	writer.addVector("displacement", *displacement);
 	writer.write();
diff --git a/examples/elastic/cubeIncompressibleGravity.cc b/examples/elastic/cubeIncompressibleGravity.cc
index de69260..cd1dc93 100644
--- a/examples/elastic/cubeIncompressibleGravity.cc
+++ b/examples/elastic/cubeIncompressibleGravity.cc
@@ -47,7 +47,9 @@ typedef asl::UValue<FlT> Param;
 
 int main(int argc, char* argv[])
 {
-	asl::ParametersManager parametersManager;
+	asl::ApplicationParametersManager appParamsManager("cubeIncompressibleGravity",
+	                                                   "1.0",
+	                                                   "cubeIncompressibleGravity.ini");
 	asl::Parameter<asl::AVec<int> > size("size", "size 3D");
 	asl::Parameter<cl_float> dx("dx", "dx");
 	asl::Parameter<cl_float> dt("dt", "dt");
@@ -59,7 +61,7 @@ int main(int argc, char* argv[])
 	asl::Parameter<unsigned int> tsim("num_iterations", "number of iterations");
 	asl::Parameter<unsigned int> tout("num_it_out", "number of iterations between outputs");
 	
-	parametersManager.load(argc, argv, "cubeGravity");
+	appParamsManager.load(argc, argv);
 
 	Param bulkModulusNum(bulkModulus.v()/rho.v()/dx.v()/dx.v()*dt.v());
 	Param shearModulusNum(shearModulus.v()/rho.v()/dx.v()/dx.v()*dt.v());
@@ -96,7 +98,7 @@ int main(int argc, char* argv[])
 	bc.push_back(asl::generateBCRigidWall(elasticity, {asl::X0}));
 	asl::initAll(bc);
 
-	asl::WriterVTKXML writer(parametersManager.getFolderWithSlash() + "cubeGravity");
+	asl::WriterVTKXML writer(appParamsManager.getFolderWithSlash() + "cubeIncompressibleGravity");
 	writer.addScalars("map", *mapX);
 	writer.addVector("displacement", *displacement);
 	writer.addScalars("pressure", *elasticity->getPressureData());
diff --git a/examples/elastic/cubePoroelasticGravity.cc b/examples/elastic/cubePoroelasticGravity.cc
index 76bb017..786bba4 100644
--- a/examples/elastic/cubePoroelasticGravity.cc
+++ b/examples/elastic/cubePoroelasticGravity.cc
@@ -48,7 +48,9 @@ typedef asl::UValue<FlT> Param;
 
 int main(int argc, char* argv[])
 {
-	asl::ParametersManager parametersManager;
+	asl::ApplicationParametersManager appParamsManager("cubePoroelasticGravity",
+	                                                   "1.0",
+	                                                   "cubePoroelasticGravity.ini");
 	asl::Parameter<asl::AVec<int> > size("size", "size 3D");
 	asl::Parameter<cl_float> dx("dx", "dx");
 	asl::Parameter<cl_float> dt("dt", "dt");
@@ -61,7 +63,7 @@ int main(int argc, char* argv[])
 	asl::Parameter<unsigned int> tsim("num_iterations", "number of iterations");
 	asl::Parameter<unsigned int> tout("num_it_out", "number of iterations between outputs");
 	
-	parametersManager.load(argc, argv, "cubePoroElasticGravity");
+	appParamsManager.load(argc, argv);
 
 	Param bulkModulusNum(bulkModulus.v()/rho.v()/dx.v()/dx.v()*dt.v()*dt.v());
 	Param shearModulusNum(shearModulus.v()/rho.v()/dx.v()/dx.v()*dt.v()*dt.v());
@@ -101,7 +103,7 @@ int main(int argc, char* argv[])
 	asl::addBCRigidWall(bc, elasticity, {asl::X0});
 	asl::initAll(bc);
 
-	asl::WriterVTKXML writer(parametersManager.getFolderWithSlash() + "cubePoroElasticGravity");
+	asl::WriterVTKXML writer(appParamsManager.getFolderWithSlash() + "cubePoroelasticGravity");
 	writer.addScalars("map", *mapX);
 	writer.addVector("displacement", *displacement);
 	writer.addScalars("pressure", *elasticity->getPressureData());
diff --git a/examples/elastic/poroelastic.cc b/examples/elastic/poroelastic.cc
index 00b24d0..e8ba4c5 100644
--- a/examples/elastic/poroelastic.cc
+++ b/examples/elastic/poroelastic.cc
@@ -28,7 +28,7 @@
 #include <math/aslVectors.h>
 #include <data/aslDataWithGhostNodes.h>
 #include <aslGenerators.h>
-#include<acl/aclGenerators.h>
+#include <acl/aclGenerators.h>
 #include <num/aslFDPoroElasticity.h>
 #include <num/aslFDElasticityBC.h>
 #include <num/aslFDPoroElasticityBC.h>
@@ -52,7 +52,7 @@ typedef asl::UValue<FlT> Param;
 
 int main(int argc, char* argv[])
 {
-	asl::ParametersManager parametersManager;
+	asl::ApplicationParametersManager appParamsManager("poroelastic", "1.0", "poroelastic.ini");
 	asl::Parameter<asl::AVec<int> > size("size", "size 3D");
 	asl::Parameter<cl_float> dx("dx", "dx");
 	asl::Parameter<cl_float> dt("dt", "dt");
@@ -65,11 +65,11 @@ int main(int argc, char* argv[])
 	asl::Parameter<unsigned int> tsim("num_iterations", "number of iterations");
 	asl::Parameter<unsigned int> tout("num_it_out", "number of iterations between outputs");
 	
-	parametersManager.load(argc, argv, "poroelastic");
+	appParamsManager.load(argc, argv);
 		
 	std::cout<<"Jumping Box: Data initialization...";
 
-	asl::SPDataWithGhostNodesACLData map0(asl::read(parametersManager.getFolderWithSlash()+
+	asl::SPDataWithGhostNodesACLData map0(asl::read(appParamsManager.getFolderWithSlash()+
 	                                                "brain.vti", 0));
 //	asl::Block block(size.v(), dx.v());
 	asl::Block block(map0->getInternalBlock());
@@ -95,7 +95,7 @@ int main(int argc, char* argv[])
 //	initData(mapX->getEContainer(), map->getEContainer());
 	initData(mapX->getEContainer(), map0->getEContainer()*2.-1., acl::KERNEL_BASIC);
 	
-	asl::WriterVTKXML writer(parametersManager.getFolderWithSlash() + "displacement");
+	asl::WriterVTKXML writer(appParamsManager.getFolderWithSlash() + "poroelastic");
 	writer.addVector("displacement", *displacement);
 	writer.addScalars("pressure", *pressure);
 	writer.addScalars("map", *mapX);
diff --git a/examples/flow/multiphase_flow.cc b/examples/flow/multiphase_flow.cc
index 5f041d2..fed6020 100644
--- a/examples/flow/multiphase_flow.cc
+++ b/examples/flow/multiphase_flow.cc
@@ -55,7 +55,7 @@ class Parameters
 		void init();
 
   public:
-		asl::ParametersManager parametersManager;
+		asl::ApplicationParametersManager appParamsManager;
 		string folder;
 
 		asl::Block::DV size;
@@ -79,15 +79,14 @@ class Parameters
 		asl::Parameter<double> gasInVel;
 		
 		
-		void load(int argc, char * argv[],
-		          string programName,
-		          string programVersion);
+		void load(int argc, char * argv[]);
 		Parameters();
 		void updateNumValues();
 };
 
 
 Parameters::Parameters():
+	appParamsManager("multiphase_flow", "0.1", "multiphase_flow.ini"),
 	size(3),
 	dx(0.002, "dx", "space step"),
 	dt(1., "dt", "time step"),
@@ -105,12 +104,10 @@ Parameters::Parameters():
 }
 
 
-void Parameters::load(int argc, char * argv[],
-                      string programName,
-                      string programVersion)
+void Parameters::load(int argc, char * argv[])
 {
-	parametersManager.load(argc, argv, programName, programVersion);
-	folder = parametersManager.getFolderWithSlash();
+	appParamsManager.load(argc, argv);
+	folder = appParamsManager.getFolderWithSlash();
 
 	init();
 }
@@ -153,7 +150,7 @@ asl::SPDistanceFunction generateMixer(asl::Block & block, Parameters &params)
 int main(int argc, char *argv[])
 {
 	Parameters params;
-	params.load(argc, argv, "multiphase_flow", "0.1");
+	params.load(argc, argv);
 	
 	std::cout<<"Flow: Data initialization...";
 
diff --git a/examples/flow/pitot_tube_ice.cc b/examples/flow/pitot_tube_ice.cc
index 37f035e..5434419 100644
--- a/examples/flow/pitot_tube_ice.cc
+++ b/examples/flow/pitot_tube_ice.cc
@@ -53,7 +53,7 @@ class Parameters
 		void init();
 
   public:
-		asl::ParametersManager parametersManager;
+		asl::ApplicationParametersManager appParamsManager;
 		string folder;
 
 		asl::Block::DV size;
@@ -76,15 +76,14 @@ class Parameters
 		asl::Parameter<double> humidity;
 		asl::Parameter<double> flowVel;
 		
-		void load(int argc, char * argv[],
-		          string programName,
-		          string programVersion);
+		void load(int argc, char * argv[]);
 		Parameters();
 		void updateNumValues();
 };
 
 
 Parameters::Parameters():
+	appParamsManager("pitot_tube_ice", "0.1", "pitot_tube_ice.ini"),
 	size(3),
 	dx(0.000125, "dx", "space step"),
 	dt(1., "dt", "time step"),
@@ -102,12 +101,10 @@ Parameters::Parameters():
 }
 
 
-void Parameters::load(int argc, char * argv[],
-                      string programName,
-                      string programVersion)
+void Parameters::load(int argc, char * argv[])
 {
-	parametersManager.load(argc, argv, programName, programVersion);
-	folder = parametersManager.getFolderWithSlash();
+	appParamsManager.load(argc, argv);
+	folder = appParamsManager.getFolderWithSlash();
 
 	init();
 }
@@ -154,7 +151,7 @@ asl::SPDistanceFunction generateGeometry(asl::Block & block, Parameters &params)
 int main(int argc, char *argv[])
 {
 	Parameters params;
-	params.load(argc, argv, "pitot_tube_ice", "0.1");
+	params.load(argc, argv);
 	
 	std::cout<<"Flow: Data initialization...";
 
diff --git a/examples/jumpingObjects/jumpingBox.cc b/examples/jumpingObjects/jumpingBox.cc
index 19b799a..11f47ae 100644
--- a/examples/jumpingObjects/jumpingBox.cc
+++ b/examples/jumpingObjects/jumpingBox.cc
@@ -45,7 +45,8 @@ typedef asl::UValue<FlT> Param;
 
 int main(int argc, char* argv[])
 {
-	asl::ParametersManager parametersManager;
+	asl::ApplicationParametersManager appParamsManager("jumpingBox", "1.0",
+	                                                   "jumpingBox.ini");
 	asl::Parameter<asl::AVec<int> > size("size", "size 3D");
 	asl::Parameter<cl_float> dx("dx", "dx");
 	asl::Parameter<cl_float> dt("dt", "dt");
@@ -57,7 +58,7 @@ int main(int argc, char* argv[])
 	asl::Parameter<unsigned int> tsim("num_iterations", "number of iterations");
 	asl::Parameter<unsigned int> tout("num_it_out", "number of iterations between outputs");
 	
-	parametersManager.load(argc, argv, "jumpingBox");
+	appParamsManager.load(argc, argv);
 
 	Param bulkModulusNum(bulkModulus.v()/rho.v()/dx.v()/dx.v());
 	Param shearModulusNum(shearModulus.v()/rho.v()/dx.v()/dx.v());
@@ -70,7 +71,7 @@ int main(int argc, char* argv[])
 	auto displacement(asl::generateDataContainerACL_SP<FlT>(block, 3, 1u));
 	acl::initData(displacement->getEContainer(), acl::generateVEConstantN(3,0));
 
-	asl::WriterVTKXML writer(parametersManager.getFolderWithSlash() + "displacement");
+	asl::WriterVTKXML writer(appParamsManager.getFolderWithSlash() + "jumpingBox");
 	writer.addScalars("displacement", *displacement);
 	writer.addVector("displacement", *displacement);
 	writer.write();
diff --git a/examples/levelSet/levelSetBasic.cc b/examples/levelSet/levelSetBasic.cc
index b13ecda..dab1ceb 100644
--- a/examples/levelSet/levelSetBasic.cc
+++ b/examples/levelSet/levelSetBasic.cc
@@ -47,7 +47,8 @@ acl::TypeID type(acl::typeToTypeID<FlT>());
 
 int main(int argc, char* argv[])
 {
-	asl::ParametersManager parametersManager;
+	asl::ApplicationParametersManager appParamsManager("levelSetBasic", "1.0",
+	                                                   "levelSetBasic.ini");
 
 	asl::Parameter<asl::AVec<int>> size("size", "size");
 	asl::Parameter<FlT> dx("dx", "dx");
@@ -59,7 +60,7 @@ int main(int argc, char* argv[])
 	asl::Parameter<cl_uint> nIterations("nIterations", "Number of iterations");
 	asl::Parameter<cl_uint> nItOut("nItOut", "Number of iterations for output");
 
-	parametersManager.load(argc, argv, "levelSetBasic");
+	appParamsManager.load(argc, argv);
 	
 	std::cout<<"Jumping Box: Data initialization...";
 
@@ -72,7 +73,7 @@ int main(int argc, char* argv[])
 	auto velocity(asl::generateDataContainerConst_SP(block, v.v(), 1u));
 
 	
-	asl::WriterVTKXML writer(parametersManager.getFolder()+"/"+"levelSet");
+	asl::WriterVTKXML writer(appParamsManager.getFolderWithSlash() + "levelSetBasic");
 	writer.addScalars("levelSet", *levelSet);
 	
 	std::cout << "Finished" << endl;
diff --git a/examples/levelSet/levelSetFacetedGrowth.cc b/examples/levelSet/levelSetFacetedGrowth.cc
index 7ab3f20..961e553 100644
--- a/examples/levelSet/levelSetFacetedGrowth.cc
+++ b/examples/levelSet/levelSetFacetedGrowth.cc
@@ -47,7 +47,8 @@ acl::TypeID type(acl::typeToTypeID<FlT>());
 
 int main(int argc, char* argv[])
 {
-	asl::ParametersManager parametersManager;
+	asl::ApplicationParametersManager appParamsManager("levelSetFacetedGrowth", "1.0",
+	                                                   "levelSetFacetedGrowth.ini");
 
 	asl::Parameter<asl::AVec<int>> size("size", "size");
 	asl::Parameter<FlT> dx("dx", "dx");
@@ -64,7 +65,7 @@ int main(int argc, char* argv[])
 	asl::Parameter<cl_uint> nIterations("nIterations", "Number of iterations");
 	asl::Parameter<cl_uint> nItOut("nItOut", "Number of iterations for output");
 
-	parametersManager.load(argc, argv, "levelSetFacetedGrowth");
+	appParamsManager.load(argc, argv);
 
 	std::cout<<"LevelSet: Data initialization...";
 
@@ -80,7 +81,7 @@ int main(int argc, char* argv[])
 	auto superSaturation(asl::generateDataContainerConst_SP(block, superS.v(), 1u));
 
 	
-	asl::WriterVTKXML writer(parametersManager.getFolder()+"/"+"levelSetFG");
+	asl::WriterVTKXML writer(appParamsManager.getFolderWithSlash() + "levelSetFacetedGrowth");
 	writer.addScalars("levelSet", *levelSet);
 	
 	std::cout << "Finished" << endl;
diff --git a/examples/levelSet/levelSetNormalGrowth.cc b/examples/levelSet/levelSetNormalGrowth.cc
index e6e48a8..50b8f33 100644
--- a/examples/levelSet/levelSetNormalGrowth.cc
+++ b/examples/levelSet/levelSetNormalGrowth.cc
@@ -49,7 +49,8 @@ acl::TypeID type(acl::typeToTypeID<FlT>());
 
 int main(int argc, char* argv[])
 {
-	asl::ParametersManager parametersManager;
+	asl::ApplicationParametersManager appParamsManager("levelSetNormalGrowth", "1.0",
+	                                                   "levelSetNormalGrowth.ini");
 
 	asl::Parameter<asl::AVec<int>> size("size", "size");
 	asl::Parameter<FlT> dx("dx", "dx");
@@ -61,7 +62,7 @@ int main(int argc, char* argv[])
 	asl::Parameter<cl_uint> nIterations("nIterations", "Number of iterations");
 	asl::Parameter<cl_uint> nItOut("nItOut", "Number of iterations for output");
 
-	parametersManager.load(argc, argv, "levelSetNormalGrowth");
+	appParamsManager.load(argc, argv);
 	
 	std::cout<<"LevelSet: Data initialization...";
 
@@ -77,7 +78,7 @@ int main(int argc, char* argv[])
 	auto superSaturation(asl::generateDataContainerConst_SP(block, superS.v(), 1u));
 
 	
-	asl::WriterVTKXML writer(parametersManager.getFolder()+"/"+"levelSetNG");
+	asl::WriterVTKXML writer(appParamsManager.getFolderWithSlash() + "levelSetNormalGrowth");
 	writer.addScalars("levelSet", *levelSet);
 	
 	std::cout << "Finished" << endl;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/asl.git



More information about the debian-science-commits mailing list