// @HEADER // ***************************************************************************** // NOX: An Object-Oriented Nonlinear Solver Package // // Copyright 2002 NTESS and the NOX contributors. // SPDX-License-Identifier: BSD-3-Clause // ***************************************************************************** // @HEADER #ifndef NOX_THYRA_MODEL_EVALUATOR_HEQ_DECL_HPP #define NOX_THYRA_MODEL_EVALUATOR_HEQ_DECL_HPP #include "Thyra_StateFuncModelEvaluatorBase.hpp" #include template class ModelEvaluatorHeq; /** \brief Nonmember constuctor. * * \relates ModelEvaluatorHeq */ template Teuchos::RCP > modelEvaluatorHeq(const Teuchos::RCP& comm, const int NumGlobalElements, const Scalar paramC); /** \brief Chandrasekhar H-Equation * * The equation modeled is: \f$ F(x)_i = x_i - (1 - \frac{c}{2N}\sum_{j=1}^N \frac{\mu_ix_j}{\mu_i + \mu_j})^{-1} = 0, 1 <= i <= N\f$ * In this, \f$[0,1]\f$ is discretized into \f$N\f$ uniformly sized * cells and \f$\{\mu_j\}\f$ are the midpoints of these cells. */ template class ModelEvaluatorHeq : public ::Thyra::StateFuncModelEvaluatorBase { public: ModelEvaluatorHeq(const Teuchos::RCP& comm, const int num_global_elements, const Scalar paramC); /** \name Initializers/Accessors */ //@{ /** \brief . */ void set_x0(const Teuchos::ArrayView &x0); /** \brief . */ void setShowGetInvalidArgs(bool showGetInvalidArg); void set_W_factory(const Teuchos::RCP >& W_factory); //@} /** \name Public functions overridden from ModelEvaulator. */ //@{ /** \brief . */ Teuchos::RCP > get_x_space() const; /** \brief . */ Teuchos::RCP > get_f_space() const; /** \brief . */ ::Thyra::ModelEvaluatorBase::InArgs getNominalValues() const; /** \brief . */ Teuchos::RCP< ::Thyra::LinearOpBase > create_W_op() const; /** \brief . */ Teuchos::RCP > get_W_factory() const; /** \brief . */ ::Thyra::ModelEvaluatorBase::InArgs createInArgs() const; /** \brief . */ Teuchos::RCP< ::Thyra::PreconditionerBase< Scalar > > create_W_prec() const; //@} private: /** \name Private functions overridden from ModelEvaulatorDefaultBase. */ //@{ /** \brief . */ ::Thyra::ModelEvaluatorBase::OutArgs createOutArgsImpl() const; /** \brief . */ void evalModelImpl( const ::Thyra::ModelEvaluatorBase::InArgs &inArgs, const ::Thyra::ModelEvaluatorBase::OutArgs &outArgs ) const; //@} private: // data members const Teuchos::RCP comm_; const int num_global_elements_; const Scalar paramC_; Teuchos::RCP > x_space_; Teuchos::RCP x_map_; Teuchos::RCP > f_space_; Teuchos::RCP f_map_; Teuchos::RCP > W_factory_; Teuchos::RCP A_heq_; mutable Teuchos::RCP x_ptr_; std::vector node_coordinates_; Teuchos::RCP ones_; ::Thyra::ModelEvaluatorBase::InArgs nominalValues_; Teuchos::RCP< ::Thyra::VectorBase > x0_; bool showGetInvalidArg_; ::Thyra::ModelEvaluatorBase::InArgs prototypeInArgs_; ::Thyra::ModelEvaluatorBase::OutArgs prototypeOutArgs_; }; //================================================================== #include "ModelEvaluatorHeq_def.hpp" //================================================================== #endif