Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
ogs-feliks
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
Feliks Kiszkurno
ogs-feliks
Commits
bf802e4a
Commit
bf802e4a
authored
10 years ago
by
Dmitri Naumov
Browse files
Options
Downloads
Patches
Plain Diff
[PL] Split ProcessVariable.cpp from header.
parent
ef565f88
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ProcessLib/ProcessVariable.cpp
+108
-0
108 additions, 0 deletions
ProcessLib/ProcessVariable.cpp
ProcessLib/ProcessVariable.h
+8
-80
8 additions, 80 deletions
ProcessLib/ProcessVariable.h
with
116 additions
and
80 deletions
ProcessLib/ProcessVariable.cpp
0 → 100644
+
108
−
0
View file @
bf802e4a
/**
* \copyright
* Copyright (c) 2012-2014, 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
<boost/property_tree/ptree.hpp>
#include
"logog/include/logog.hpp"
#include
"GeoLib/GEOObjects.h"
#include
"MeshLib/Mesh.h"
#include
"BoundaryCondition.h"
#include
"InitialCondition.h"
#include
"ProcessVariable.h"
namespace
ProcessLib
{
ProcessVariable
::
ProcessVariable
(
ConfigTree
const
&
config
,
MeshLib
::
Mesh
const
&
mesh
,
GeoLib
::
GEOObjects
const
&
geometries
)
:
_name
(
config
.
get
<
std
::
string
>
(
"name"
)),
_mesh
(
mesh
)
{
DBUG
(
"Constructing process variable %s"
,
this
->
_name
.
c_str
());
// Initial condition
{
auto
const
&
ic_config
=
config
.
find
(
"initial_condition"
);
if
(
ic_config
==
config
.
not_found
())
INFO
(
"No initial condition found."
);
std
::
string
const
type
=
config
.
get
<
std
::
string
>
(
"initial_condition.type"
);
if
(
type
==
"Uniform"
)
{
_initial_condition
=
new
UniformInitialCondition
(
ic_config
->
second
);
}
else
{
ERR
(
"Unknown type of the initial condition."
);
}
}
// Boundary conditions
{
auto
const
&
bcs_config
=
config
.
find
(
"boundary_conditions"
);
if
(
bcs_config
==
config
.
not_found
())
INFO
(
"No boundary conditions found."
);
for
(
auto
const
&
bc_iterator
:
bcs_config
->
second
)
{
ConfigTree
const
&
bc_config
=
bc_iterator
.
second
;
// Find corresponding GeoObject
std
::
string
const
geometry_name
=
bc_config
.
get
<
std
::
string
>
(
"geometry"
);
std
::
string
const
patch_name
=
bc_config
.
get
<
std
::
string
>
(
"patch"
);
// TODO Currently only Polylines are supported for the boundary
// conditions.
GeoLib
::
GeoObject
const
*
const
geometry
=
geometries
.
getGeoObject
(
geometry_name
,
GeoLib
::
GEOTYPE
::
POLYLINE
,
patch_name
);
DBUG
(
"Found geometry type
\"
%s
\"
"
,
GeoLib
::
convertGeoTypeToString
(
geometry
->
getGeoType
()).
c_str
());
// Construct type dependent boundary condition
std
::
string
const
type
=
bc_config
.
get
<
std
::
string
>
(
"type"
);
if
(
type
==
"UniformDirichlet"
)
{
_boundary_conditions
.
emplace_back
(
new
UniformDirichletBoundaryCondition
(
geometry
,
bc_config
));
}
else
{
ERR
(
"Unknown type
\'
%s
\'
of the boundary condition."
,
type
.
c_str
());
}
}
}
}
ProcessVariable
::~
ProcessVariable
()
{
delete
_initial_condition
;
for
(
auto
p
:
_boundary_conditions
)
delete
p
;
}
std
::
string
const
&
ProcessVariable
::
getName
()
const
{
return
_name
;
}
}
// namespace ProcessLib
This diff is collapsed.
Click to expand it.
ProcessLib/ProcessVariable.h
+
8
−
80
View file @
bf802e4a
...
@@ -11,13 +11,15 @@
...
@@ -11,13 +11,15 @@
#define PROCESS_LIB_PROCESS_VARIABLE_H_
#define PROCESS_LIB_PROCESS_VARIABLE_H_
#include
<boost/property_tree/ptree.hpp>
#include
<boost/property_tree/ptree.hpp>
#include
"logog/include/logog.hpp"
#include
"GeoLib/GEOObjects.h"
#include
"GeoLib/GEOObjects.h"
#include
"MeshLib/Mesh.h"
#include
"MeshLib/Mesh.h"
#include
"BoundaryCondition.h"
namespace
ProcessLib
#include
"InitialCondition.h"
{
class
BoundaryCondition
;
class
InitialCondition
;
}
namespace
ProcessLib
namespace
ProcessLib
{
{
...
@@ -29,85 +31,11 @@ class ProcessVariable
...
@@ -29,85 +31,11 @@ class ProcessVariable
using
ConfigTree
=
boost
::
property_tree
::
ptree
;
using
ConfigTree
=
boost
::
property_tree
::
ptree
;
public:
public:
ProcessVariable
(
ConfigTree
const
&
config
,
MeshLib
::
Mesh
const
&
mesh
,
ProcessVariable
(
ConfigTree
const
&
config
,
MeshLib
::
Mesh
const
&
mesh
,
GeoLib
::
GEOObjects
const
&
geometries
)
GeoLib
::
GEOObjects
const
&
geometries
);
:
_name
(
config
.
get
<
std
::
string
>
(
"name"
)),
_mesh
(
mesh
)
{
DBUG
(
"Constructing process variable %s"
,
this
->
_name
.
c_str
());
// Initial condition
{
auto
const
&
ic_config
=
config
.
find
(
"initial_condition"
);
if
(
ic_config
==
config
.
not_found
())
INFO
(
"No initial condition found."
);
std
::
string
const
type
=
config
.
get
<
std
::
string
>
(
"initial_condition.type"
);
if
(
type
==
"Uniform"
)
{
_initial_condition
=
new
UniformInitialCondition
(
ic_config
->
second
);
}
else
{
ERR
(
"Unknown type of the initial condition."
);
}
}
// Boundary conditions
{
auto
const
&
bcs_config
=
config
.
find
(
"boundary_conditions"
);
if
(
bcs_config
==
config
.
not_found
())
INFO
(
"No boundary conditions found."
);
for
(
auto
const
&
bc_iterator
:
bcs_config
->
second
)
{
ConfigTree
const
&
bc_config
=
bc_iterator
.
second
;
// Find corresponding GeoObject
std
::
string
const
geometry_name
=
bc_config
.
get
<
std
::
string
>
(
"geometry"
);
std
::
string
const
patch_name
=
bc_config
.
get
<
std
::
string
>
(
"patch"
);
// TODO Currently only Polylines are supported for the boundary
// conditions.
GeoLib
::
GeoObject
const
*
const
geometry
=
geometries
.
getGeoObject
(
geometry_name
,
GeoLib
::
GEOTYPE
::
POLYLINE
,
patch_name
);
// Construct type dependent boundary condition
std
::
string
const
type
=
bc_config
.
get
<
std
::
string
>
(
"type"
);
if
(
type
==
"UniformDirichlet"
)
{
_boundary_conditions
.
emplace_back
(
new
UniformDirichletBoundaryCondition
(
geometry
,
bc_config
));
}
else
{
ERR
(
"Unknown type
\'
%s
\'
of the boundary condition."
,
type
.
c_str
());
}
}
}
}
~
ProcessVariable
()
{
delete
_initial_condition
;
for
(
auto
p
:
_boundary_conditions
)
~
ProcessVariable
();
delete
p
;
}
std
::
string
const
&
getName
()
const
std
::
string
const
&
getName
()
const
;
{
return
_name
;
}
private:
private:
std
::
string
const
_name
;
std
::
string
const
_name
;
...
...
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