00001
00002
00003
00004
00005
00006
00007 #if !defined(LCM_LocalNonlinearSolver_hpp)
00008 #define LCM_LocalNonlinearSolver_hpp
00009
00010 #include "PHAL_AlbanyTraits.hpp"
00011 #include <Teuchos_LAPACK.hpp>
00012 #include <Sacado.hpp>
00013
00014 namespace LCM
00015 {
00016
00020 template<typename EvalT, typename Traits>
00021 class LocalNonlinearSolver_Base
00022 {
00023 public:
00024 typedef typename EvalT::ScalarT ScalarT;
00025 LocalNonlinearSolver_Base();
00026 ~LocalNonlinearSolver_Base()
00027 {
00028 }
00029 ;
00030 Teuchos::LAPACK<int, RealType> lapack;
00031 void solve(std::vector<ScalarT> & A,
00032 std::vector<ScalarT> & X,
00033 std::vector<ScalarT> & B);
00034 void computeFadInfo(std::vector<ScalarT> & A,
00035 std::vector<ScalarT> & X,
00036 std::vector<ScalarT> & B);
00037 };
00038
00039
00040
00041
00042
00043 template<typename EvalT, typename Traits> class LocalNonlinearSolver;
00044
00045
00046
00047
00048 template<typename Traits>
00049 class LocalNonlinearSolver<PHAL::AlbanyTraits::Residual, Traits> :
00050 public LocalNonlinearSolver_Base<PHAL::AlbanyTraits::Residual, Traits>
00051 {
00052 public:
00053 typedef typename PHAL::AlbanyTraits::Residual::ScalarT ScalarT;
00054 LocalNonlinearSolver();
00055 void solve(std::vector<ScalarT> & A,
00056 std::vector<ScalarT> & X,
00057 std::vector<ScalarT> & B);
00058 void computeFadInfo(std::vector<ScalarT> & A,
00059 std::vector<ScalarT> & X,
00060 std::vector<ScalarT> & B);
00061 };
00062
00063
00064
00065
00066 template<typename Traits>
00067 class LocalNonlinearSolver<PHAL::AlbanyTraits::Jacobian, Traits> :
00068 public LocalNonlinearSolver_Base<PHAL::AlbanyTraits::Jacobian, Traits>
00069 {
00070 public:
00071 typedef typename PHAL::AlbanyTraits::Jacobian::ScalarT ScalarT;
00072 LocalNonlinearSolver();
00073 void solve(std::vector<ScalarT> & A,
00074 std::vector<ScalarT> & X,
00075 std::vector<ScalarT> & B);
00076 void computeFadInfo(std::vector<ScalarT> & A,
00077 std::vector<ScalarT> & X,
00078 std::vector<ScalarT> & B);
00079 };
00080
00081
00082
00083
00084 template<typename Traits>
00085 class LocalNonlinearSolver<PHAL::AlbanyTraits::Tangent, Traits> :
00086 public LocalNonlinearSolver_Base<PHAL::AlbanyTraits::Tangent, Traits>
00087 {
00088 public:
00089 typedef typename PHAL::AlbanyTraits::Tangent::ScalarT ScalarT;
00090 LocalNonlinearSolver();
00091 void solve(std::vector<ScalarT> & A,
00092 std::vector<ScalarT> & X,
00093 std::vector<ScalarT> & B);
00094 void computeFadInfo(std::vector<ScalarT> & A,
00095 std::vector<ScalarT> & X,
00096 std::vector<ScalarT> & B);
00097 };
00098
00099
00100
00101
00102 #ifdef ALBANY_SG_MP
00103 template<typename Traits>
00104 class LocalNonlinearSolver< PHAL::AlbanyTraits::SGResidual, Traits> :
00105 public LocalNonlinearSolver_Base< PHAL::AlbanyTraits::SGResidual, Traits>
00106 {
00107 public:
00108 typedef typename PHAL::AlbanyTraits::SGResidual::ScalarT ScalarT;
00109 LocalNonlinearSolver();
00110 void solve(std::vector<ScalarT> & A,
00111 std::vector<ScalarT> & X,
00112 std::vector<ScalarT> & B);
00113 void computeFadInfo(std::vector<ScalarT> & A,
00114 std::vector<ScalarT> & X,
00115 std::vector<ScalarT> & B);
00116 };
00117
00118
00119
00120
00121 template<typename Traits>
00122 class LocalNonlinearSolver< PHAL::AlbanyTraits::SGJacobian, Traits> :
00123 public LocalNonlinearSolver_Base< PHAL::AlbanyTraits::SGJacobian, Traits>
00124 {
00125 public:
00126 typedef typename PHAL::AlbanyTraits::SGJacobian::ScalarT ScalarT;
00127 LocalNonlinearSolver();
00128 void solve(std::vector<ScalarT> & A,
00129 std::vector<ScalarT> & X,
00130 std::vector<ScalarT> & B);
00131 void computeFadInfo(std::vector<ScalarT> & A,
00132 std::vector<ScalarT> & X,
00133 std::vector<ScalarT> & B);
00134 };
00135
00136
00137
00138
00139 template<typename Traits>
00140 class LocalNonlinearSolver< PHAL::AlbanyTraits::SGTangent, Traits> :
00141 public LocalNonlinearSolver_Base< PHAL::AlbanyTraits::SGTangent, Traits>
00142 {
00143 public:
00144 typedef typename PHAL::AlbanyTraits::SGTangent::ScalarT ScalarT;
00145 LocalNonlinearSolver();
00146 void solve(std::vector<ScalarT> & A,
00147 std::vector<ScalarT> & X,
00148 std::vector<ScalarT> & B);
00149 void computeFadInfo(std::vector<ScalarT> & A,
00150 std::vector<ScalarT> & X,
00151 std::vector<ScalarT> & B);
00152 };
00153
00154
00155
00156
00157 template<typename Traits>
00158 class LocalNonlinearSolver< PHAL::AlbanyTraits::MPResidual, Traits> :
00159 public LocalNonlinearSolver_Base< PHAL::AlbanyTraits::MPResidual, Traits>
00160 {
00161 public:
00162 typedef typename PHAL::AlbanyTraits::MPResidual::ScalarT ScalarT;
00163 LocalNonlinearSolver();
00164 void solve(std::vector<ScalarT> & A,
00165 std::vector<ScalarT> & X,
00166 std::vector<ScalarT> & B);
00167 void computeFadInfo(std::vector<ScalarT> & A,
00168 std::vector<ScalarT> & X,
00169 std::vector<ScalarT> & B);
00170 };
00171
00172
00173
00174
00175 template <typename Traits>
00176 class LocalNonlinearSolver< PHAL::AlbanyTraits::MPJacobian, Traits> :
00177 public LocalNonlinearSolver_Base< PHAL::AlbanyTraits::MPJacobian, Traits>
00178 {
00179 public:
00180 typedef typename PHAL::AlbanyTraits::MPJacobian::ScalarT ScalarT;
00181 LocalNonlinearSolver();
00182 void solve(std::vector<ScalarT> & A,
00183 std::vector<ScalarT> & X,
00184 std::vector<ScalarT> & B);
00185 void computeFadInfo(std::vector<ScalarT> & A,
00186 std::vector<ScalarT> & X,
00187 std::vector<ScalarT> & B);
00188 };
00189
00190
00191
00192
00193 template<typename Traits>
00194 class LocalNonlinearSolver< PHAL::AlbanyTraits::MPTangent, Traits> :
00195 public LocalNonlinearSolver_Base< PHAL::AlbanyTraits::MPTangent, Traits>
00196 {
00197 public:
00198 typedef typename PHAL::AlbanyTraits::MPTangent::ScalarT ScalarT;
00199 LocalNonlinearSolver();
00200 void solve(std::vector<ScalarT> & A,
00201 std::vector<ScalarT> & X,
00202 std::vector<ScalarT> & B);
00203 void computeFadInfo(std::vector<ScalarT> & A,
00204 std::vector<ScalarT> & X,
00205 std::vector<ScalarT> & B);
00206 };
00207 #endif //ALBANY_SG_MP
00208 }
00209
00210 #include "LocalNonlinearSolver_Def.hpp"
00211
00212 #endif //LCM_LocalNonlienarSolver.h