Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
dynamic
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
MostafaMollaali
dynamic
Commits
86e626db
Commit
86e626db
authored
5 years ago
by
renchao.lu
Committed by
Dmitri Naumov
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[CL] Create class Reaction Rate.
parent
6be6a186
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ChemistryLib/PhreeqcIOData/ReactionRate.cpp
+46
-0
46 additions, 0 deletions
ChemistryLib/PhreeqcIOData/ReactionRate.cpp
ChemistryLib/PhreeqcIOData/ReactionRate.h
+39
-0
39 additions, 0 deletions
ChemistryLib/PhreeqcIOData/ReactionRate.h
with
85 additions
and
0 deletions
ChemistryLib/PhreeqcIOData/ReactionRate.cpp
0 → 100644
+
46
−
0
View file @
86e626db
/**
* \copyright
* Copyright (c) 2012-2019, OpenGeoSys Community (http://www.opengeosys.org)
* Distributed under a Modified BSD License.
* See accompanying file LICENSE.txt or
* http://www.opengeosys.org/project/license
*
*/
#include
"ReactionRate.h"
#include
"BaseLib/ConfigTreeUtil.h"
namespace
ChemistryLib
{
std
::
vector
<
ReactionRate
>
createReactionRates
(
boost
::
optional
<
BaseLib
::
ConfigTree
>
const
&
config
)
{
if
(
!
config
)
return
{};
std
::
vector
<
ReactionRate
>
reaction_rates
;
for
(
auto
const
&
rate_config
:
//! \ogs_file_param{prj__chemical_system__rates__rate}
config
->
getConfigSubtreeList
(
"rate"
))
{
auto
kinetic_reactant
=
//! \ogs_file_param{prj__chemical_system__rates__rate__kinetic_reactant}
rate_config
.
getConfigParameter
<
std
::
string
>
(
"kinetic_reactant"
);
std
::
vector
<
std
::
string
>
expression_statements
;
auto
const
expression_config
=
//! \ogs_file_param{prj__chemical_system__rates__rate__expression}
rate_config
.
getConfigSubtree
(
"expression"
);
for
(
auto
const
&
expression_statement
:
//! \ogs_file_param{prj__chemical_system__rates__rate__expression__statement}
expression_config
.
getConfigParameterList
<
std
::
string
>
(
"statement"
))
expression_statements
.
push_back
(
expression_statement
);
reaction_rates
.
emplace_back
(
std
::
move
(
kinetic_reactant
),
std
::
move
(
expression_statements
));
}
return
reaction_rates
;
}
}
// namespace ChemistryLib
This diff is collapsed.
Click to expand it.
ChemistryLib/PhreeqcIOData/ReactionRate.h
0 → 100644
+
39
−
0
View file @
86e626db
/**
* \copyright
* Copyright (c) 2012-2019, OpenGeoSys Community (http://www.opengeosys.org)
* Distributed under a Modified BSD License.
* See accompanying file LICENSE.txt or
* http://www.opengeosys.org/project/license
*
*/
#pragma once
#include
<boost/optional/optional.hpp>
#include
<string>
#include
<vector>
namespace
BaseLib
{
class
ConfigTree
;
}
namespace
ChemistryLib
{
struct
ReactionRate
{
ReactionRate
(
std
::
string
kinetic_reactant_
,
std
::
vector
<
std
::
string
>
expression_statements_
)
:
kinetic_reactant
(
std
::
move
(
kinetic_reactant_
)),
expression_statements
(
std
::
move
(
expression_statements_
))
{
}
std
::
string
const
kinetic_reactant
;
std
::
vector
<
std
::
string
>
const
expression_statements
;
};
std
::
vector
<
ReactionRate
>
createReactionRates
(
boost
::
optional
<
BaseLib
::
ConfigTree
>
const
&
config
);
}
// namespace ChemistryLib
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