add arguments by const ref
This commit is contained in:
parent
e6280fc80d
commit
b68f5f1226
4
external/resinsight/LibCore/cvfTrace.cpp
vendored
4
external/resinsight/LibCore/cvfTrace.cpp
vendored
@ -72,7 +72,7 @@ namespace cvf {
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
/// Write debug text to console, DevStudio output window and file (future)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void Trace::show(String message)
|
||||
void Trace::show(const String& message)
|
||||
{
|
||||
showTraceOutput(message, true);
|
||||
}
|
||||
@ -124,7 +124,7 @@ void Trace::showFileLineNumber(const String& file, int line, const String& messa
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
/// Show the trace output in console and DevStudio output window
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void Trace::showTraceOutput(String text, bool addNewLine)
|
||||
void Trace::showTraceOutput(const String& text, bool addNewLine)
|
||||
{
|
||||
#ifdef WIN32
|
||||
AllocConsole();
|
||||
|
4
external/resinsight/LibCore/cvfTrace.h
vendored
4
external/resinsight/LibCore/cvfTrace.h
vendored
@ -51,12 +51,12 @@ namespace cvf {
|
||||
class Trace
|
||||
{
|
||||
public:
|
||||
static void show(String message);
|
||||
static void show(const String& message);
|
||||
static void show(const char* format, ...);
|
||||
static void showFileLineNumber(const String& file, int line, const String& message);
|
||||
|
||||
private:
|
||||
static void showTraceOutput(String text, bool addNewLine);
|
||||
static void showTraceOutput(const String& text, bool addNewLine);
|
||||
};
|
||||
|
||||
|
||||
|
@ -45,7 +45,10 @@ private:
|
||||
|
||||
void run_step(WellTestState& wtest_state, UDQState& udq_state, data::Solution& sol, data::Wells& well_data, data::GroupAndNetworkValues& group_nwrk_data, size_t report_step, EclipseIO& io);
|
||||
void run_step(WellTestState& wtest_state, UDQState& udq_state, data::Solution& sol, data::Wells& well_data, data::GroupAndNetworkValues& group_nwrk_data, size_t report_step, double dt, EclipseIO& io);
|
||||
void output(WellTestState& wtest_state, const UDQState& udq_state, size_t report_step, bool substep, double seconds_elapsed, const data::Solution& sol, const data::Wells& well_data, const data::GroupAndNetworkValues& group_data, EclipseIO& io);
|
||||
void output(const WellTestState& wtest_state, const UDQState& udq_state,
|
||||
size_t report_step, bool substep, double seconds_elapsed,
|
||||
const data::Solution& sol, const data::Wells& well_data,
|
||||
const data::GroupAndNetworkValues& group_data, EclipseIO& io);
|
||||
void simulate(data::Solution& sol, data::Wells& well_data, data::GroupAndNetworkValues& group_nwrk_data, size_t report_step, double seconds_elapsed, double time_step);
|
||||
|
||||
EclipseState state;
|
||||
|
@ -144,7 +144,10 @@ void msim::run_step(WellTestState& wtest_state, UDQState& udq_state, data::Solut
|
||||
|
||||
|
||||
|
||||
void msim::output(WellTestState& wtest_state, const UDQState& udq_state, size_t report_step, bool substep, double seconds_elapsed, const data::Solution& sol, const data::Wells& well_data, const data::GroupAndNetworkValues& group_nwrk_data, EclipseIO& io) {
|
||||
void msim::output(const WellTestState& wtest_state, const UDQState& udq_state,
|
||||
size_t report_step, bool substep, double seconds_elapsed,
|
||||
const data::Solution& sol, const data::Wells& well_data,
|
||||
const data::GroupAndNetworkValues& group_nwrk_data, EclipseIO& io) {
|
||||
RestartValue value(sol, well_data, group_nwrk_data, {});
|
||||
io.writeTimeStep(this->action_state,
|
||||
wtest_state,
|
||||
|
@ -69,7 +69,9 @@ namespace Opm {
|
||||
bool has(const std::string& name) const;
|
||||
const GCONSUMPGroup& get(const std::string& name) const;
|
||||
const GCONSUMPGroupProp get(const std::string& name, const SummaryState& st) const;
|
||||
void add(const std::string& name, const UDAValue& consumption_rate, const UDAValue& import_rate, const std::string network_node, double udq_undefined_arg, const UnitSystem& unit_system);
|
||||
void add(const std::string& name, const UDAValue& consumption_rate,
|
||||
const UDAValue& import_rate, const std::string& network_node,
|
||||
double udq_undefined_arg, const UnitSystem& unit_system);
|
||||
size_t size() const;
|
||||
|
||||
bool operator==(const GConSump& data) const;
|
||||
|
@ -64,7 +64,7 @@ private:
|
||||
std::vector<Branch> m_branches;
|
||||
std::vector<std::string> insert_indexed_node_names;
|
||||
std::map<std::string, Node> m_nodes;
|
||||
bool has_indexed_node_name(const std::string name) const;
|
||||
bool has_indexed_node_name(const std::string& name) const;
|
||||
void add_indexed_node_name(std::string name);
|
||||
};
|
||||
|
||||
|
@ -45,13 +45,15 @@ public:
|
||||
|
||||
struct RstRecord {
|
||||
|
||||
RstRecord(UDAControl control_arg, UDAValue value_arg, std::string wgname_arg)
|
||||
RstRecord(UDAControl control_arg, UDAValue value_arg,
|
||||
const std::string& wgname_arg)
|
||||
: control(control_arg)
|
||||
, value(value_arg)
|
||||
, wgname(wgname_arg)
|
||||
{};
|
||||
|
||||
RstRecord(UDAControl control_arg, UDAValue value_arg, std::string wgname_arg, Phase phase)
|
||||
RstRecord(UDAControl control_arg, UDAValue value_arg,
|
||||
const std::string& wgname_arg, Phase phase)
|
||||
: RstRecord(control_arg, value_arg, wgname_arg)
|
||||
{
|
||||
this->ig_phase = phase;
|
||||
|
@ -58,7 +58,9 @@ struct RstAction {
|
||||
};
|
||||
|
||||
|
||||
RstAction(const std::string& name_arg, int max_run_arg, int run_count_arg, double min_wait_arg, std::time_t start_time, std::time_t last_run, std::vector<Condition> conditions_arg);
|
||||
RstAction(const std::string& name_arg, int max_run_arg, int run_count_arg,
|
||||
double min_wait_arg, std::time_t start_time, std::time_t last_run,
|
||||
const std::vector<Condition>& conditions_arg);
|
||||
|
||||
std::string name;
|
||||
int max_run;
|
||||
|
@ -57,7 +57,9 @@ const GConSump::GCONSUMPGroupProp GConSump::get(const std::string& name, const S
|
||||
return prop;
|
||||
}
|
||||
|
||||
void GConSump::add(const std::string& name, const UDAValue& consumption_rate, const UDAValue& import_rate, const std::string network_node, double udq_undefined_arg, const UnitSystem& unit_system) {
|
||||
void GConSump::add(const std::string& name, const UDAValue& consumption_rate,
|
||||
const UDAValue& import_rate, const std::string& network_node,
|
||||
double udq_undefined_arg, const UnitSystem& unit_system) {
|
||||
|
||||
GConSump::GCONSUMPGroup& group = groups[name];
|
||||
|
||||
|
@ -169,7 +169,7 @@ void ExtNetwork::add_indexed_node_name(std::string name)
|
||||
this->insert_indexed_node_names.emplace_back(name);
|
||||
}
|
||||
|
||||
bool ExtNetwork::has_indexed_node_name(const std::string name) const
|
||||
bool ExtNetwork::has_indexed_node_name(const std::string& name) const
|
||||
{
|
||||
// Find given element in vector
|
||||
auto it = std::find(this->insert_indexed_node_names.begin(), this->insert_indexed_node_names.end(), name);
|
||||
|
@ -30,7 +30,10 @@ namespace SACN = Helpers::VectorItems::SACN;
|
||||
namespace ZACN = Helpers::VectorItems::ZACN;
|
||||
|
||||
|
||||
RstAction::RstAction(const std::string& name_arg, int max_run_arg, int run_count_arg, double min_wait_arg, std::time_t start_time_arg, std::time_t last_run_arg, std::vector<RstAction::Condition> conditions_arg)
|
||||
RstAction::RstAction(const std::string& name_arg, int max_run_arg,
|
||||
int run_count_arg, double min_wait_arg,
|
||||
std::time_t start_time_arg, std::time_t last_run_arg,
|
||||
const std::vector<RstAction::Condition>& conditions_arg)
|
||||
: name(name_arg)
|
||||
, max_run(max_run_arg)
|
||||
, run_count(run_count_arg)
|
||||
|
Loading…
Reference in New Issue
Block a user