From abe69c4b544082e37b28588f5eb3bb3f74ca7059 Mon Sep 17 00:00:00 2001 From: Nicolas Marsic <nicolas.marsic@gmail.com> Date: Fri, 23 Nov 2012 14:30:28 +0000 Subject: [PATCH] Scalar SteadyWave -- Seems Ok with BOTH Lagrange and Zaglmayr ... --- FunctionSpace/BasisScalar.cpp | 18 ++++++++++----- FunctionSpace/BasisVector.cpp | 40 +++++++++++++++++++-------------- FunctionSpace/FunctionSpace.cpp | 2 +- 3 files changed, 36 insertions(+), 24 deletions(-) diff --git a/FunctionSpace/BasisScalar.cpp b/FunctionSpace/BasisScalar.cpp index 1e792ed936..3c00e67d27 100644 --- a/FunctionSpace/BasisScalar.cpp +++ b/FunctionSpace/BasisScalar.cpp @@ -13,20 +13,26 @@ BasisScalar::~BasisScalar(void){ string BasisScalar::toString(void) const{ stringstream stream; + stream << "Vertex Based:" << endl; for(int i = 0; i < nVertex; i++) - stream << "f(" << i << ") = " + stream << " f(" << i << ") = " << (*node)[i]->toString() << endl; + stream << "Edge Based:" << endl; for(int i = 0; i < nEdge; i++) - stream << "f(" << i + nVertex << ") = " - << (*(*edge)[0])[i]->toString() << endl; + for(int j = 0; j < nEdgeClosure; j++) + stream << " f_" << j << "(" << i << ") = " + << (*(*edge)[j])[i]->toString() << endl; + stream << "Face Based:" << endl; for(int i = 0; i < nFace; i++) - stream << "f(" << i + nVertex + nEdge << ") = " - << (*(*face)[0])[i]->toString() << endl; + for(int j = 0; j < nFaceClosure; j++) + stream << " f_" << j << "(" << i << ") = " + << (*(*face)[j])[i]->toString() << endl; + stream << "Cell Based:" << endl; for(int i = 0; i < nCell; i++) - stream << "f(" << i + nVertex + nEdge + nFace << ") = " + stream << " f(" << i << ") = " << (*cell)[i]->toString() << endl; return stream.str(); diff --git a/FunctionSpace/BasisVector.cpp b/FunctionSpace/BasisVector.cpp index abec04f83e..7b13188de7 100644 --- a/FunctionSpace/BasisVector.cpp +++ b/FunctionSpace/BasisVector.cpp @@ -13,29 +13,35 @@ BasisVector::~BasisVector(void){ string BasisVector::toString(void) const{ stringstream stream; + stream << "Vertex Based:" << endl; for(int i = 0; i < nVertex; i++) - stream << "f(" << i << ") = " << endl - << "[ " <<(*(*node)[i])[0].toString() << " ]" << endl - << "[ " <<(*(*node)[i])[1].toString() << " ]" << endl - << "[ " <<(*(*node)[i])[2].toString() << " ]" << endl; + stream << " f(" << i << ") = " << endl + << " [ " <<(*(*node)[i])[0].toString() << " ]" << endl + << " [ " <<(*(*node)[i])[1].toString() << " ]" << endl + << " [ " <<(*(*node)[i])[2].toString() << " ]" << endl; + stream << "Edge Based:" << endl; for(int i = 0; i < nEdge; i++) - stream << "f(" << i + nVertex << ") = " << endl - << "[ " << (*(*(*edge)[0])[i])[0].toString() << " ]" << endl - << "[ " << (*(*(*edge)[0])[i])[1].toString() << " ]" << endl - << "[ " << (*(*(*edge)[0])[i])[2].toString() << " ]" << endl; + for(int j = 0; j < nEdgeClosure; j++) + stream << " f_" << j << "(" << i << ") = " << endl + << " [ " << (*(*(*edge)[j])[i])[0].toString() << " ]" << endl + << " [ " << (*(*(*edge)[j])[i])[1].toString() << " ]" << endl + << " [ " << (*(*(*edge)[j])[i])[2].toString() << " ]" << endl; + stream << "Face Based:" << endl; for(int i = 0; i < nFace; i++) - stream << "f(" << i + nVertex + nEdge << ") = " << endl - << "[ " << (*(*(*face)[0])[i])[0].toString() << " ]" << endl - << "[ " << (*(*(*face)[0])[i])[1].toString() << " ]" << endl - << "[ " << (*(*(*face)[0])[i])[2].toString() << " ]" << endl; - + for(int j = 0; j < nFaceClosure; j++) + stream << " f_" << j << "(" << i << ") = " << endl + << " [ " << (*(*(*face)[j])[i])[0].toString() << " ]" << endl + << " [ " << (*(*(*face)[j])[i])[1].toString() << " ]" << endl + << " [ " << (*(*(*face)[j])[i])[2].toString() << " ]" << endl; + + stream << "Cell Based:" << endl; for(int i = 0; i < nCell; i++) - stream << "f(" << i + nVertex + nEdge + nFace << ") = " - << "[ " << (*(*cell)[i])[0].toString() << " ]" << endl - << "[ " << (*(*cell)[i])[1].toString() << " ]" << endl - << "[ " << (*(*cell)[i])[2].toString() << " ]" << endl; + stream << " f(" << i << ") = " + << " [ " << (*(*cell)[i])[0].toString() << " ]" << endl + << " [ " << (*(*cell)[i])[1].toString() << " ]" << endl + << " [ " << (*(*cell)[i])[2].toString() << " ]" << endl; return stream.str(); } diff --git a/FunctionSpace/FunctionSpace.cpp b/FunctionSpace/FunctionSpace.cpp index 93cea8990b..ffbce1bc6c 100644 --- a/FunctionSpace/FunctionSpace.cpp +++ b/FunctionSpace/FunctionSpace.cpp @@ -60,7 +60,7 @@ void FunctionSpace::build(const GroupOfElement& goe, type = basisType; basis = BasisGenerator::generate(elementType, basisType, - order, "lagrange"); + order, "zaglmayr"); // Number of *Per* Entity functions // fPerVertex = basis->getNVertexBased() / nVertex; -- GitLab