Skip to content
Snippets Groups Projects
Commit 5e7fb64f authored by wenqing's avatar wenqing
Browse files

[Coupling] Dropped the changes in uniqueInsert.h

parent bb42c87f
No related branches found
No related tags found
No related merge requests found
...@@ -27,20 +27,6 @@ void uniquePushBack(Container& container, typename Container::value_type const& ...@@ -27,20 +27,6 @@ void uniquePushBack(Container& container, typename Container::value_type const&
container.push_back(element); container.push_back(element);
} }
//! Inserts the given \c key with the given \c value into the \c map if an entry with the
//! given \c key does not yet exist; otherwise an \c error_message is printed and the
//! program is aborted.
template<typename Map, typename Key, typename Value>
void insertMapIfKeyUniqueElseError(
Map& map, Key const& key, Value&& value,
std::string const& error_message)
{
auto const inserted = map.emplace(key, std::forward<Value>(value));
if (!inserted.second) { // insertion failed, i.e., key already exists
OGS_FATAL("Failed insert %s. Key already exists.",
error_message.c_str());
}
}
//! Inserts the given \c key with the given \c value into the \c map if an entry with the //! Inserts the given \c key with the given \c value into the \c map if an entry with the
//! given \c key does not yet exist; otherwise an \c error_message is printed and the //! given \c key does not yet exist; otherwise an \c error_message is printed and the
......
/** /**
* \copyright * \copyright
* Copyright (c) 2012-2016, OpenGeoSys Community (http://www.opengeosys.org) * Copyright (c) 2012-2017, OpenGeoSys Community (http://www.opengeosys.org)
* Distributed under a Modified BSD License. * Distributed under a Modified BSD License.
* See accompanying file LICENSE.txt or * See accompanying file LICENSE.txt or
* http://www.opengeosys.org/project/license * http://www.opengeosys.org/project/license
...@@ -10,12 +10,12 @@ ...@@ -10,12 +10,12 @@
* Created on December 14, 2016, 3:13 PM * Created on December 14, 2016, 3:13 PM
*/ */
#ifndef OGS_PROCESS_TYPE_H
#define OGS_PROCESS_TYPE_H #pragma once
namespace ProcessLib namespace ProcessLib
{ {
enum class ProcessType enum ProcessType
{ {
GroundwaterFlowProcess, GroundwaterFlowProcess,
LiquidFlowProcess, LiquidFlowProcess,
...@@ -28,4 +28,3 @@ enum class ProcessType ...@@ -28,4 +28,3 @@ enum class ProcessType
TESProcess TESProcess
}; };
} }
#endif /* OGS_PROCESS_TYPE_H */
...@@ -529,7 +529,7 @@ bool UncoupledProcessesTimeLoop::setCoupledSolutions() ...@@ -529,7 +529,7 @@ bool UncoupledProcessesTimeLoop::setCoupledSolutions()
// Id of the coupled process: // Id of the coupled process:
const std::size_t c_id = found_item - _per_process_data.begin(); const std::size_t c_id = found_item - _per_process_data.begin();
BaseLib::insertMapIfKeyUniqueElseError( BaseLib::insertIfKeyUniqueElseError(
coupled_xs, it->first, *_process_solutions[c_id], coupled_xs, it->first, *_process_solutions[c_id],
"global_coupled_x"); "global_coupled_x");
} }
......
...@@ -34,16 +34,16 @@ getPreviousLocalSolutionsOfCoupledProcesses( ...@@ -34,16 +34,16 @@ getPreviousLocalSolutionsOfCoupledProcesses(
if (prevous_time_x) if (prevous_time_x)
{ {
auto const local_coupled_x0 = prevous_time_x->get(indices); auto const local_coupled_x0 = prevous_time_x->get(indices);
BaseLib::insertMapIfKeyUniqueElseError(local_coupled_xs0, it->first, BaseLib::insertIfKeyUniqueElseError(local_coupled_xs0, it->first,
local_coupled_x0, local_coupled_x0,
"local_coupled_x0"); "local_coupled_x0");
} }
else else
{ {
const std::vector<double> local_coupled_x0; const std::vector<double> local_coupled_x0;
BaseLib::insertMapIfKeyUniqueElseError(local_coupled_xs0, it->first, BaseLib::insertIfKeyUniqueElseError(local_coupled_xs0, it->first,
local_coupled_x0, local_coupled_x0,
"local_coupled_x0"); "local_coupled_x0");
} }
it++; it++;
} }
...@@ -62,7 +62,7 @@ getCurrentLocalSolutionsOfCoupledProcesses( ...@@ -62,7 +62,7 @@ getCurrentLocalSolutionsOfCoupledProcesses(
{ {
auto const coupled_x = it->second; auto const coupled_x = it->second;
auto const local_coupled_x = coupled_x.get(indices); auto const local_coupled_x = coupled_x.get(indices);
BaseLib::insertMapIfKeyUniqueElseError( BaseLib::insertIfKeyUniqueElseError(
local_coupled_xs, it->first, local_coupled_x, "local_coupled_x"); local_coupled_xs, it->first, local_coupled_x, "local_coupled_x");
it++; it++;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment