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

« back to all changes in this revision

Viewing changes to dolfin/la/LinearSolver.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 Ola Skavhaug 2008.
20
20
//
21
21
// First added:  2004-06-19
22
 
// Last changed: 2013-12-04
 
22
// Last changed: 2014-05-27
23
23
 
24
24
#ifndef __LINEAR_SOLVER_H
25
25
#define __LINEAR_SOLVER_H
26
26
 
 
27
#include <memory>
27
28
#include <string>
28
 
#include <boost/scoped_ptr.hpp>
 
29
#include <memory>
29
30
#include <dolfin/common/types.h>
30
31
#include "GenericLinearSolver.h"
31
32
 
52
53
    ~LinearSolver();
53
54
 
54
55
    /// Set the operator (matrix)
55
 
    void set_operator(const boost::shared_ptr<const GenericLinearOperator> A);
 
56
    void set_operator(std::shared_ptr<const GenericLinearOperator> A);
56
57
 
57
58
    /// Set the operator (matrix) and preconitioner matrix
58
 
    void set_operators(const boost::shared_ptr<const GenericLinearOperator> A,
59
 
                       const boost::shared_ptr<const GenericLinearOperator> P);
 
59
    void set_operators(std::shared_ptr<const GenericLinearOperator> A,
 
60
                       std::shared_ptr<const GenericLinearOperator> P);
60
61
 
61
62
    /// Solve linear system Ax = b
62
63
    std::size_t solve(const GenericLinearOperator& A,
72
73
      return p;
73
74
    }
74
75
 
 
76
    /// Update solver parameters (pass parameters down to wrapped implementation)
 
77
    virtual void update_parameters(const Parameters& parameters)
 
78
    {
 
79
      this->parameters.update(parameters);
 
80
      solver->update_parameters(parameters);
 
81
    }
 
82
 
75
83
    // FIXME: This should not be needed. Need to cleanup linear solver
76
84
    // name jungle: default, lu, iterative, direct, krylov, etc
77
85
    /// Return parameter type: "krylov_solver" or "lu_solver"
80
88
      return _parameter_type;
81
89
    }
82
90
 
83
 
    /// Update solver parameters (pass parameters down to wrapped implementation)
84
 
    virtual void update_parameters(const Parameters& parameters)
85
 
    {
86
 
      this->parameters.update(parameters);
87
 
      solver->update_parameters(parameters);
88
 
    }
89
 
 
90
91
  private:
91
92
 
92
93
    // Friends
101
102
            const std::vector<std::pair<std::string, std::string> > methods);
102
103
 
103
104
    // Solver
104
 
    boost::scoped_ptr<GenericLinearSolver> solver;
 
105
    std::unique_ptr<GenericLinearSolver> solver;
105
106
 
106
107
    // FIXME: This should not be needed
107
108
    // Parameter type