Ignore:
Timestamp:
Apr 10, 2012, 1:55:49 PM (14 years ago)
Author:
Julian Iseringhausen <isering@…>
Children:
a40eea
Parents:
d24c2f
Message:

Merge recent changes of the vmg library into ScaFaCos.

Includes a fix for the communication problems on Jugene.

git-svn-id: https://svn.version.fz-juelich.de/scafacos/trunk@1666 5161e1c8-67bf-11de-9fd5-51895aff932f

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/solver/solver_singular.cpp

    rd24c2f rac6d04  
    4242
    4343  // Make sure that arrays are big enough to hold expanded system of equations
    44   this->Realloc(rhs.Global().SizeGlobal().Product() + 1);
     44  this->Realloc(rhs.Global().GlobalSize().Product() + 1);
    4545
    4646  for (grid_iter = rhs.Iterators().Local().Begin(); grid_iter != rhs.Iterators().Local().End(); ++grid_iter) {
    4747
    4848    // Compute 1-dimensional index from 3-dimensional grid
    49     index = rhs.GlobalLinearIndex(*grid_iter - rhs.Local().Begin() + rhs.Global().BeginLocal());
     49    index = rhs.GlobalLinearIndex(*grid_iter - rhs.Local().Begin() + rhs.Global().LocalBegin());
    5050
    5151    // Check if we computed the index correctly
     
    6464    for (stencil_iter = A.begin(); stencil_iter != A.end(); ++stencil_iter) {
    6565
    66       i = *grid_iter - rhs.Local().Begin() + rhs.Global().BeginLocal() + stencil_iter->Disp();
     66      i = *grid_iter - rhs.Local().Begin() + rhs.Global().LocalBegin() + stencil_iter->Disp();
    6767
    6868      for (int j=0; j<3; ++j)
    6969        if (comm->BoundaryConditions()[j] == Periodic) {
    7070          if (i[j] < 0)
    71             i[j] += rhs.Global().SizeGlobal()[j];
    72           else if (i[j] >= rhs.Global().SizeGlobal()[j])
    73             i[j] -= rhs.Global().SizeGlobal()[j];
     71            i[j] += rhs.Global().GlobalSize()[j];
     72          else if (i[j] >= rhs.Global().GlobalSize()[j])
     73            i[j] -= rhs.Global().GlobalSize()[j];
    7474        }
    7575
     
    8787    row_sum += iter->Val();
    8888
    89   if (fabs(row_sum) <= std::numeric_limits<vmg_float>::epsilon()) {
     89  if (std::abs(row_sum) <= (A.size()+1) * std::numeric_limits<vmg_float>::epsilon()) {
    9090
    9191    // Expand equation system in order to make the system regular.
     
    108108{
    109109  int index;
     110  const vmg_float correction = this->Sol(this->Size()-1);
    110111
    111112  for (int i=0; i<sol.Local().Size().X(); i++)
     
    114115
    115116        // Compute global 1-dimensional index
    116         index = sol.GlobalLinearIndex(sol.Global().BeginLocal().X()+i,
    117                                       sol.Global().BeginLocal().Y()+j,
    118                                       sol.Global().BeginLocal().Z()+k);
     117        index = sol.GlobalLinearIndex(sol.Global().LocalBegin().X()+i,
     118                                      sol.Global().LocalBegin().Y()+j,
     119                                      sol.Global().LocalBegin().Z()+k);
    119120
    120121        // Set solution
    121         sol(sol.Local().Begin().X()+i, sol.Local().Begin().Y()+j, sol.Local().Begin().Z()+k) = this->Sol(index);
     122        sol(sol.Local().Begin().X()+i, sol.Local().Begin().Y()+j, sol.Local().Begin().Z()+k) = this->Sol(index) - correction;
    122123
    123124      }
Note: See TracChangeset for help on using the changeset viewer.