LibMesh::LinearSolver<T> & PetscLinearSolver<T> 类接口
2015-02-25 05:23
134 查看
This class provides a uniform interface for linear solvers, this base class is overloaded to provide linear solvers from different packages like PETSc / LASPACK
LinearSolver类继承关系:
共有成员函数:
LinearSovler(const libMesh::Communicator)
virtual ~LinearSolver()
clear(),
init(),
solver_type()
set_solver_type(),
Preconditioner_type(),
set_preconditioner_type(),
attach_preconditioner(),
1 {
2
if(this->_is_initialized)
3 libmesh_error_msg("Preconditioner must be attached before the s
olver is initialized");
4
5
_preconditioner_type = SHELL_PRECOND;
6
_preconditioner = preconditioner //function input;
7 }
virtual solver() 重载方法,一般给矩阵a,rhs列向量,求解列向量,pc矩阵可以给也可以有矩阵a计算。
static AutoPtr<LinearSolver<T> > build(), build a LinearSolver using linear solver package specified by solver_package
9 {
10 switch (solver_package)
11 {
12 #ifdef LIBMESH_HAVE_LASPACK
13
case LASPACK_SOLVERS:
14 {
15 AutoPtr<LinearSolver<T> > ap(new LaspackLinearSolver<T>(comm) );
16
return ap;
17 }
18 #endif
19
20 #ifdef LIBMESH_HAVE_PETSC
21
case PETSC_SOLVERS:
22 {
23 AutoPtr<LinearSolver<T> > ap(new PetscLinearSolver<T>(comm) );
24
return ap;
25 }
26 #endif
27
28 #ifdef LIBMESH_HAVE_TRILINOS
29
case TRILINOS_SOLVERS:
30 {
31 AutoPtr<LinearSolver<T> > ap(new AztecLinearSolver<T>(comm) );
32
return ap;
33 }
34 #endif
35
36 #ifdef LIBMESH_HAVE_EIGEN
37
case EIGEN_SOLVERS:
38 {
39 AutoPtr<LinearSolver<T> > ap(new EigenSparseLinearSolver<T>(comm) );
40
return ap;
41 }
42 #endif
43
default:
44 libmesh_error_msg("ERROR:Unrecognized solver package:" << solver_package);
45 }
46 AutoPtr<LinearSolver<T> > ap(NULL);
47 return ap;
48 }
PetscLinearSolver 重载 除构造/析构函数以外的 linear solver方法, 另外还有方法:
pc(),
ksp(), return PETSc ksp context pointer
get_residual_history()
get_initial_residual()
set_preconditioner_type(),
LinearSolver类继承关系:
共有成员函数:
LinearSovler(const libMesh::Communicator)
virtual ~LinearSolver()
clear(),
init(),
solver_type()
set_solver_type(),
Preconditioner_type(),
set_preconditioner_type(),
attach_preconditioner(),
1 {
2
if(this->_is_initialized)
3 libmesh_error_msg("Preconditioner must be attached before the s
olver is initialized");
4
5
_preconditioner_type = SHELL_PRECOND;
6
_preconditioner = preconditioner //function input;
7 }
virtual solver() 重载方法,一般给矩阵a,rhs列向量,求解列向量,pc矩阵可以给也可以有矩阵a计算。
static AutoPtr<LinearSolver<T> > build(), build a LinearSolver using linear solver package specified by solver_package
9 {
10 switch (solver_package)
11 {
12 #ifdef LIBMESH_HAVE_LASPACK
13
case LASPACK_SOLVERS:
14 {
15 AutoPtr<LinearSolver<T> > ap(new LaspackLinearSolver<T>(comm) );
16
return ap;
17 }
18 #endif
19
20 #ifdef LIBMESH_HAVE_PETSC
21
case PETSC_SOLVERS:
22 {
23 AutoPtr<LinearSolver<T> > ap(new PetscLinearSolver<T>(comm) );
24
return ap;
25 }
26 #endif
27
28 #ifdef LIBMESH_HAVE_TRILINOS
29
case TRILINOS_SOLVERS:
30 {
31 AutoPtr<LinearSolver<T> > ap(new AztecLinearSolver<T>(comm) );
32
return ap;
33 }
34 #endif
35
36 #ifdef LIBMESH_HAVE_EIGEN
37
case EIGEN_SOLVERS:
38 {
39 AutoPtr<LinearSolver<T> > ap(new EigenSparseLinearSolver<T>(comm) );
40
return ap;
41 }
42 #endif
43
default:
44 libmesh_error_msg("ERROR:Unrecognized solver package:" << solver_package);
45 }
46 AutoPtr<LinearSolver<T> > ap(NULL);
47 return ap;
48 }
PetscLinearSolver 重载 除构造/析构函数以外的 linear solver方法, 另外还有方法:
pc(),
ksp(), return PETSc ksp context pointer
get_residual_history()
get_initial_residual()
set_preconditioner_type(),
相关文章推荐
- IEnumerable和IEnumerable<T>接口
- “warning C4251::CStringT<BaseType,StringTraits>需要有 dll 接口”解决办法
- 接口 Map<K,V>
- C#编程:泛型中接口IEnumerable<T>中GetEnmerator方法的讨论
- Java基础<七>--->抽象类、接口、内部类、异常等
- 接口与多重继承<转>
- Comparable<T>接口实现
- System.Collections.Generic.IEnumerable<T>接口
- IEnumerable和IEnumerable<T>接口
- 如何实现IEnumerable<T>和IEnumerator接口,一个ASP.NET MVC日志模型的实现
- 黑马程序员 Java基础<三>---> 抽象类、与接口
- 接口 Map.Entry<K,V>
- 用泛型的IEqualityComparer<T>接口去重复项
- 写一个MyList<T>的类,内部用T[]实现(不能使用系统的List<T>类),需要实现的接口如下:
- 常用AWT监听器接口,事件和事件源(摘自Java 2 核心技术<卷一:基础知识>(第七版)》)
- IComparable<T>:泛型接口
- 如何判断请求的接口数据为null或(null)<null>
- Java学习学习之路0801<复习>(抽象类、日期Date、接口)
- Java接口中的变量和方法默认的类型<转>
- IComparable<T>, IComparer<T>,IEnumerable<T>泛型接口