/usr/include/trilinos/LOCA_Factory.H is in libtrilinos-nox-dev 12.4.2-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 | // $Id$
// $Source$
//@HEADER
// ************************************************************************
//
// LOCA: Library of Continuation Algorithms Package
// Copyright (2005) Sandia Corporation
//
// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
// license for use of this work by or on behalf of the U.S. Government.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// 3. Neither the name of the Corporation nor the names of the
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Questions? Contact Roger Pawlowski (rppawlo@sandia.gov) or
// Eric Phipps (etphipp@sandia.gov), Sandia National Laboratories.
// ************************************************************************
// CVS Information
// $Source$
// $Author$
// $Date$
// $Revision$
// ************************************************************************
//@HEADER
#ifndef LOCA_FACTORY_H
#define LOCA_FACTORY_H
#include "Teuchos_RCP.hpp"
#include "NOX_Abstract_Group.H"
#include "LOCA_MultiPredictor_Factory.H"
#include "LOCA_MultiContinuation_Factory.H"
#include "LOCA_Bifurcation_Factory.H"
#include "LOCA_StepSize_Factory.H"
#include "LOCA_BorderedSolver_Factory.H"
#include "LOCA_Eigensolver_Factory.H"
#include "LOCA_EigenvalueSort_Factory.H"
#include "LOCA_SaveEigenData_Factory.H"
#include "LOCA_AnasaziOperator_Factory.H"
#include "LOCA_TurningPoint_MooreSpence_SolverFactory.H"
#include "LOCA_Pitchfork_MooreSpence_SolverFactory.H"
#include "LOCA_Hopf_MooreSpence_SolverFactory.H"
// Forward declarations
namespace Teuchos {
class ParameterList;
}
namespace LOCA {
class GlobalData;
namespace Abstract {
class Factory;
}
namespace Parameter {
class SublistParser;
}
}
namespace LOCA {
//! %Factory class for creating strategies
/*!
* The %Factory class provides a single location for instantiating
* various strategies based on parameter list choices. It provides a
* create() method for each type of strategy which instantiates strategy
* objects for that type. Each create method takes as arguments a
* ref-count pointer to a LOCA::Parameter::SublistParser and a parameter
* list. The parameter list determines which strategy to choose and also
* should provide any parameters the strategy requires. The sublist parser
* provides a parsed version of the top-level parameter list and allows
* strategies to easily obtain other sublists from the top-level list.
* A user-supplied factory may also be provided for instantiating
* user-defined strategies. If a user-defined factory is supplied,
* each create method will first attempt to instantiate the strategy using
* it, and then instantiate strategies itself if necessary.
*/
class Factory {
public:
//! Constructor
/*!
* \param global_data [in] Global data object. The constructor sets the
* factory member of the global data to this.
*/
Factory(const Teuchos::RCP<LOCA::GlobalData>& global_data);
//! Constructor with user-supplied factory
/*!
* \param global_data [in] Global data object. The constructor sets the
* factory member of the global data to this.
* \param userFactory [in] A user-supplied factory for instantiating
* user-defined strategies.
*/
Factory(const Teuchos::RCP<LOCA::GlobalData>& global_data,
const Teuchos::RCP<LOCA::Abstract::Factory>& userFactory);
//! Destructor
virtual ~Factory();
/*!
* @name Strategy create methods
*/
//@{
//! Create predictor strategy
/*!
* Instantiates a predictor strategy based on the
* "Method" parameter of the "Predictor" sublist. See
* LOCA::MultiPredictor::Factory for a description of available strategies.
*/
Teuchos::RCP<LOCA::MultiPredictor::AbstractStrategy>
createPredictorStrategy(
const Teuchos::RCP<LOCA::Parameter::SublistParser>& topParams,
const Teuchos::RCP<Teuchos::ParameterList>& predictorParams);
//! Create continuation strategy
/*!
* Instantiates a continuation strategy based on the "Continuation Method"
* parameter of the "Stepper" sublist. See
* LOCA::MultiContinuation::Factory for a description of available
* strategies.
*/
Teuchos::RCP<LOCA::MultiContinuation::AbstractStrategy>
createContinuationStrategy(
const Teuchos::RCP<LOCA::Parameter::SublistParser>& topParams,
const Teuchos::RCP<Teuchos::ParameterList>& stepperParams,
const Teuchos::RCP<LOCA::MultiContinuation::AbstractGroup>& grp,
const Teuchos::RCP<LOCA::MultiPredictor::AbstractStrategy>& pred,
const std::vector<int>& paramIDs);
//! Create bifurcation strategy
/*!
* Instantiates a bifurcation strategy based on the "Method"
* parameter of the "Bifurcation" sublist. See
* LOCA::Bifurcation::Factory for a description of available
* strategies.
*/
Teuchos::RCP<LOCA::MultiContinuation::AbstractGroup>
createBifurcationStrategy(
const Teuchos::RCP<LOCA::Parameter::SublistParser>& topParams,
const Teuchos::RCP<Teuchos::ParameterList>& bifurcationParams,
const Teuchos::RCP<LOCA::MultiContinuation::AbstractGroup>& grp);
//! Create step size control strategy
/*!
* Instantiates a step size control strategy based on the
* "Method" parameter of the "Step Size" sublist. See
* LOCA::StepSize::Factory for a description of available strategies.
*/
Teuchos::RCP<LOCA::StepSize::AbstractStrategy>
createStepSizeStrategy(
const Teuchos::RCP<LOCA::Parameter::SublistParser>& topParams,
const Teuchos::RCP<Teuchos::ParameterList>& stepsizeParams);
//! Create bordered system solver strategy
/*!
* Instantiates an bordered system solver strategy based on the
* "Bordered Solver Method" parameter
* of the "Linear Solver" sublist. See LOCA::BorderedSolver::Factory for
* a description of available strategies.
*/
Teuchos::RCP<LOCA::BorderedSolver::AbstractStrategy>
createBorderedSolverStrategy(
const Teuchos::RCP<LOCA::Parameter::SublistParser>& topParams,
const Teuchos::RCP<Teuchos::ParameterList>& solverParams);
//! Create eigensolver strategy
/*!
* Instantiates an eigensolver strategy based on the "Method" parameter
* of the "Eigensolver" sublist. See LOCA::Eigensolver::Factory for a
* description of available strategies.
*/
Teuchos::RCP<LOCA::Eigensolver::AbstractStrategy>
createEigensolverStrategy(
const Teuchos::RCP<LOCA::Parameter::SublistParser>& topParams,
const Teuchos::RCP<Teuchos::ParameterList>& eigenParams);
//! Create eigenvalue sort strategy
/*!
* Instantiates an eigenvalue sorting strategy based on the
* "Sorting Method" parameter of the "Eigensolver" sublist. See
* LOCA::EigenvalueSort::Factory for a description of available strategies.
*/
Teuchos::RCP<LOCA::EigenvalueSort::AbstractStrategy>
createEigenvalueSortStrategy(
const Teuchos::RCP<LOCA::Parameter::SublistParser>& topParams,
const Teuchos::RCP<Teuchos::ParameterList>& eigenParams);
//! Create strategy to save eigenvector/value data
/*!
* Instantiates a strategy to save eigenvector/value data based on the
* "Save Eigen Data Method" parameter of the "Eigensolver" sublist.
* See LOCA::SaveEigenData::Factory for a description of available
* strategies.
*/
Teuchos::RCP<LOCA::SaveEigenData::AbstractStrategy>
createSaveEigenDataStrategy(
const Teuchos::RCP<LOCA::Parameter::SublistParser>& topParams,
const Teuchos::RCP<Teuchos::ParameterList>& eigenParams);
//! Create Anasazi operator strategy
/*!
* Instantiates an Anasazi operator strategy based on the "Operator"
* parameter of the "Eigensolver" sublist. See
* LOCA::AnasaziOperator::Factory for a description of available
* strategies.
*/
Teuchos::RCP<LOCA::AnasaziOperator::AbstractStrategy>
createAnasaziOperatorStrategy(
const Teuchos::RCP<LOCA::Parameter::SublistParser>& topParams,
const Teuchos::RCP<Teuchos::ParameterList>& eigenParams,
const Teuchos::RCP<Teuchos::ParameterList>& solverParams,
const Teuchos::RCP<NOX::Abstract::Group>& grp);
//! Create Moore-Spence turning point solver strategy
/*!
* Instantiates a solver strategy based on the
* "Solver Method" parameter of the "Bifurcation" sublist. See
* LOCA::TurningPoint::MooreSpence::SolverFactory for a description of
* available strategies.
*/
Teuchos::RCP<LOCA::TurningPoint::MooreSpence::SolverStrategy>
createMooreSpenceTurningPointSolverStrategy(
const Teuchos::RCP<LOCA::Parameter::SublistParser>& topParams,
const Teuchos::RCP<Teuchos::ParameterList>& solverParams);
//! Create Moore-Spence pitchfork solver strategy
/*!
* Instantiates a solver strategy based on the
* "Solver Method" parameter of the "Bifurcation" sublist. See
* LOCA::Pitchfork::MooreSpence::SolverFactory for a description of
* available strategies.
*/
Teuchos::RCP<LOCA::Pitchfork::MooreSpence::SolverStrategy>
createMooreSpencePitchforkSolverStrategy(
const Teuchos::RCP<LOCA::Parameter::SublistParser>& topParams,
const Teuchos::RCP<Teuchos::ParameterList>& solverParams);
//! Create Moore-Spence Hopf solver strategy
/*!
* Instantiates a solver strategy based on the
* "Solver Method" parameter of the "Bifurcation" sublist. See
* LOCA::Hopf::MooreSpence::SolverFactory for a description of
* available strategies.
*/
Teuchos::RCP<LOCA::Hopf::MooreSpence::SolverStrategy>
createMooreSpenceHopfSolverStrategy(
const Teuchos::RCP<LOCA::Parameter::SublistParser>& topParams,
const Teuchos::RCP<Teuchos::ParameterList>& solverParams);
//@}
private:
//! Private to prohibit copying
Factory(const Factory&);
//! Private to prohibit copying
Factory& operator = (const Factory&);
protected:
//! Global data
Teuchos::RCP<LOCA::GlobalData> globalData;
//! User provided factory
Teuchos::RCP<LOCA::Abstract::Factory> factory;
//! Flag indicating whether we have a factory or not
bool haveFactory;
//! Predictor factory
LOCA::MultiPredictor::Factory predictorFactory;
//! Continuation factory
LOCA::MultiContinuation::Factory continuationFactory;
//! Bifurcation factory
LOCA::Bifurcation::Factory bifurcationFactory;
//! Step size factory
LOCA::StepSize::Factory stepsizeFactory;
//! Bordered system factory
LOCA::BorderedSolver::Factory borderedFactory;
//! Eigensolver factory
LOCA::Eigensolver::Factory eigensolverFactory;
//! EigenvalueSort factory
LOCA::EigenvalueSort::Factory eigenvalueSortFactory;
//! Save eigen data factory
LOCA::SaveEigenData::Factory saveEigenFactory;
//! Anasazi operator factory
LOCA::AnasaziOperator::Factory anasaziOperatorFactory;
//! Moore-Spence turning point solver factory
LOCA::TurningPoint::MooreSpence::SolverFactory mooreSpenceTurningPointSolverFactory;
//! Moore-Spence pitchfork point solver factory
LOCA::Pitchfork::MooreSpence::SolverFactory mooreSpencePitchforkSolverFactory;
//! Moore-Spence Hopf point solver factory
LOCA::Hopf::MooreSpence::SolverFactory mooreSpenceHopfSolverFactory;
}; // Class Factory
} // Namespace LOCA
#endif
|