From 85b6142e9914b0547f9a2a0593e77761d229a8b4 Mon Sep 17 00:00:00 2001 From: Andreas Naumann <andreas.naumann@tu-dresden.de> Date: Thu, 16 Dec 2010 09:55:53 +0000 Subject: [PATCH] updated meshtest with dofadmins and checking the functionname pointer in addGlobalParameter now --- AMDiS/src/Parameters.cc | 8 ++++++- AMDiS/test/Meshtest/src/Meshtest.cpp | 36 ++++++++++++++++------------ 2 files changed, 28 insertions(+), 16 deletions(-) diff --git a/AMDiS/src/Parameters.cc b/AMDiS/src/Parameters.cc index c64527fd..1c494da1 100644 --- a/AMDiS/src/Parameters.cc +++ b/AMDiS/src/Parameters.cc @@ -691,7 +691,13 @@ namespace AMDiS { if (key.size() == 0 || par.size() == 0) return; - singlett->addParam(key, par, std::string(file), line, fname); + std::string file_str; + if(file != NULL) + file_str = std::string(file); + std::string fname_str; + if(fname != NULL) + fname_str = std::string(fname); + singlett->addParam(key, par, file_str, line, fname_str); int val = 10; // defualt for level of information getGlobalParameter(0, "level of information", "%d", &val); diff --git a/AMDiS/test/Meshtest/src/Meshtest.cpp b/AMDiS/test/Meshtest/src/Meshtest.cpp index 00024a70..4f8811b4 100644 --- a/AMDiS/test/Meshtest/src/Meshtest.cpp +++ b/AMDiS/test/Meshtest/src/Meshtest.cpp @@ -1,26 +1,32 @@ #include "Mesh.h" #include "Parameters.h" +#include "ProblemScal.h" + +#include <sstream> using namespace AMDiS; +void testMesh(int dim) { + std::stringstream ss; + ss<< dim; + Parameters::addGlobalParameter(0, "dimension of world", ss.str()); + Global::init(); + Mesh mesh("testMesh", dim); + DimVec< int > ln_dof(dim, DEFAULT_VALUE, 0); + ln_dof[VERTEX]=1; + mesh.createDOFAdmin("vertex_dofs", ln_dof); + mesh.initialize(); +} + int main(int argc, char** argv) { - FUNCNAME("no function"); //cannot use Parameters::addGlobalParameter(...) because of some string errors -// ADD_PARAMETER(1,"dimension of world","1"); -// ADD_PARAMETER(1,"testMesh1->macro file name","macro/macro.stand.1d"); -// ADD_PARAMETER(1,"testMesh2->macro file name","macro/macro.stand.2d"); -// ADD_PARAMETER(1,"testMesh3->macro file name","macro/macro.stand.3d"); - - Parameters::init(1,"init/ball.dat.2d"); - - Global::init(); + Parameters::addGlobalParameter(0,"testMesh1->macro file name","macro/macro.stand.1d"); + Parameters::addGlobalParameter(0,"testMesh2->macro file name","macro/macro.stand.2d"); + Parameters::addGlobalParameter(0,"testMesh3->macro file name","macro/macro.stand.3d"); - Mesh mesh1("ballMesh",2); - Mesh mesh2("testMesh1",2); - Mesh mesh3("testMesh1",3); + testMesh(1); + testMesh(2); + testMesh(3); - mesh1.initialize(); - mesh2.initialize(); - mesh3.initialize(); return 0; } -- GitLab