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_APPLICATION_HPP
00033 #define FEAPP_APPLICATION_HPP
00034
00035 #include <vector>
00036
00037 #include "Teuchos_RCP.hpp"
00038 #include "Teuchos_ParameterList.hpp"
00039 #include "Teuchos_SerialDenseMatrix.hpp"
00040 #include "Epetra_Vector.h"
00041 #include "Epetra_CrsMatrix.h"
00042 #include "Epetra_Import.h"
00043 #include "Epetra_Export.h"
00044
00045 #include "FEApp_NodeBC.hpp"
00046 #include "FEApp_AbstractPDE.hpp"
00047 #include "FEApp_AbstractQuadrature.hpp"
00048 #include "FEApp_AbstractDiscretization.hpp"
00049 #include "FEApp_AbstractProblem.hpp"
00050 #include "FEApp_TemplateTypes.hpp"
00051
00052 #include "Sacado_ScalarParameterLibrary.hpp"
00053 #include "Sacado_ScalarParameterVector.hpp"
00054
00055 namespace FEApp {
00056
00057 class Application {
00058 public:
00059
00061 Application(const std::vector<double>& coords,
00062 const Teuchos::RCP<const Epetra_Comm>& comm,
00063 const Teuchos::RCP<Teuchos::ParameterList>& params,
00064 bool is_transient);
00065
00067 ~Application();
00068
00070 Teuchos::RCP<const Epetra_Map> getMap() const;
00071
00073 Teuchos::RCP<const Epetra_CrsGraph> getJacobianGraph() const;
00074
00076 Teuchos::RCP<const Epetra_Vector> getInitialSolution() const;
00077
00079 Teuchos::RCP<Sacado::ScalarParameterLibrary> getParamLib();
00080
00082 bool isTransient() const;
00083
00085
00088 void computeGlobalResidual(const Epetra_Vector* xdot,
00089 const Epetra_Vector& x,
00090 const Sacado::ScalarParameterVector* p,
00091 Epetra_Vector& f);
00092
00094
00097 void computeGlobalJacobian(double alpha, double beta,
00098 const Epetra_Vector* xdot,
00099 const Epetra_Vector& x,
00100 const Sacado::ScalarParameterVector* p,
00101 Epetra_Vector* f,
00102 Epetra_CrsMatrix& jac);
00103
00105
00108 void computeGlobalTangent(double alpha, double beta,
00109 bool sum_derivs,
00110 const Epetra_Vector* xdot,
00111 const Epetra_Vector& x,
00112 Sacado::ScalarParameterVector* p,
00113 const Epetra_MultiVector* Vx,
00114 const Teuchos::SerialDenseMatrix<int,double>* Vp,
00115 Epetra_Vector* f,
00116 Epetra_MultiVector* JVx,
00117 Epetra_MultiVector* fVp);
00118
00119 private:
00120
00122 Application(const Application&);
00123
00125 Application& operator=(const Application&);
00126
00127 protected:
00128
00130 bool transient;
00131
00133 Teuchos::RCP<FEApp::AbstractDiscretization> disc;
00134
00136 std::vector< Teuchos::RCP<FEApp::NodeBC> > bc;
00137
00139 Teuchos::RCP<const FEApp::AbstractQuadrature> quad;
00140
00142 FEApp::AbstractPDE_TemplateManager<ValidTypes> pdeTM;
00143
00145 Teuchos::RCP<Epetra_Vector> initial_x;
00146
00148 Teuchos::RCP<Epetra_Import> importer;
00149
00151 Teuchos::RCP<Epetra_Export> exporter;
00152
00154 Teuchos::RCP<Epetra_Vector> overlapped_x;
00155
00157 Teuchos::RCP<Epetra_Vector> overlapped_xdot;
00158
00160 Teuchos::RCP<Epetra_Vector> overlapped_f;
00161
00163 Teuchos::RCP<Epetra_CrsMatrix> overlapped_jac;
00164
00166 Teuchos::RCP<Sacado::ScalarParameterLibrary> paramLib;
00167
00168 };
00169
00170 }
00171
00172 #endif // FEAPP_APPLICATION_HPP