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
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042 #ifndef LOCA_THYRA_GROUP_H
00043 #define LOCA_THYRA_GROUP_H
00044
00045 #include "LOCA_Abstract_Group.H"
00046 #include "NOX_Thyra_Group.H"
00047 #include "LOCA_Parameter_Vector.H"
00048 #include "Thyra_VectorBase.hpp"
00049 #include "LOCA_Thyra_SaveDataStrategy.H"
00050
00051
00052 namespace Teuchos {
00053 class ParameterList;
00054 }
00055
00056 namespace LOCA {
00057
00059 namespace Thyra {
00060
00062 class Group : public virtual NOX::Thyra::Group,
00063 public virtual LOCA::Abstract::Group {
00064
00065 public:
00066
00068 Group(const Teuchos::RCP<LOCA::GlobalData>& global_data,
00069 const NOX::Thyra::Vector& initial_guess,
00070 const Teuchos::RCP< ::Thyra::ModelEvaluator<double> >& model,
00071 const LOCA::ParameterVector& p,
00072 int p_index,
00073 bool implement_dfdp = false);
00074
00079 Group(const Group& source, NOX::CopyType type = NOX::DeepCopy);
00080
00082 virtual ~Group();
00083
00085 virtual Group& operator=(const Group& source);
00086
00091
00093 virtual NOX::Abstract::Group&
00094 operator=(const NOX::Abstract::Group& source);
00095
00097 virtual NOX::Abstract::Group&
00098 operator=(const NOX::Thyra::Group& source);
00099
00101 virtual Teuchos::RCP<NOX::Abstract::Group>
00102 clone(NOX::CopyType type = NOX::DeepCopy) const;
00103
00105 virtual NOX::Abstract::Group::ReturnType
00106 computeF();
00107
00109 virtual NOX::Abstract::Group::ReturnType
00110 computeJacobian();
00111
00113
00118
00120 virtual void copy(const NOX::Abstract::Group& source);
00121
00123 virtual void setParams(const ParameterVector& p);
00124
00126 virtual void setParam(int paramID, double val);
00127
00129 virtual void setParam(string paramID, double val);
00130
00132 const LOCA::ParameterVector& getParams() const;
00133
00135 virtual double getParam(int paramID) const;
00136
00138 virtual double getParam(string paramID) const;
00139
00146 virtual NOX::Abstract::Group::ReturnType
00147 computeDfDpMulti(const vector<int>& paramIDs,
00148 NOX::Abstract::MultiVector& dfdp,
00149 bool isValidF);
00150
00152 virtual void
00153 preProcessContinuationStep(
00154 LOCA::Abstract::Iterator::StepStatus stepStatus);
00155
00157 virtual void
00158 postProcessContinuationStep(
00159 LOCA::Abstract::Iterator::StepStatus stepStatus);
00160
00162 virtual void projectToDraw(const NOX::Abstract::Vector& x,
00163 double *px) const;
00164
00166 virtual int projectToDrawDimension() const;
00167
00169
00173 virtual double
00174 computeScaledDotProduct(const NOX::Abstract::Vector& a,
00175 const NOX::Abstract::Vector& b) const;
00176
00178 virtual void printSolution(const double conParam) const;
00179
00181 virtual void printSolution(const NOX::Abstract::Vector& x,
00182 const double conParam) const;
00183
00185
00189 virtual void
00190 scaleVector(NOX::Abstract::Vector& x) const;
00191
00193
00198
00200 virtual NOX::Abstract::Group::ReturnType
00201 computeShiftedMatrix(double alpha, double beta);
00202
00204 virtual NOX::Abstract::Group::ReturnType
00205 applyShiftedMatrix(const NOX::Abstract::Vector& input,
00206 NOX::Abstract::Vector& result) const;
00207
00209 virtual NOX::Abstract::Group::ReturnType
00210 applyShiftedMatrixMultiVector(
00211 const NOX::Abstract::MultiVector& input,
00212 NOX::Abstract::MultiVector& result) const;
00213
00218 virtual NOX::Abstract::Group::ReturnType
00219 applyShiftedMatrixInverseMultiVector(
00220 Teuchos::ParameterList& params,
00221 const NOX::Abstract::MultiVector& input,
00222 NOX::Abstract::MultiVector& result) const;
00224
00226 void setSaveDataStrategy(
00227 const Teuchos::RCP<LOCA::Thyra::SaveDataStrategy>& s);
00228
00229 protected:
00230
00232 Teuchos::RCP<LOCA::GlobalData> globalData;
00233
00235 LOCA::ParameterVector params;
00236
00238 int param_index;
00239
00241 Teuchos::RCP< ::Thyra::VectorBase<double> > param_thyra_vec;
00242
00244 Teuchos::RCP< ::Thyra::VectorBase<double> > x_dot_vec;
00245
00247 Teuchos::RCP<LOCA::Thyra::SaveDataStrategy> saveDataStrategy;
00248
00250 bool implement_dfdp;
00251
00252 };
00253
00254 }
00255 }
00256
00257
00258 #endif