Skip to content
This repository was archived by the owner on May 18, 2019. It is now read-only.

Commit be4b2d9

Browse files
Niklas WorschechOpenModelica-Hudson
authored andcommitted
completed replacing generateoutput-flag by logging
1 parent 28e177d commit be4b2d9

File tree

4 files changed

+7
-17
lines changed

4 files changed

+7
-17
lines changed

SimulationRuntime/cpp/Include/Solver/Nox/Nox.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ class Nox : public IAlgLoopSolver
9797
Teuchos::RCP<std::ostream> _output;
9898

9999
bool _firstCall;
100-
bool _generateoutput;
101100
bool _useDomainScaling;
102101

103102
bool _OutOfProperMethods;

SimulationRuntime/cpp/Include/Solver/Nox/NoxLapackInterface.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ class NoxLapackInterface : public LOCA::LAPACK::Interface {
4242
INonLinearAlgLoop *_algLoop;///< Algebraic loop to be solved, required to obtain value of f
4343
double *_yScale, *_fScale, *_hugeabsolutevalues, *_xtemp, *_rhs;
4444
int _dimSys;
45-
bool _generateoutput;
4645
bool _useDomainScaling;
4746
bool _useFunctionValueScaling;
4847
double _lambda;//homotopy parameter

SimulationRuntime/cpp/Solver/Nox/Nox.cpp

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ Nox::Nox(INonLinearAlgLoop* algLoop, INonLinSolverSettings* settings)
3535
, _yScale (NULL)
3636
, _helpArray (NULL)
3737
, _firstCall (true)
38-
, _generateoutput (false)
3938
, _useDomainScaling (false)
4039
, _currentIterate (NULL)
4140
, _dimSys (_algLoop->getDimReal())
@@ -66,7 +65,6 @@ Nox::~Nox()
6665
*/
6766
void Nox::initialize()
6867
{
69-
if (_generateoutput) std::cout << "starting init" << std::endl;
7068
_firstCall = false;
7169
_algLoop->initialize();//this sets values in the real variable
7270

@@ -114,8 +112,6 @@ void Nox::initialize()
114112
_statusTestsCombo->addStatusTest(_statusTestStagnation);
115113
_statusTestsCombo->addStatusTest(_statusTestDivergence);
116114
//_statusTestsCombo->addStatusTest(_statusTestSgnChange);
117-
118-
if (_generateoutput) std::cout << "ending init" << std::endl;
119115
}
120116
/**
121117
* \brief main solving routine
@@ -148,8 +144,11 @@ void Nox::solve()
148144
LOGGER_WRITE_BEGIN("Nox: start solving algebraic loop no. " + to_string(_algLoop->getEquationIndex()) + " at Simulation time " + to_string(_algLoop->getSimTime()), _lc, LL_DEBUG);
149145

150146
//setup solver
151-
if (_firstCall)
147+
if (_firstCall){
148+
LOGGER_WRITE("initialize...",_lc, LL_DEBUG);
152149
initialize();
150+
LOGGER_WRITE("init done!",_lc, LL_DEBUG);
151+
}
153152

154153
// Create the list of solver parameters. For detailed calibration, check https://trilinos.org/docs/dev/packages/nox/doc/html/parameters.html
155154
_solverParametersPtr = Teuchos::rcp(new Teuchos::ParameterList);
@@ -526,11 +525,7 @@ void Nox::LocaHomotopySolve(const int numberofhomotopytries)
526525
nlPrintParams.set("Output Stream", _output);
527526
nlPrintParams.set("Error Stream", _output);
528527
//Set the level of output
529-
if (_generateoutput){
530-
nlPrintParams.set("Output Information", NOX::Utils::Details + NOX::Utils::OuterIteration + NOX::Utils::Warning + NOX::Utils::StepperIteration + NOX::Utils::StepperDetails + NOX::Utils::StepperParameters); // Should set
531-
}else{
532-
nlPrintParams.set("Output Information", NOX::Utils::Error); // Should set
533-
}
528+
nlPrintParams.set("Output Information", NOX::Utils::Details + NOX::Utils::OuterIteration + NOX::Utils::Warning + NOX::Utils::StepperIteration + NOX::Utils::StepperDetails + NOX::Utils::StepperParameters); // Should set
534529

535530
// Create LAPACK Factory
536531
Teuchos::RCP<LOCA::LAPACK::Factory> lapackFactory = Teuchos::rcp(new LOCA::LAPACK::Factory);
@@ -944,10 +939,8 @@ void Nox::printLogger(){
944939
void Nox::addPrintingList(const Teuchos::RCP<Teuchos::ParameterList> solverParametersPtr){
945940
solverParametersPtr->sublist("Printing").set("Output Precision", 15);
946941
solverParametersPtr->sublist("Printing").set("Output Information", NOX::Utils::Error + NOX::Utils::Warning + NOX::Utils::OuterIteration + NOX::Utils::InnerIteration);
947-
if(!_generateoutput){
948-
solverParametersPtr->sublist("Printing").set("Output Stream", _output);
949-
solverParametersPtr->sublist("Printing").set("Error Stream", _output);
950-
}
942+
solverParametersPtr->sublist("Printing").set("Output Stream", _output);
943+
solverParametersPtr->sublist("Printing").set("Error Stream", _output);
951944
}
952945
/**
953946
* \brief copy solution from solver to the algLoopSolution

SimulationRuntime/cpp/Solver/Nox/NoxLapackInterface.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
//! Constructor
1212
NoxLapackInterface::NoxLapackInterface(INonLinearAlgLoop *algLoop)//second argument unnecessary. Just initialize _lambda to 1.0
1313
:_algLoop(algLoop)
14-
,_generateoutput(false)
1514
,_useDomainScaling(false)
1615
,_useFunctionValueScaling(true)
1716
,_yScale(NULL)

0 commit comments

Comments
 (0)