Commit d8b47d8f authored by Thomas Witkowski's avatar Thomas Witkowski
Browse files

* Small changes

parent 639f286f
......@@ -24,7 +24,8 @@ namespace AMDiS {
{ NULL,
NEW Line(NULL),
NEW Triangle(NULL),
NEW Tetrahedron(NULL) };
NEW Tetrahedron(NULL)
};
void Msg::wait(bool w)
{
......@@ -43,7 +44,7 @@ namespace AMDiS {
FUNCNAME("Msg::change_out()");
if (fp) {
if (out && *out != ::std::cout && *out != ::std::cerr) {
if (out && *out != ::std::cout && *out != ::std::cerr) {
dynamic_cast< ::std::ofstream*>(out)->close();
delete out;
}
......
......@@ -444,7 +444,6 @@ namespace AMDiS {
*/
static const Element *getReferenceElement(int dim) {
FUNCNAME("Global::getReferenceElement()");
initTest();
TEST_EXIT((dim > 0) && (dim < 4))("invalid dim: %d\n", dim);
return referenceElement[dim];
};
......@@ -453,7 +452,6 @@ namespace AMDiS {
* returns geometrical information. Currently this is only dimOfWorld.
*/
static inline int getGeo(GeoIndex p) {
initTest();
if (WORLD == p)
return dimOfWorld;
......@@ -466,7 +464,6 @@ namespace AMDiS {
* getGeo(VERTEX, 3) returns 4 because a Tetrahedron has 4 vertices.
*/
static inline int getGeo(GeoIndex p, int dim) {
initTest();
TEST_EXIT_DBG((p >= MINPART) && (p <= MAXPART))
("Calling for invalid geometry value %d\n",p);
TEST_EXIT_DBG((dim >= 0) && (dim < 4))
......@@ -477,25 +474,17 @@ namespace AMDiS {
return geoIndexTable[dim][p - MINPART];
}
private:
/** \brief
* Global is a pure static class. So the constructor is private to avoid
* instantiation.
*/
Global();
/** \brief
* inits the Global class with the help of Parameters.
*/
static void init();
private:
/** \brief
* calls init if Global is not yet initialized.
* Global is a pure static class. So the constructor is private to avoid
* instantiation.
*/
static inline void initTest() {
if (dimOfWorld == 0)
init();
};
Global();
private:
/** \brief
......@@ -512,6 +501,9 @@ namespace AMDiS {
*/
static Element *referenceElement[4];
/** \brief
* Stores the precalculated results that should be returned by Global::getGeo.
*/
static ::std::vector< ::std::vector< int > > geoIndexTable;
};
......
......@@ -565,13 +565,14 @@ namespace AMDiS {
initIntern();
if (0 == fn.size()) {
Global::init();
return;
}
if (NULL == flags) {
singlett->read(fn);
} else {
singlett->inputFile.open(fn.data(),::std::ios::in);
singlett->inputFile.open(fn.data(), ::std::ios::in);
if (!(singlett->inputFile.rdstate())) {
ERROR("can not read from file %s\n", fn.data());
return;
......@@ -676,6 +677,7 @@ namespace AMDiS {
if (p && singlett->msgInfo)
printParameters();
Global::init();
return;
}
......
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