source: src/solver/solver.cpp@ 48b662

Last change on this file since 48b662 was 48b662, checked in by Olaf Lenz <olenz@…>, 14 years ago

Moved files in scafacos_fcs one level up.

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

  • Property mode set to 100644
File size: 742 bytes
Line 
1/**
2 * @file solver.cpp
3 * @author Julian Iseringhausen <isering@ins.uni-bonn.de>
4 * @date Mon Apr 18 13:10:55 2011
5 *
6 * @brief VMG::Solver
7 *
8 */
9
10#ifdef HAVE_CONFIG_H
11#include <config.h>
12#endif
13
14#include "solver/solver.hpp"
15
16using namespace VMG;
17
18void Solver::Realloc(int n)
19{
20 //Reallocate memory if necessary
21 this->vec_size = n;
22
23 if (n > this->max_size) {
24
25 delete [] b;
26 delete [] x;
27 for (int i=0; i<this->max_size; i++)
28 delete [] A[i];
29 delete [] A;
30
31 b = new vmg_float[n];
32 x = new vmg_float[n];
33 A = new vmg_float*[n];
34 for (int i=0; i<n; i++)
35 A[i] = new vmg_float[n];
36
37 this->max_size = n;
38
39 }
40}
41
42void Solver::Realloc(Grid& sol)
43{
44 this->Realloc(sol.Global().Size().Product());
45}
Note: See TracBrowser for help on using the repository browser.