Ignore:
Timestamp:
Nov 22, 2011, 9:22:10 PM (14 years ago)
Author:
Julian Iseringhausen <isering@…>
Children:
facba0
Parents:
66f24d
Message:

Major vmg update.

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/solver/solver.hpp

    r66f24d rdfed1c  
    1010#ifndef SOLVER_HPP_
    1111#define SOLVER_HPP_
     12
     13#include <vector>
    1214
    1315#include "base/discretization.hpp"
     
    3335  Solver()
    3436  {
    35     max_size = 0;
    36     vec_size = 0;
    37     b = NULL;
    38     x = NULL;
    39     A = NULL;
     37    size = 0;
    4038  }
    4139
    4240  virtual ~Solver()
    4341  {
    44     delete [] b;
    45     delete [] x;
    46     for (int i=0; i<max_size; i++)
    47       delete [] A[i];
    48     delete [] A;
    4942  }
    5043
    51   void Run(Grid& sol, Grid& rhs)
    52   {
    53 #ifdef DEBUG
    54     sol.IsConsistent();
    55     rhs.IsConsistent();
    56     sol.IsCompatible(rhs);
    57 #endif
    58 
    59     Grid *rhsGlobal = MG::GetComm()->CommMergeGrids(rhs);
    60 
    61     this->Realloc(*rhsGlobal);
    62     this->AssembleMatrix(*rhsGlobal);
    63     this->Compute();
    64     this->ExportSol(sol, rhs);
    65   }
     44  void Run(Grid& sol, Grid& rhs);
    6645
    6746private:
     
    7150  virtual void ExportSol(Grid& sol, Grid& rhs) = 0; ///< Exports the solution back to a given mesh.
    7251
    73   vmg_float **A, *b, *x;
    74   int max_size, vec_size;
     52  std::vector<vmg_float> A, b, x;
     53  int size;
    7554
    7655protected:
     
    8059  vmg_float& Mat(int i, int j)
    8160  {
    82     return A[i][j];
     61    return A[j+size*i];
    8362  }
    8463
     
    9372  }
    9473
    95   const int& Size() const {return vec_size;}
    96   const int& MemSize()  const {return max_size;}
     74  const int& Size() const {return size;}
    9775};
    9876
Note: See TracChangeset for help on using the changeset viewer.