00001
00002
00003
00004
00005
00006
00007 #ifndef ALBANY_SOLUTIONAVERAGERESPONSEFUNCTION_HPP
00008 #define ALBANY_SOLUTIONAVERAGERESPONSEFUNCTION_HPP
00009
00010 #include "Albany_ScalarResponseFunction.hpp"
00011
00012 namespace Albany {
00013
00017 class SolutionAverageResponseFunction :
00018 public ScalarResponseFunction {
00019 public:
00020
00022 SolutionAverageResponseFunction(
00023 const Teuchos::RCP<const Epetra_Comm>& comm);
00024
00026 virtual ~SolutionAverageResponseFunction();
00027
00029 virtual unsigned int numResponses() const;
00030
00032 virtual void
00033 evaluateResponse(const double current_time,
00034 const Epetra_Vector* xdot,
00035 const Epetra_Vector* xdotdot,
00036 const Epetra_Vector& x,
00037 const Teuchos::Array<ParamVec>& p,
00038 Epetra_Vector& g);
00039
00041 virtual void
00042 evaluateTangent(const double alpha,
00043 const double beta,
00044 const double omega,
00045 const double current_time,
00046 bool sum_derivs,
00047 const Epetra_Vector* xdot,
00048 const Epetra_Vector* xdotdot,
00049 const Epetra_Vector& x,
00050 const Teuchos::Array<ParamVec>& p,
00051 ParamVec* deriv_p,
00052 const Epetra_MultiVector* Vxdot,
00053 const Epetra_MultiVector* Vxdotdot,
00054 const Epetra_MultiVector* Vx,
00055 const Epetra_MultiVector* Vp,
00056 Epetra_Vector* g,
00057 Epetra_MultiVector* gx,
00058 Epetra_MultiVector* gp);
00059
00061 virtual void
00062 evaluateGradient(const double current_time,
00063 const Epetra_Vector* xdot,
00064 const Epetra_Vector* xdotdot,
00065 const Epetra_Vector& x,
00066 const Teuchos::Array<ParamVec>& p,
00067 ParamVec* deriv_p,
00068 Epetra_Vector* g,
00069 Epetra_MultiVector* dg_dx,
00070 Epetra_MultiVector* dg_dxdot,
00071 Epetra_MultiVector* dg_dxdotdot,
00072 Epetra_MultiVector* dg_dp);
00073
00075
00076 #ifdef ALBANY_SG_MP
00077
00078 virtual void init_sg(
00079 const Teuchos::RCP<const Stokhos::OrthogPolyBasis<int,double> >& basis,
00080 const Teuchos::RCP<const Stokhos::Quadrature<int,double> >& quad,
00081 const Teuchos::RCP<Stokhos::OrthogPolyExpansion<int,double> >& expansion,
00082 const Teuchos::RCP<const EpetraExt::MultiComm>& multiComm) {}
00083
00085 virtual void evaluateSGResponse(
00086 const double curr_time,
00087 const Stokhos::EpetraVectorOrthogPoly* sg_xdot,
00088 const Stokhos::EpetraVectorOrthogPoly* sg_xdotdot,
00089 const Stokhos::EpetraVectorOrthogPoly& sg_x,
00090 const Teuchos::Array<ParamVec>& p,
00091 const Teuchos::Array<int>& sg_p_index,
00092 const Teuchos::Array< Teuchos::Array<SGType> >& sg_p_vals,
00093 Stokhos::EpetraVectorOrthogPoly& sg_g);
00094
00096 virtual void evaluateSGTangent(
00097 const double alpha,
00098 const double beta,
00099 const double omega,
00100 const double current_time,
00101 bool sum_derivs,
00102 const Stokhos::EpetraVectorOrthogPoly* sg_xdot,
00103 const Stokhos::EpetraVectorOrthogPoly* sg_xdotdot,
00104 const Stokhos::EpetraVectorOrthogPoly& sg_x,
00105 const Teuchos::Array<ParamVec>& p,
00106 const Teuchos::Array<int>& sg_p_index,
00107 const Teuchos::Array< Teuchos::Array<SGType> >& sg_p_vals,
00108 ParamVec* deriv_p,
00109 const Epetra_MultiVector* Vx,
00110 const Epetra_MultiVector* Vxdot,
00111 const Epetra_MultiVector* Vxdotdot,
00112 const Epetra_MultiVector* Vp,
00113 Stokhos::EpetraVectorOrthogPoly* sg_g,
00114 Stokhos::EpetraMultiVectorOrthogPoly* sg_JV,
00115 Stokhos::EpetraMultiVectorOrthogPoly* sg_gp);
00116
00118 virtual void evaluateSGGradient(
00119 const double current_time,
00120 const Stokhos::EpetraVectorOrthogPoly* sg_xdot,
00121 const Stokhos::EpetraVectorOrthogPoly* sg_xdotdot,
00122 const Stokhos::EpetraVectorOrthogPoly& sg_x,
00123 const Teuchos::Array<ParamVec>& p,
00124 const Teuchos::Array<int>& sg_p_index,
00125 const Teuchos::Array< Teuchos::Array<SGType> >& sg_p_vals,
00126 ParamVec* deriv_p,
00127 Stokhos::EpetraVectorOrthogPoly* sg_g,
00128 Stokhos::EpetraMultiVectorOrthogPoly* sg_dg_dx,
00129 Stokhos::EpetraMultiVectorOrthogPoly* sg_dg_dxdot,
00130 Stokhos::EpetraMultiVectorOrthogPoly* sg_dg_dxdotdot,
00131 Stokhos::EpetraMultiVectorOrthogPoly* sg_dg_dp);
00132 #endif //ALBANY_SG_MP
00133
00135
00137
00138
00139 #ifdef ALBANY_SG_MP
00140
00141 virtual void evaluateMPResponse(
00142 const double curr_time,
00143 const Stokhos::ProductEpetraVector* mp_xdot,
00144 const Stokhos::ProductEpetraVector* mp_xdotdot,
00145 const Stokhos::ProductEpetraVector& mp_x,
00146 const Teuchos::Array<ParamVec>& p,
00147 const Teuchos::Array<int>& mp_p_index,
00148 const Teuchos::Array< Teuchos::Array<MPType> >& mp_p_vals,
00149 Stokhos::ProductEpetraVector& mp_g);
00150
00152 virtual void evaluateMPTangent(
00153 const double alpha,
00154 const double beta,
00155 const double omega,
00156 const double current_time,
00157 bool sum_derivs,
00158 const Stokhos::ProductEpetraVector* mp_xdot,
00159 const Stokhos::ProductEpetraVector* mp_xdotdot,
00160 const Stokhos::ProductEpetraVector& mp_x,
00161 const Teuchos::Array<ParamVec>& p,
00162 const Teuchos::Array<int>& mp_p_index,
00163 const Teuchos::Array< Teuchos::Array<MPType> >& mp_p_vals,
00164 ParamVec* deriv_p,
00165 const Epetra_MultiVector* Vx,
00166 const Epetra_MultiVector* Vxdot,
00167 const Epetra_MultiVector* Vxdotdot,
00168 const Epetra_MultiVector* Vp,
00169 Stokhos::ProductEpetraVector* mp_g,
00170 Stokhos::ProductEpetraMultiVector* mp_JV,
00171 Stokhos::ProductEpetraMultiVector* mp_gp);
00172
00174 virtual void evaluateMPGradient(
00175 const double current_time,
00176 const Stokhos::ProductEpetraVector* mp_xdot,
00177 const Stokhos::ProductEpetraVector* mp_xdotdot,
00178 const Stokhos::ProductEpetraVector& mp_x,
00179 const Teuchos::Array<ParamVec>& p,
00180 const Teuchos::Array<int>& mp_p_index,
00181 const Teuchos::Array< Teuchos::Array<MPType> >& mp_p_vals,
00182 ParamVec* deriv_p,
00183 Stokhos::ProductEpetraVector* mp_g,
00184 Stokhos::ProductEpetraMultiVector* mp_dg_dx,
00185 Stokhos::ProductEpetraMultiVector* mp_dg_dxdot,
00186 Stokhos::ProductEpetraMultiVector* mp_dg_dxdotdot,
00187 Stokhos::ProductEpetraMultiVector* mp_dg_dp);
00188 #endif //ALBANY_SG_MP
00189
00191
00192 private:
00193
00195 SolutionAverageResponseFunction(const SolutionAverageResponseFunction&);
00196
00198 SolutionAverageResponseFunction& operator=(const SolutionAverageResponseFunction&);
00199
00200 };
00201
00202 }
00203
00204 #endif // ALBANY_SOLUTIONAVERAGERESPONSEFUNCTION_HPP