| 1 |
// @HEADER |
| 2 |
// ***************************************************************************** |
| 3 |
// LOCA: Library of Continuation Algorithms Package |
| 4 |
// |
| 5 |
// Copyright 2001-2005 NTESS and the LOCA contributors. |
| 6 |
// SPDX-License-Identifier: BSD-3-Clause |
| 7 |
// ***************************************************************************** |
| 8 |
// @HEADER |
| 9 |
|
| 10 |
#ifndef CONTINUATION_MANAGER_H |
| 11 |
#define CONTINUATION_MANAGER_H |
| 12 |
|
| 13 |
// Trilinos headers |
| 14 |
#include "Epetra_Time.h" |
| 15 |
#include "LOCA_Stepper.H" |
| 16 |
#include "Teuchos_XMLParameterListHelpers.hpp" |
| 17 |
#include "LOCA_MultiContinuation_ConstraintInterfaceMVDX.H" |
| 18 |
#include "LOCA_Epetra_Interface_xyzt.H" |
| 19 |
#include "EpetraExt_MultiComm.h" |
| 20 |
|
| 21 |
// DefCont headers |
| 22 |
#include "ProblemLOCAPrototype.H" |
| 23 |
|
| 24 |
class ContinuationManager { |
| 25 |
|
| 26 |
public: |
| 27 |
|
| 28 |
// Print or not a solution file |
| 29 |
enum SolutionFileAttribute { NoPrint, Print }; |
| 30 |
|
| 31 |
// Constructor |
| 32 |
ContinuationManager( |
| 33 |
//const Teuchos::RCP< Epetra_MpiComm > & aComm , |
| 34 |
const Teuchos::RCP< Epetra_Comm > & aComm , |
| 35 |
const std::string & taskFileName); |
| 36 |
|
| 37 |
// Destructor |
| 38 |
~ContinuationManager(); |
| 39 |
|
| 40 |
// Instantiante the LOCA stepper |
| 41 |
bool BuildLOCAStepper(); |
| 42 |
|
| 43 |
// Instantiante the LOCA stepper for periodic (xyzt) problems |
| 44 |
bool BuildLOCAPeriodicStepper(const Teuchos::RCP<EpetraExt::MultiComm> globalComm); |
| 45 |
|
| 46 |
// Perform some checks on the LOCA stepper |
| 47 |
bool ValidateLOCAStepper(); |
| 48 |
|
| 49 |
// Start the LOCA stepper |
| 50 |
bool RunLOCAStepper(); |
| 51 |
|
| 52 |
// Print Statistics |
| 53 |
bool PrintLOCAStepperStatistics(); |
| 54 |
|
| 55 |
// Returns the name of the actual solution file |
| 56 |
std::string GetSolutionFileName() const; |
| 57 |
|
| 58 |
// Returns the name of the continuation file |
| 59 |
std::string GetContinuationFileName() const; |
| 60 |
|
| 61 |
// Returns the stepper id |
| 62 |
int GetStepID() const; |
| 63 |
|
| 64 |
// Getting the Task list it will |
| 65 |
// be shared with a ProblemLOCAPrototype problem |
| 66 |
Teuchos::RCP <Teuchos::ParameterList> GetTaskList() const; |
| 67 |
|
| 68 |
// Determine whether a solution file is to be printed |
| 69 |
SolutionFileAttribute GetSolutionFileAttribute() const; |
| 70 |
|
| 71 |
// Set the ProblemLOCAPrototype problem |
| 72 |
bool SetLOCAProblem( |
| 73 |
const Teuchos::RCP <ProblemLOCAPrototype> & aProblem ); |
| 74 |
|
| 75 |
// Set the ProblemLOCAPrototype problem |
| 76 |
bool SetLOCAConstraint( |
| 77 |
const Teuchos::RCP <LOCA::MultiContinuation::ConstraintInterface> & |
| 78 |
anInterfaceConstraint); |
| 79 |
|
| 80 |
// Setting the task list |
| 81 |
bool SetTaskList( Teuchos::RCP <Teuchos::ParameterList> aTaskList ); |
| 82 |
|
| 83 |
// Makes a std::string from a given integer |
| 84 |
std::string StringifyInt( const int & intNumber , |
| 85 |
const int & digits) const; |
| 86 |
|
| 87 |
private: |
| 88 |
|
| 89 |
// The communicator |
| 90 |
//Teuchos::RCP <Epetra_MpiComm> comm; |
| 91 |
Teuchos::RCP <Epetra_Comm> comm; |
| 92 |
|
| 93 |
// The continuation file name |
| 94 |
std::string continuationFileName; |
| 95 |
|
| 96 |
// The initial step label |
| 97 |
int iniStepLabel; |
| 98 |
|
| 99 |
// Intefrace to the eventual constraint |
| 100 |
Teuchos::RCP <LOCA::MultiContinuation::ConstraintInterface> interfaceConstraint; |
| 101 |
|
| 102 |
// // Is it a constrained problem? |
| 103 |
// bool isConstrainedProblem; |
| 104 |
|
| 105 |
// The LOCA global data |
| 106 |
Teuchos::RCP<LOCA::GlobalData> locaGlobalData; |
| 107 |
|
| 108 |
// The LOCA stepper |
| 109 |
Teuchos::RCP <LOCA::Stepper> locaStepper; |
| 110 |
|
| 111 |
// The LOCA stepper status |
| 112 |
LOCA::Abstract::Iterator::IteratorStatus locaStepperStatus; |
| 113 |
|
| 114 |
// Maximum number of steps allowed (iniStepLabel included) |
| 115 |
int maxAllowedSteps; |
| 116 |
|
| 117 |
// The output Directory |
| 118 |
std::string outputDir; |
| 119 |
|
| 120 |
// The ProblemLOCAPrototype problem |
| 121 |
Teuchos::RCP <ProblemLOCAPrototype> problem; |
| 122 |
|
| 123 |
// The extension for each solution (i.e. ".vtk") |
| 124 |
std::string solutionFilesExtension; |
| 125 |
|
| 126 |
// The flag to be assigned to each solution (i.e. "step_") |
| 127 |
std::string solutionFilesPrefix; |
| 128 |
|
| 129 |
// The task list |
| 130 |
Teuchos::RCP <Teuchos::ParameterList> taskList; |
| 131 |
|
| 132 |
// Time counter |
| 133 |
Epetra_Time timeCounter; |
| 134 |
|
| 135 |
}; |
| 136 |
|
| 137 |
#endif |