~ubuntu-branches/ubuntu/wily/dolfin/wily-proposed

« back to all changes in this revision

Viewing changes to dolfin/la/KrylovSolver.h

  • Committer: Package Import Robot
  • Author(s): Johannes Ring
  • Date: 2014-09-22 14:35:34 UTC
  • mfrom: (1.1.17) (19.1.23 sid)
  • Revision ID: package-import@ubuntu.com-20140922143534-0yi89jyuqbgdxwm9
Tags: 1.4.0+dfsg-4
* debian/control: Disable libcgal-dev on i386, mipsel and sparc.
* debian/rules: Remove bad directives in pkg-config file dolfin.pc
  (closes: #760658).
* Remove debian/libdolfin-dev.lintian-overrides.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
// Modified by Anders Logg, 2008.
20
20
//
21
21
// First added:  2007-07-03
22
 
// Last changed: 2013-11-25
 
22
// Last changed: 2014-05-27
23
23
 
24
24
#ifndef __KRYLOV_SOLVER_H
25
25
#define __KRYLOV_SOLVER_H
26
26
 
27
27
#include <string>
28
28
#include <vector>
29
 
#include <boost/shared_ptr.hpp>
30
 
#include <boost/scoped_ptr.hpp>
 
29
#include <memory>
31
30
#include "GenericLinearSolver.h"
32
31
 
33
32
namespace dolfin
50
49
                 std::string preconditioner="default");
51
50
 
52
51
    /// Constructor
53
 
    KrylovSolver(boost::shared_ptr<const GenericLinearOperator> A,
 
52
    KrylovSolver(std::shared_ptr<const GenericLinearOperator> A,
54
53
                 std::string method="default",
55
54
                 std::string preconditioner="default");
56
55
 
58
57
    ~KrylovSolver();
59
58
 
60
59
    /// Set operator (matrix)
61
 
    void set_operator(const boost::shared_ptr<const GenericLinearOperator> A);
 
60
    void set_operator(std::shared_ptr<const GenericLinearOperator> A);
62
61
 
63
62
    /// Set operator (matrix) and preconditioner matrix
64
 
    void set_operators(const boost::shared_ptr<const GenericLinearOperator> A,
65
 
                       const boost::shared_ptr<const GenericLinearOperator> P);
 
63
    void set_operators(std::shared_ptr<const GenericLinearOperator> A,
 
64
                       std::shared_ptr<const GenericLinearOperator> P);
66
65
 
67
66
    /// Set null space of the operator (matrix). This is used to solve
68
67
    /// singular systems
85
84
      solver->parameters.update(parameters);
86
85
    }
87
86
 
 
87
    // FIXME: This should not be needed. Need to cleanup linear solver
 
88
    // name jungle: default, lu, iterative, direct, krylov, etc
 
89
    /// Return parameter type: "krylov_solver" or "lu_solver"
 
90
    std::string parameter_type() const
 
91
    {
 
92
      return "krylov_solver";
 
93
    }
 
94
 
88
95
  private:
89
96
 
90
97
    // Initialize solver
91
98
    void init(std::string method, std::string preconditioner);
92
99
 
93
100
    // Solver
94
 
    boost::shared_ptr<GenericLinearSolver> solver;
 
101
    std::shared_ptr<GenericLinearSolver> solver;
95
102
 
96
103
  };
97
104
}