24 #ifndef DIRECT_LINEAR_SOLVER_H_
25 #define DIRECT_LINEAR_SOLVER_H_
27 #include <lac/vector.h>
28 #include <lac/block_sparsity_pattern.h>
29 #include <lac/block_sparse_matrix.h>
30 #include <lac/compressed_simple_sparsity_pattern.h>
31 #include <lac/solver_cg.h>
32 #include <lac/precondition.h>
33 #include <lac/full_matrix.h>
34 #include <lac/sparse_direct.h>
36 #include <dofs/dof_tools.h>
38 #include <numerics/vector_tools.h>
59 template <
typename SPARSITYPATTERN,
typename MATRIX,
typename VECTOR>
72 template<
typename PROBLEM>
93 template<
typename PROBLEM,
typename INTEGRATOR>
94 void Solve(PROBLEM& pde, INTEGRATOR& integr, VECTOR &rhs, VECTOR &solution,
bool force_matrix_build=
false);
99 SPARSITYPATTERN sparsity_pattern_;
102 dealii::SparseDirectUMFPACK* A_direct_;
108 template <
typename SPARSITYPATTERN,
typename MATRIX,
typename VECTOR>
115 template <
typename SPARSITYPATTERN,
typename MATRIX,
typename VECTOR>
124 template <
typename SPARSITYPATTERN,
typename MATRIX,
typename VECTOR>
127 if(A_direct_ != NULL)
135 template <
typename SPARSITYPATTERN,
typename MATRIX,
typename VECTOR>
136 template<
typename PROBLEM>
140 pde.ComputeSparsityPattern(sparsity_pattern_);
141 matrix_.reinit(sparsity_pattern_);
143 if(A_direct_ != NULL)
152 template <
typename SPARSITYPATTERN,
typename MATRIX,
typename VECTOR>
153 template<
typename PROBLEM,
typename INTEGRATOR>
158 bool force_matrix_build)
160 if(force_matrix_build)
162 integr.ComputeMatrix (pde,matrix_);
165 integr.ApplyNewtonBoundaryValues(pde,matrix_,rhs,solution);
167 if(A_direct_ == NULL)
169 A_direct_ =
new dealii::SparseDirectUMFPACK;
170 A_direct_->initialize(matrix_);
172 else if(force_matrix_build)
174 A_direct_->factorize(matrix_);
177 dealii::Vector<double> sol;
179 A_direct_->solve(sol);
182 pde.GetDoFConstraints().distribute(solution);
Definition: parameterreader.h:36
~DirectLinearSolverWithMatrix()
Definition: directlinearsolver.h:125
static void declare_params(ParameterReader ¶m_reader)
Definition: directlinearsolver.h:109
void ReInit(PROBLEM &pde)
Definition: directlinearsolver.h:137
DirectLinearSolverWithMatrix(ParameterReader ¶m_reader)
Definition: directlinearsolver.h:116
void Solve(PROBLEM &pde, INTEGRATOR &integr, VECTOR &rhs, VECTOR &solution, bool force_matrix_build=false)
Definition: directlinearsolver.h:154
Definition: directlinearsolver.h:60