Commit 7f849e47 authored by Praetorius, Simon's avatar Praetorius, Simon

DOFSerializer implementation put into .cc file

parent 5de0fd6f
......@@ -28,6 +28,8 @@ void DOFSerializer::gather(int macroIndex, DOFVector<double> const* vec, std::ve
values.clear();
}
TEST_EXIT(mesh_ == vec->getFeSpace()->getMesh())("Incompatible meshes!\n");
TraverseStack stack;
ElInfo *elInfo = stack.traverseFirstOneMacro(mesh_, macroIndex, -1, Mesh::CALL_EVERY_EL_PREORDER);
while (elInfo) {
......@@ -51,12 +53,13 @@ void DOFSerializer::gather(GeoIndex geo, ElInfo* elInfo, DOFVector<double> const
{
int nd;
if ((nd = admin_->getNumberOfDofs(geo))) {
int vertices = mesh_->getGeo(geo);
int entities = mesh_->getGeo(geo);
int nd0 = admin_->getNumberOfPreDofs(geo);
int n0 = mesh_->getNode(geo);
for (int n = 0; n < vertices; n++) {
for (int n = 0; n < entities; n++) {
for(int d = 0; d < nd; d++) {
DegreeOfFreedom globalDof = elInfo->getElement()->getDof(n0 + n, nd0 + d);
TEST_EXIT(globalDof < visited_.size())("visited container not large enough!\n");
if (!visited_[globalDof]) {
visited_[globalDof] = true;
values.push_back((*vec)[globalDof]);
......@@ -86,6 +89,8 @@ void DOFSerializer::scatter(int macroIndex, std::vector<double> const& values, D
counter_ = 0u;
}
TEST_EXIT(mesh_ == vec->getFeSpace()->getMesh())("Incompatible meshes!\n");
TraverseStack stack;
ElInfo *elInfo = stack.traverseFirstOneMacro(mesh_, macroIndex, -1, Mesh::CALL_EVERY_EL_PREORDER);
while (elInfo) {
......@@ -109,15 +114,16 @@ void DOFSerializer::scatter(GeoIndex geo, ElInfo* elInfo, std::vector<double> co
{
int nd;
if ((nd = admin_->getNumberOfDofs(geo))) {
int vertices = mesh_->getGeo(geo);
int entities = mesh_->getGeo(geo);
int nd0 = admin_->getNumberOfPreDofs(geo);
int n0 = mesh_->getNode(geo);
for (int n = 0; n < vertices; n++) {
for (int n = 0; n < entities; n++) {
for(int d = 0; d < nd; d++) {
DegreeOfFreedom globalDof = elInfo->getElement()->getDof(n0 + n, nd0 + d);
TEST_EXIT(globalDof < visited_.size())("visited container not large enough!\n");
if (!visited_[globalDof]) {
visited_[globalDof] = true;
assert( values.size() < counter_);
TEST_EXIT(counter_ < values.size())("Not enough values in value-container!\n");
(*vec)[globalDof] = values[counter_++];
}
}
......
......@@ -23,5 +23,5 @@ cd ${BUILD_DIR}
./bootstrap.sh --prefix=${BOOST_PREFIX} \
--with-libraries=system,iostreams,filesystem,program_options,date_time,test,thread,mpi,serialization
echo "using mpi ;" >> project-config.jam
./b2 -s NO_BZIP2=1 -s NO_ZLIB=1 cxxflags="-std=c++14" --build-type=minimal variant=release install
./b2 cxxflags="-std=c++14" --build-type=minimal variant=release install
rm -rf ${BUILD_DIR}
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