Skip to content
Snippets Groups Projects
Commit 7d472011 authored by Naumann, Andreas's avatar Naumann, Andreas
Browse files

first tests data production, need to change data for speedup

parent 613caf74
No related branches found
No related tags found
No related merge requests found
Showing
with 40 additions and 43 deletions
project(tests) project(tests)
add_subdirectory(datacreation) add_subdirectory(datacreation EXCLUDE_FROM_ALL)
project(testdatacreation) project(testdatacreation)
message("source-dir: ${AMDiS_SOURCE_DIR}")
include_directories(${AMDiS_SOURCE_DIR}) include_directories(${AMDiS_SOURCE_DIR})
file(GLOB PROJECTFILES src/*Project.cpp) file(GLOB PROJECTFILES src/*Project.cpp)
set(CREATELINE "")
foreach(projectfile ${PROJECTFILES}) foreach(projectfile ${PROJECTFILES})
#create creatorname #create creatorname
get_filename_component(CppName ${projectfile}, NAME_WE) get_filename_component(CppName ${projectfile} NAME_WE)
string(REPLACE "Project" "" creatorsuffix ${CppName}) string(REPLACE "Project" "" creatorsuffix ${CppName})
set(PROJECTINCLUDE "${CppName}.h") set(PROJECTINCLUDE "${CppName}.h")
set(CURRENTPROJECTTYPE "${creatorsuffix}demo")
string(TOLOWER "${creatorsuffix}" creatorsuffix_lower)
set(BASENAME "${creatorsuffix_lower}")
configure_file(src/creator_base.cpp src/creator${creatorsuffix}.cpp @ONLY) configure_file(src/creator_base.cpp src/creator${creatorsuffix}.cpp @ONLY)
add_executable(creator${creatorsuffix} src/creator${creatorsuffix}.cpp src/ProjectList.cpp ${projectfile}) add_executable(creator${creatorsuffix} src/creator${creatorsuffix}.cpp src/ProjectList.cpp ${projectfile})
target_link_libraries(creator${creatorsuffix} ${AMDiS_LIBS}) target_link_libraries(creator${creatorsuffix} ${AMDiS_LIBS} boost_filesystem)
file(GLOB initfiles RELATIVE ${CMAKE_CURRENT_BINARY_DIR} init/${creatorsuffix_lower}*.dat*)
foreach(initfile ${initfiles})
get_filename_component(initfile_ext ${initfile} EXT)
string(REPLACE ".dat." "" initfile_ext "${initfile_ext}")
set(curoutputdatafile "../testdata/${creatorsuffix_lower}_${initfile_ext}.arh")
set(CREATELINE "${CREATELINE}./creator${creatorsuffix} ${initfile} ${curoutputdatafile}\n")
endforeach(initfile)
endforeach(projectfile) endforeach(projectfile)
configure_file(create_base.sh create.sh)
@CREATELINE@
../testdata/init
\ No newline at end of file
../testdata/macro
\ No newline at end of file
...@@ -28,7 +28,7 @@ public: ...@@ -28,7 +28,7 @@ public:
} }
}; };
BallDemo::BallDemo(): Balldemo::Balldemo():
ball("ball"), ball("ball"),
ballCenter(NULL), ballCenter(NULL),
adaptInfo(NULL), adaptInfo(NULL),
...@@ -38,7 +38,7 @@ BallDemo::BallDemo(): ...@@ -38,7 +38,7 @@ BallDemo::BallDemo():
{ {
} }
BallDemo::~BallDemo() { Balldemo::~Balldemo() {
if(matrixOperator != NULL) if(matrixOperator != NULL)
delete matrixOperator; delete matrixOperator;
if(rhsOperator != NULL) if(rhsOperator != NULL)
...@@ -51,7 +51,7 @@ BallDemo::~BallDemo() { ...@@ -51,7 +51,7 @@ BallDemo::~BallDemo() {
delete adaptInfo; delete adaptInfo;
} }
void BallDemo::create(std::string& filename) { void Balldemo::create(std::string& filename) {
// ===== init parameters ===== // ===== init parameters =====
Parameters::init(false, filename); Parameters::init(false, filename);
ballCenter = new WorldVector< double >(); ballCenter = new WorldVector< double >();
...@@ -89,7 +89,7 @@ void BallDemo::create(std::string& filename) { ...@@ -89,7 +89,7 @@ void BallDemo::create(std::string& filename) {
} }
int BallDemo::solve(SolutionInformation& solinfo) { int Balldemo::solve(SolutionInformation& solinfo) {
assert(adaptInfo!=NULL); assert(adaptInfo!=NULL);
assert(adapt!=NULL); assert(adapt!=NULL);
assert(matrixOperator!=NULL); assert(matrixOperator!=NULL);
...@@ -99,13 +99,14 @@ int BallDemo::solve(SolutionInformation& solinfo) { ...@@ -99,13 +99,14 @@ int BallDemo::solve(SolutionInformation& solinfo) {
solinfo.dofVec = ball.getSolution(); solinfo.dofVec = ball.getSolution();
return retCode; return retCode;
} }
/*
void createProjectList(ProjectList& list) { void createProjectList(ProjectList& list) {
list.clear(); list.clear();
Project* demo = new BallDemo(); Project* demo = new Balldemo();
ProjectInfo ballInfo(demo, "init/ball.dat.2d", "../testdata/balldata_2d"); ProjectInfo ballInfo(demo, "init/ball.dat.2d", "../testdata/balldata_2d");
list.push_back(ballInfo); list.push_back(ballInfo);
ballInfo = ProjectInfo(demo, "init/ball.dat.3d", "../testdata/balldata_3d"); ballInfo = ProjectInfo(demo, "init/ball.dat.3d", "../testdata/balldata_3d");
list.push_back(ballInfo); list.push_back(ballInfo);
} }
*/
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
using namespace AMDiS; using namespace AMDiS;
class BallDemo : public Project { class Balldemo : public Project {
ProblemScal ball; ProblemScal ball;
WorldVector< double >* ballCenter; WorldVector< double >* ballCenter;
AdaptInfo* adaptInfo; AdaptInfo* adaptInfo;
...@@ -15,8 +15,8 @@ class BallDemo : public Project { ...@@ -15,8 +15,8 @@ class BallDemo : public Project {
Operator* matrixOperator; Operator* matrixOperator;
Operator* rhsOperator; Operator* rhsOperator;
public: public:
BallDemo() ; Balldemo() ;
~BallDemo() ; ~Balldemo() ;
void create(std::string& ) ; void create(std::string& ) ;
int solve(SolutionInformation&); int solve(SolutionInformation&);
......
...@@ -48,7 +48,7 @@ Bunnydemo::~Bunnydemo() { ...@@ -48,7 +48,7 @@ Bunnydemo::~Bunnydemo() {
delete rhsOperator; delete rhsOperator;
} }
void Bunnydemo::create(string filename) { void Bunnydemo::create(string& filename) {
// ===== init parameters ===== // ===== init parameters =====
Parameters::init(false, filename); Parameters::init(false, filename);
...@@ -87,5 +87,3 @@ int Bunnydemo::solve(SolutionInformation& info) { ...@@ -87,5 +87,3 @@ int Bunnydemo::solve(SolutionInformation& info) {
return retCode; return retCode;
} }
void createProjectList(ProjectList& list) {
}
...@@ -17,7 +17,7 @@ class Bunnydemo : public Project { ...@@ -17,7 +17,7 @@ class Bunnydemo : public Project {
Bunnydemo(); Bunnydemo();
~Bunnydemo(); ~Bunnydemo();
void create(string filename); void create(string& filename);
int solve(SolutionInformation&); int solve(SolutionInformation&);
}; };
#endif #endif
...@@ -48,7 +48,7 @@ Elliptdemo::~Elliptdemo() { ...@@ -48,7 +48,7 @@ Elliptdemo::~Elliptdemo() {
delete adaptInfo; delete adaptInfo;
} }
void Elliptdemo::create(std::string filename) { void Elliptdemo::create(std::string& filename) {
// ===== init parameters ===== // ===== init parameters =====
Parameters::init(true, filename); Parameters::init(true, filename);
...@@ -90,5 +90,3 @@ int Elliptdemo::solve(SolutionInformation& info) { ...@@ -90,5 +90,3 @@ int Elliptdemo::solve(SolutionInformation& info) {
return retCode; return retCode;
} }
void createProjectList(ProjectList& list) {
}
...@@ -15,7 +15,7 @@ class Elliptdemo : public Project { ...@@ -15,7 +15,7 @@ class Elliptdemo : public Project {
Elliptdemo(); Elliptdemo();
~Elliptdemo(); ~Elliptdemo();
void create(std::string filename); void create(std::string& filename);
int solve(SolutionInformation& info); int solve(SolutionInformation& info);
}; };
#endif #endif
...@@ -56,7 +56,7 @@ Heatdemo::~Heatdemo() { ...@@ -56,7 +56,7 @@ Heatdemo::~Heatdemo() {
delete Fop; delete Fop;
} }
void Heatdemo::create(string filename) { void Heatdemo::create(string& filename) {
// ===== init parameters ===== // ===== init parameters =====
Parameters::init(false, filename); Parameters::init(false, filename);
// Parameters::readArgv(argc, argv); // Parameters::readArgv(argc, argv);
...@@ -127,6 +127,3 @@ int Heatdemo::solve(SolutionInformation& info) { ...@@ -127,6 +127,3 @@ int Heatdemo::solve(SolutionInformation& info) {
info.dofVec = heatSpace.getSolution(); info.dofVec = heatSpace.getSolution();
return retCode; return retCode;
} }
void createProjectList(ProjectList& list) {
}
...@@ -21,7 +21,7 @@ class Heatdemo : public Project { ...@@ -21,7 +21,7 @@ class Heatdemo : public Project {
Heatdemo(); Heatdemo();
~Heatdemo(); ~Heatdemo();
void create(string filename); void create(string& filename);
int solve(SolutionInformation& info); int solve(SolutionInformation& info);
}; };
......
...@@ -57,7 +57,7 @@ Neumanndemo::~Neumanndemo() { ...@@ -57,7 +57,7 @@ Neumanndemo::~Neumanndemo() {
delete adaptInfo; delete adaptInfo;
} }
void Neumanndemo::create(string filename) { void Neumanndemo::create(string& filename) {
// ===== init parameters ===== // ===== init parameters =====
Parameters::init(true, filename); Parameters::init(true, filename);
...@@ -94,6 +94,3 @@ int Neumanndemo::solve(SolutionInformation& info) { ...@@ -94,6 +94,3 @@ int Neumanndemo::solve(SolutionInformation& info) {
info.dofVec = neumann.getSolution(); info.dofVec = neumann.getSolution();
return retCode; return retCode;
} }
void createProjectList(ProjectList& list) {
}
...@@ -14,7 +14,7 @@ class Neumanndemo : public Project { ...@@ -14,7 +14,7 @@ class Neumanndemo : public Project {
Neumanndemo(); Neumanndemo();
~Neumanndemo(); ~Neumanndemo();
void create(string filename); void create(string& filename);
int solve(SolutionInformation&); int solve(SolutionInformation&);
}; };
#endif #endif
...@@ -32,7 +32,7 @@ Parametricdemo::~Parametricdemo() { ...@@ -32,7 +32,7 @@ Parametricdemo::~Parametricdemo() {
delete adaptInfo; delete adaptInfo;
} }
void Parametricdemo::create(string filename) { void Parametricdemo::create(string& filename) {
// ===== init parameters ===== // ===== init parameters =====
Parameters::init(false, filename); Parameters::init(false, filename);
...@@ -67,6 +67,3 @@ int Parametricdemo::solve(SolutionInformation& info) { ...@@ -67,6 +67,3 @@ int Parametricdemo::solve(SolutionInformation& info) {
info.dofVec = parametric.getSolution(); info.dofVec = parametric.getSolution();
return retCode; return retCode;
} }
void createProjectList(ProjectList& list) {
}
...@@ -16,7 +16,7 @@ class Parametricdemo : public Project { ...@@ -16,7 +16,7 @@ class Parametricdemo : public Project {
Parametricdemo(); Parametricdemo();
~Parametricdemo(); ~Parametricdemo();
void create(string filename); void create(string& filename);
int solve(SolutionInformation&); int solve(SolutionInformation&);
}; };
......
...@@ -46,7 +46,7 @@ Periodicdemo::~Periodicdemo() { ...@@ -46,7 +46,7 @@ Periodicdemo::~Periodicdemo() {
delete adaptInfo; delete adaptInfo;
} }
void Periodicdemo::create(string filename) { void Periodicdemo::create(string& filename) {
// ===== init parameters ===== // ===== init parameters =====
Parameters::init(false, filename); Parameters::init(false, filename);
...@@ -85,6 +85,3 @@ int Periodicdemo::solve(SolutionInformation& info) { ...@@ -85,6 +85,3 @@ int Periodicdemo::solve(SolutionInformation& info) {
info.dofVec = periodic.getSolution(); info.dofVec = periodic.getSolution();
return retCode; return retCode;
} }
void createProjectList(ProjectList& list) {
}
...@@ -14,7 +14,7 @@ class Periodicdemo : public Project { ...@@ -14,7 +14,7 @@ class Periodicdemo : public Project {
Periodicdemo(); Periodicdemo();
~Periodicdemo(); ~Periodicdemo();
void create(string filename); void create(string& filename);
int solve(SolutionInformation&); int solve(SolutionInformation&);
}; };
#endif #endif
...@@ -58,6 +58,4 @@ class ProjectInfo { ...@@ -58,6 +58,4 @@ class ProjectInfo {
} }
}; };
typedef list< ProjectInfo > ProjectList;
void createProjectList(ProjectList& );
#endif #endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment