00001
00002
00003
00004
00005
00006
00007 #include "Albany_DistributedResponseFunction.hpp"
00008
00009 void
00010 Albany::DistributedResponseFunction::
00011 evaluateDerivative(
00012 const double current_time,
00013 const Epetra_Vector* xdot,
00014 const Epetra_Vector* xdotdot,
00015 const Epetra_Vector& x,
00016 const Teuchos::Array<ParamVec>& p,
00017 ParamVec* deriv_p,
00018 Epetra_Vector* g,
00019 const EpetraExt::ModelEvaluator::Derivative& dg_dx,
00020 const EpetraExt::ModelEvaluator::Derivative& dg_dxdot,
00021 const EpetraExt::ModelEvaluator::Derivative& dg_dxdotdot,
00022 const EpetraExt::ModelEvaluator::Derivative& dg_dp)
00023 {
00024 this->evaluateGradient(
00025 current_time, xdot, xdotdot, x, p, deriv_p, g,
00026 dg_dx.getLinearOp().get(), dg_dxdot.getLinearOp().get(),
00027 dg_dxdotdot.getLinearOp().get(), dg_dp.getMultiVector().get());
00028 }
00029
00030 #ifdef ALBANY_SG_MP
00031 void
00032 Albany::DistributedResponseFunction::
00033 evaluateSGDerivative(
00034 const double current_time,
00035 const Stokhos::EpetraVectorOrthogPoly* sg_xdot,
00036 const Stokhos::EpetraVectorOrthogPoly* sg_xdotdot,
00037 const Stokhos::EpetraVectorOrthogPoly& sg_x,
00038 const Teuchos::Array<ParamVec>& p,
00039 const Teuchos::Array<int>& sg_p_index,
00040 const Teuchos::Array< Teuchos::Array<SGType> >& sg_p_vals,
00041 ParamVec* deriv_p,
00042 Stokhos::EpetraVectorOrthogPoly* sg_g,
00043 const EpetraExt::ModelEvaluator::SGDerivative& sg_dg_dx,
00044 const EpetraExt::ModelEvaluator::SGDerivative& sg_dg_dxdot,
00045 const EpetraExt::ModelEvaluator::SGDerivative& sg_dg_dxdotdot,
00046 const EpetraExt::ModelEvaluator::SGDerivative& sg_dg_dp)
00047 {
00048 this->evaluateSGGradient(
00049 current_time, sg_xdot, sg_xdotdot, sg_x, p, sg_p_index, sg_p_vals, deriv_p,
00050 sg_g, sg_dg_dx.getLinearOp().get(), sg_dg_dxdot.getLinearOp().get(),
00051 sg_dg_dxdotdot.getLinearOp().get(), sg_dg_dp.getMultiVector().get());
00052 }
00053
00054 void
00055 Albany::DistributedResponseFunction::
00056 evaluateMPDerivative(
00057 const double current_time,
00058 const Stokhos::ProductEpetraVector* mp_xdot,
00059 const Stokhos::ProductEpetraVector* mp_xdotdot,
00060 const Stokhos::ProductEpetraVector& mp_x,
00061 const Teuchos::Array<ParamVec>& p,
00062 const Teuchos::Array<int>& mp_p_index,
00063 const Teuchos::Array< Teuchos::Array<MPType> >& mp_p_vals,
00064 ParamVec* deriv_p,
00065 Stokhos::ProductEpetraVector* mp_g,
00066 const EpetraExt::ModelEvaluator::MPDerivative& mp_dg_dx,
00067 const EpetraExt::ModelEvaluator::MPDerivative& mp_dg_dxdot,
00068 const EpetraExt::ModelEvaluator::MPDerivative& mp_dg_dxdotdot,
00069 const EpetraExt::ModelEvaluator::MPDerivative& mp_dg_dp)
00070 {
00071 this->evaluateMPGradient(
00072 current_time, mp_xdot, mp_xdotdot, mp_x, p, mp_p_index, mp_p_vals, deriv_p,
00073 mp_g, mp_dg_dx.getLinearOp().get(), mp_dg_dxdot.getLinearOp().get(),
00074 mp_dg_dxdotdot.getLinearOp().get(), mp_dg_dp.getMultiVector().get());
00075 }
00076 #endif //ALBANY_SG_MP