Skip to content

Commit 327c2be

Browse files
committed
feat: adds disableOutTime to turn off timestep printing to the console. Useful for the MATLAB wrapper
1 parent 0ac1e8e commit 327c2be

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

docs/inputs.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -596,6 +596,7 @@ The list of possible options is:
596596
The new stationary solver in MoorDyn-C is more stable and more precise than the dynamic solver,
597597
but it can take longer to reach equilibrium.
598598
- disableOutput (0): Disables some console and file outputs to improve runtime.
599+
- disableOutTime (0): Disables the printing of the current timestep to the console, useful for the MATLAB wrapper
599600

600601
A note about time steps in MoorDyn-C: The internal time step is first taken from the dtM option. If
601602
no CFL factor is provided, then the user provided time step is used to calculate CFL and MoorDyn-C
@@ -631,6 +632,7 @@ The following MoorDyn-C options are not supported by MoorDyn-F:
631632
- StatDynFricScale: Same as MC in MoorDyn-F.
632633
- ICgenDynamic: MoorDyn-F does not have a stationary solver for initial conditions
633634
- disableOutput: MoorDyn-F output verbosity is controlled by OpenFAST
635+
- disableOutTime: MoorDyn-F output verbosity is controlled by OpenFAST
634636

635637
The following options from MoorDyn-F are not supported by MoorDyn-C:
636638

source/MoorDyn2.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,7 @@ moordyn::MoorDyn::Step(const double* x,
641641
LOGDBG << "t = " << t << "s \r";
642642
std::cout << std::defaultfloat << setprecision(default_precision);
643643

644-
cout << "\rt = " << t << " " << flush;
644+
if (!disableOutTime) cout << "\rt = " << t << " " << flush;
645645
}
646646

647647
if (dt <= 0) {
@@ -2220,6 +2220,15 @@ moordyn::MoorDyn::readOptionsLine(vector<string>& in_txt, int i)
22202220
LOGWRN << "Unrecognized disableOutput value "
22212221
<< std::quoted(value) << ". Should be 0 or 1" << endl;
22222222
}
2223+
} else if (name == "disableouttime"){
2224+
if (value == "1") {
2225+
disableOutTime = true;
2226+
} else if (value == "0") {
2227+
disableOutTime = false;
2228+
} else {
2229+
LOGWRN << "Unrecognized disableOutTime value "
2230+
<< std::quoted(value) << ". Should be 0 or 1" << endl;
2231+
}
22232232
} else
22242233
LOGWRN << "Warning: Unrecognized option '" << name << "'" << endl;
22252234
}

source/MoorDyn2.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -640,6 +640,9 @@ class MoorDyn final : public io::IO
640640
/// Disabled writing to output files or console when running
641641
bool disableOutput = false;
642642

643+
/// Disabledtime updates to console when running (for MATLAB wrapper)
644+
bool disableOutTime = false;
645+
643646
/// main output file
644647
ofstream outfileMain;
645648

0 commit comments

Comments
 (0)