Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
ogs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Yuhao Liu
ogs
Commits
42caa8b0
Commit
42caa8b0
authored
8 years ago
by
Christoph Lehmann
Committed by
Dmitri Naumov
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Enforce uniqueness of parameter and process variable names
parent
00c790fa
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Applications/ApplicationsLib/ProjectData.cpp
+18
-5
18 additions, 5 deletions
Applications/ApplicationsLib/ProjectData.cpp
with
18 additions
and
5 deletions
Applications/ApplicationsLib/ProjectData.cpp
+
18
−
5
View file @
42caa8b0
...
@@ -14,6 +14,7 @@
...
@@ -14,6 +14,7 @@
#include
"ProjectData.h"
#include
"ProjectData.h"
#include
<algorithm>
#include
<algorithm>
#include
<set>
#include
<logog/include/logog.hpp>
#include
<logog/include/logog.hpp>
...
@@ -227,15 +228,20 @@ void ProjectData::parseProcessVariables(
...
@@ -227,15 +228,20 @@ void ProjectData::parseProcessVariables(
return
;
return
;
}
}
// _process_variables.reserve(process_variables_config.size())
;
std
::
set
<
std
::
string
>
names
;
for
(
auto
var_config
for
(
auto
var_config
//! \ogs_file_param{prj__process_variables__process_variable}
//! \ogs_file_param{prj__process_variables__process_variable}
:
process_variables_config
.
getConfigSubtreeList
(
"process_variable"
))
:
process_variables_config
.
getConfigSubtreeList
(
"process_variable"
))
{
{
// TODO Extend to referenced meshes.
// TODO Extend to referenced meshes.
_process_variables
.
emplace_back
(
var_config
,
*
_mesh_vec
[
0
],
*
_geoObjects
,
auto
pv
=
ProcessLib
::
ProcessVariable
{
var_config
,
*
_mesh_vec
[
0
],
_parameters
);
*
_geoObjects
,
_parameters
};
if
(
!
names
.
insert
(
pv
.
getName
()).
second
)
OGS_FATAL
(
"A process variable with name `%s' already exists."
,
pv
.
getName
().
c_str
());
_process_variables
.
push_back
(
std
::
move
(
pv
));
}
}
}
}
...
@@ -243,13 +249,20 @@ void ProjectData::parseParameters(BaseLib::ConfigTree const& parameters_config)
...
@@ -243,13 +249,20 @@ void ProjectData::parseParameters(BaseLib::ConfigTree const& parameters_config)
{
{
using
namespace
ProcessLib
;
using
namespace
ProcessLib
;
std
::
set
<
std
::
string
>
names
;
DBUG
(
"Reading parameters:"
);
DBUG
(
"Reading parameters:"
);
for
(
auto
parameter_config
:
for
(
auto
parameter_config
:
//! \ogs_file_param{prj__parameters__parameter}
//! \ogs_file_param{prj__parameters__parameter}
parameters_config
.
getConfigSubtreeList
(
"parameter"
))
parameters_config
.
getConfigSubtreeList
(
"parameter"
))
{
{
_parameters
.
push_back
(
auto
p
=
ProcessLib
::
createParameter
(
parameter_config
,
_mesh_vec
,
_curves
));
ProcessLib
::
createParameter
(
parameter_config
,
_mesh_vec
,
_curves
);
if
(
!
names
.
insert
(
p
->
name
).
second
)
OGS_FATAL
(
"A parameter with name `%s' already exists."
,
p
->
name
.
c_str
());
_parameters
.
push_back
(
std
::
move
(
p
));
}
}
for
(
auto
&
parameter
:
_parameters
)
for
(
auto
&
parameter
:
_parameters
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment