Skip to content

Commit 0f2afd5

Browse files
committed
docs: add disable output to the docs and options list
1 parent aaadbc8 commit 0f2afd5

File tree

2 files changed

+39
-29
lines changed

2 files changed

+39
-29
lines changed

docs/inputs.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -595,6 +595,7 @@ The list of possible options is:
595595
If this is enabled initial conditions are calculated with scaled drag according to CdScaleIC.
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.
598+
- disableOutput (0): Disables some console and file outputs to improve runtime.
598599

599600
A note about time steps in MoorDyn-C: The internal time step is first taken from the dtM option. If
600601
no CFL factor is provided, then the user provided time step is used to calculate CFL and MoorDyn-C
@@ -629,6 +630,7 @@ The following MoorDyn-C options are not supported by MoorDyn-F:
629630
- FricDamp: Same as CV in MoorDyn-F.
630631
- StatDynFricScale: Same as MC in MoorDyn-F.
631632
- ICgenDynamic: MoorDyn-F does not have a stationary solver for initial conditions
633+
- disableOutput: MoorDyn-F output verbosity is controlled by OpenFAST
632634

633635
The following options from MoorDyn-F are not supported by MoorDyn-C:
634636

source/MoorDyn2.cpp

Lines changed: 37 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2132,87 +2132,95 @@ moordyn::MoorDyn::readOptionsLine(vector<string>& in_txt, int i)
21322132

21332133
// DT is old way, should phase out
21342134
if ((name == "dtM") || (name == "DT"))
2135-
dtM0 = atof(entries[0].c_str());
2135+
dtM0 = atof(value.c_str());
21362136
else if ((name == "CFL") || (name == "cfl"))
2137-
cfl = atof(entries[0].c_str());
2137+
cfl = atof(value.c_str());
21382138
else if (name == "writeLog") {
21392139
// This was actually already did, so we do not need to do that again
21402140
// But we really want to have this if to avoid showing a warning for
21412141
// Unrecognized option writeLog
2142-
// env->writeLog = atoi(entries[0].c_str());
2142+
// env->writeLog = atoi(value.c_str());
21432143
} else if (name == "tScheme") {
21442144
moordyn::error_id err = MOORDYN_SUCCESS;
21452145
string err_msg;
21462146
try {
2147-
_t_integrator = create_time_scheme(entries[0], _log, waves);
2147+
_t_integrator = create_time_scheme(value, _log, waves);
21482148
}
21492149
MOORDYN_CATCHER(err, err_msg);
21502150
if (err != MOORDYN_SUCCESS) {
21512151
LOGWRN << "Defaulting to RK2 time integration";
21522152
LOGERR << err_msg << endl;
21532153
}
21542154
} else if ((name == "g") || (name == "gravity"))
2155-
env->g = atof(entries[0].c_str());
2155+
env->g = atof(value.c_str());
21562156
else if ((name == "Rho") || (name == "rho") || (name == "WtrDnsty"))
2157-
env->rho_w = atof(entries[0].c_str());
2157+
env->rho_w = atof(value.c_str());
21582158
else if (name == "WtrDpth")
2159-
env->WtrDpth = atof(entries[0].c_str());
2159+
env->WtrDpth = atof(value.c_str());
21602160
else if ((name == "kBot") || (name == "kbot") || (name == "kb"))
2161-
env->kb = atof(entries[0].c_str());
2161+
env->kb = atof(value.c_str());
21622162
else if ((name == "cBot") || (name == "cbot") || (name == "cb"))
2163-
env->cb = atof(entries[0].c_str());
2163+
env->cb = atof(value.c_str());
21642164
else if ((name == "dtIC") || (name == "ICdt"))
2165-
ICdt = atof(entries[0].c_str());
2165+
ICdt = atof(value.c_str());
21662166
else if ((name == "TmaxIC") || (name == "ICTmax"))
2167-
ICTmax = atof(entries[0].c_str());
2167+
ICTmax = atof(value.c_str());
21682168
else if ((name == "CdScaleIC") || (name == "ICDfac"))
2169-
ICDfac = atof(entries[0].c_str());
2169+
ICDfac = atof(value.c_str());
21702170
else if ((name == "threshIC") || (name == "ICthresh"))
2171-
ICthresh = atof(entries[0].c_str());
2171+
ICthresh = atof(value.c_str());
21722172
else if ((name == "genDynamicIC") || (name == "ICgenDynamic"))
2173-
ICgenDynamic = bool(atof(entries[0].c_str()));
2173+
ICgenDynamic = bool(atof(value.c_str()));
21742174
else if ((name == "fileIC") || (name == "ICfile"))
2175-
ICfile = entries[0];
2175+
ICfile = value;
21762176
else if (name == "WaveKin") {
2177-
WaveKinTemp = (waves::waves_settings)stoi(entries[0]);
2177+
WaveKinTemp = (waves::waves_settings)stoi(value);
21782178
if ((WaveKinTemp < waves::WAVES_NONE) ||
21792179
(WaveKinTemp > waves::WAVES_SUM_COMPONENTS_NODE))
21802180
LOGWRN << "Unknown WaveKin option value " << WaveKinTemp << endl;
21812181
} else if (name == "dtWave")
2182-
env->waterKinOptions.dtWave = stof(entries[0]);
2182+
env->waterKinOptions.dtWave = stof(value);
21832183
else if (name == "Currents") {
2184-
auto current_mode = (waves::currents_settings)stoi(entries[0]);
2184+
auto current_mode = (waves::currents_settings)stoi(value);
21852185
env->waterKinOptions.currentMode = current_mode;
21862186
if ((current_mode < waves::CURRENTS_NONE) ||
21872187
(current_mode > waves::CURRENTS_4D))
21882188
LOGWRN << "Unknown Currents option value " << current_mode << endl;
21892189
} else if (name == "UnifyCurrentGrid") {
2190-
if (entries[0] == "1") {
2190+
if (value == "1") {
21912191
env->waterKinOptions.unifyCurrentGrid = true;
2192-
} else if (entries[0] == "0") {
2192+
} else if (value == "0") {
21932193
env->waterKinOptions.unifyCurrentGrid = false;
21942194
} else {
21952195
LOGWRN << "Unrecognized UnifyCurrentGrid value "
2196-
<< std::quoted(entries[1]) << ". Should be 0 or 1" << endl;
2196+
<< std::quoted(value) << ". Should be 0 or 1" << endl;
21972197
}
21982198
} else if (name == "WriteUnits")
2199-
env->WriteUnits = atoi(entries[0].c_str());
2199+
env->WriteUnits = atoi(value.c_str());
22002200
else if (name == "FrictionCoefficient")
2201-
env->FrictionCoefficient = atof(entries[0].c_str());
2201+
env->FrictionCoefficient = atof(value.c_str());
22022202
else if (name == "FricDamp")
2203-
env->FricDamp = atof(entries[0].c_str());
2203+
env->FricDamp = atof(value.c_str());
22042204
else if (name == "StatDynFricScale")
2205-
env->StatDynFricScale = atof(entries[0].c_str());
2205+
env->StatDynFricScale = atof(value.c_str());
22062206
// output writing period (0 for at every call)
22072207
else if (name == "dtOut")
2208-
dtOut = atof(entries[0].c_str());
2208+
dtOut = atof(value.c_str());
22092209
else if (name == "SeafloorFile") {
22102210
env->SeafloorMode = seafloor_settings::SEAFLOOR_3D;
22112211
this->seafloor = make_shared<moordyn::Seafloor>(_log);
2212-
std::string filepath = entries[0];
2212+
std::string filepath = value;
22132213
this->seafloor->setup(env, filepath);
2214-
}
2215-
else
2214+
} else if (name == "disableOutput"){
2215+
if (value == "1") {
2216+
disableOutput = true;
2217+
} else if (value == "0") {
2218+
disableOutput = false;
2219+
} else {
2220+
LOGWRN << "Unrecognized disableOutput value "
2221+
<< std::quoted(value) << ". Should be 0 or 1" << endl;
2222+
}
2223+
} else
22162224
LOGWRN << "Warning: Unrecognized option '" << name << "'" << endl;
22172225
}
22182226

0 commit comments

Comments
 (0)