00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032 #ifndef FEAPP_INITPOSTOPS_HPP
00033 #define FEAPP_INITPOSTOPS_HPP
00034
00035 #include "Teuchos_RCP.hpp"
00036 #include "Teuchos_SerialDenseMatrix.hpp"
00037 #include "Epetra_Vector.h"
00038 #include "Epetra_CrsMatrix.h"
00039
00040 #include "FEApp_AbstractInitPostOp.hpp"
00041
00042 #include "Sacado_Fad_DFad.hpp"
00043 #include "Sacado_ScalarParameterVector.hpp"
00044
00045 namespace FEApp {
00046
00048 class ResidualOp : public FEApp::AbstractInitPostOp<double> {
00049 public:
00050
00052
00055 ResidualOp(
00056 const Teuchos::RCP<const Epetra_Vector>& overlapped_xdot,
00057 const Teuchos::RCP<const Epetra_Vector>& overlapped_x,
00058 const Teuchos::RCP<Epetra_Vector>& overlapped_f);
00059
00061 virtual ~ResidualOp();
00062
00064 virtual void elementInit(const FEApp::AbstractElement& e,
00065 unsigned int neqn,
00066 std::vector<double>* elem_xdot,
00067 std::vector<double>& elem_x);
00068
00070 virtual void elementPost(const FEApp::AbstractElement& e,
00071 unsigned int neqn,
00072 std::vector<double>& elem_f);
00073
00075 virtual void nodeInit(const FEApp::NodeBC& bc,
00076 unsigned int neqn,
00077 std::vector<double>* node_xdot,
00078 std::vector<double>& node_x);
00079
00081 virtual void nodePost(const FEApp::NodeBC& bc,
00082 unsigned int neqn,
00083 std::vector<double>& node_f);
00084
00085 private:
00086
00088 ResidualOp(const ResidualOp&);
00089
00091 ResidualOp& operator=(const ResidualOp&);
00092
00093 protected:
00094
00096 Teuchos::RCP<const Epetra_Vector> xdot;
00097
00099 Teuchos::RCP<const Epetra_Vector> x;
00100
00102 Teuchos::RCP<Epetra_Vector> f;
00103
00104 };
00105
00107 class JacobianOp :
00108 public FEApp::AbstractInitPostOp< Sacado::Fad::DFad<double> > {
00109 public:
00110
00112
00115 JacobianOp(
00116 double alpha, double beta,
00117 const Teuchos::RCP<const Epetra_Vector>& overlapped_xdot,
00118 const Teuchos::RCP<const Epetra_Vector>& overlapped_x,
00119 const Teuchos::RCP<Epetra_Vector>& overlapped_f,
00120 const Teuchos::RCP<Epetra_CrsMatrix>& overlapped_jac);
00121
00123 virtual ~JacobianOp();
00124
00126 virtual void elementInit(
00127 const FEApp::AbstractElement& e,
00128 unsigned int neqn,
00129 std::vector< Sacado::Fad::DFad<double> >* elem_xdot,
00130 std::vector< Sacado::Fad::DFad<double> >& elem_x);
00131
00133 virtual void elementPost(const FEApp::AbstractElement& e,
00134 unsigned int neqn,
00135 std::vector< Sacado::Fad::DFad<double> >& elem_f);
00136
00138 virtual void nodeInit(const FEApp::NodeBC& bc,
00139 unsigned int neqn,
00140 std::vector< Sacado::Fad::DFad<double> >* node_xdot,
00141 std::vector< Sacado::Fad::DFad<double> >& node_x);
00142
00144 virtual void nodePost(const FEApp::NodeBC& bc,
00145 unsigned int neqn,
00146 std::vector< Sacado::Fad::DFad<double> >& node_f);
00147
00148 private:
00149
00151 JacobianOp(const JacobianOp&);
00152
00154 JacobianOp& operator=(const JacobianOp&);
00155
00156 protected:
00157
00159 double m_coeff;
00160
00162 double j_coeff;
00163
00165 Teuchos::RCP<const Epetra_Vector> xdot;
00166
00168 Teuchos::RCP<const Epetra_Vector> x;
00169
00171 Teuchos::RCP<Epetra_Vector> f;
00172
00174 Teuchos::RCP<Epetra_CrsMatrix> jac;
00175
00176 };
00177
00182 class TangentOp :
00183 public FEApp::AbstractInitPostOp< Sacado::Fad::DFad<double> > {
00184 public:
00185
00187
00190 TangentOp(
00191 double alpha, double beta, bool sum_derivs,
00192 const Teuchos::RCP<const Epetra_Vector>& overlapped_xdot,
00193 const Teuchos::RCP<const Epetra_Vector>& overlapped_x,
00194 const Teuchos::RCP<Sacado::ScalarParameterVector>& p,
00195 const Teuchos::RCP<const Epetra_MultiVector>& overlapped_Vx,
00196 const Teuchos::RCP<const Epetra_MultiVector>& overlapped_Vxdot,
00197 const Teuchos::RCP<const Teuchos::SerialDenseMatrix<int,double> >& Vp,
00198 const Teuchos::RCP<Epetra_Vector>& overlapped_f,
00199 const Teuchos::RCP<Epetra_MultiVector>& overlapped_JV,
00200 const Teuchos::RCP<Epetra_MultiVector>& overlapped_fp);
00201
00203 virtual ~TangentOp();
00204
00206 virtual void elementInit(
00207 const FEApp::AbstractElement& e,
00208 unsigned int neqn,
00209 std::vector< Sacado::Fad::DFad<double> >* elem_xdot,
00210 std::vector< Sacado::Fad::DFad<double> >& elem_x);
00211
00213 virtual void elementPost(const FEApp::AbstractElement& e,
00214 unsigned int neqn,
00215 std::vector< Sacado::Fad::DFad<double> >& elem_f);
00216
00218 virtual void nodeInit(const FEApp::NodeBC& bc,
00219 unsigned int neqn,
00220 std::vector< Sacado::Fad::DFad<double> >* node_xdot,
00221 std::vector< Sacado::Fad::DFad<double> >& node_x);
00222
00224 virtual void nodePost(const FEApp::NodeBC& bc,
00225 unsigned int neqn,
00226 std::vector< Sacado::Fad::DFad<double> >& node_f);
00227
00228 private:
00229
00231 TangentOp(const TangentOp&);
00232
00234 TangentOp& operator=(const TangentOp&);
00235
00236 protected:
00237
00239 double m_coeff;
00240
00242 double j_coeff;
00243
00245 bool sum_derivs;
00246
00248 Teuchos::RCP<const Epetra_Vector> xdot;
00249
00251 Teuchos::RCP<const Epetra_Vector> x;
00252
00254 Teuchos::RCP<Sacado::ScalarParameterVector> params;
00255
00257 Teuchos::RCP<const Epetra_MultiVector> Vx;
00258
00260 Teuchos::RCP<const Epetra_MultiVector> Vxdot;
00261
00263 Teuchos::RCP<const Teuchos::SerialDenseMatrix<int,double> > Vp;
00264
00266 Teuchos::RCP<Epetra_Vector> f;
00267
00269 Teuchos::RCP<Epetra_MultiVector> JV;
00270
00272 Teuchos::RCP<Epetra_MultiVector> fp;
00273
00275 int num_cols_x;
00276
00278 int num_cols_p;
00279
00281 int num_cols_tot;
00282
00284 int param_offset;
00285
00286 };
00287
00288 }
00289
00290 #endif // FEAPP_INITPOSTOPS_HPP