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
fc36bb51
Commit
fc36bb51
authored
7 years ago
by
Tom Fischer
Browse files
Options
Downloads
Patches
Plain Diff
[PL/SourceTerms] Put SourceTerms in ProcessVars.
parent
71018e22
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
ProcessLib/CMakeLists.txt
+1
-0
1 addition, 0 deletions
ProcessLib/CMakeLists.txt
ProcessLib/ProcessVariable.cpp
+64
-2
64 additions, 2 deletions
ProcessLib/ProcessVariable.cpp
ProcessLib/ProcessVariable.h
+8
-0
8 additions, 0 deletions
ProcessLib/ProcessVariable.h
with
73 additions
and
2 deletions
ProcessLib/CMakeLists.txt
+
1
−
0
View file @
fc36bb51
...
@@ -21,6 +21,7 @@ APPEND_SOURCE_FILES(SOURCES Parameter)
...
@@ -21,6 +21,7 @@ APPEND_SOURCE_FILES(SOURCES Parameter)
APPEND_SOURCE_FILES
(
SOURCES PhaseField
)
APPEND_SOURCE_FILES
(
SOURCES PhaseField
)
APPEND_SOURCE_FILES
(
SOURCES RichardsFlow
)
APPEND_SOURCE_FILES
(
SOURCES RichardsFlow
)
APPEND_SOURCE_FILES
(
SOURCES SmallDeformation
)
APPEND_SOURCE_FILES
(
SOURCES SmallDeformation
)
APPEND_SOURCE_FILES
(
SOURCES SourceTerms
)
APPEND_SOURCE_FILES
(
SOURCES TES
)
APPEND_SOURCE_FILES
(
SOURCES TES
)
APPEND_SOURCE_FILES
(
SOURCES ThermoMechanics
)
APPEND_SOURCE_FILES
(
SOURCES ThermoMechanics
)
APPEND_SOURCE_FILES
(
SOURCES TwoPhaseFlowWithPP
)
APPEND_SOURCE_FILES
(
SOURCES TwoPhaseFlowWithPP
)
...
...
This diff is collapsed.
Click to expand it.
ProcessLib/ProcessVariable.cpp
+
64
−
2
View file @
fc36bb51
...
@@ -33,7 +33,8 @@ ProcessVariable::ProcessVariable(
...
@@ -33,7 +33,8 @@ ProcessVariable::ProcessVariable(
//! \ogs_file_param{prj__process_variables__process_variable__initial_condition}
//! \ogs_file_param{prj__process_variables__process_variable__initial_condition}
config
.
getConfigParameter
<
std
::
string
>
(
"initial_condition"
),
config
.
getConfigParameter
<
std
::
string
>
(
"initial_condition"
),
parameters
,
_n_components
)),
parameters
,
_n_components
)),
_bc_builder
(
std
::
make_unique
<
BoundaryConditionBuilder
>
())
_bc_builder
(
std
::
make_unique
<
BoundaryConditionBuilder
>
()),
_source_term_builder
(
std
::
make_unique
<
SourceTermBuilder
>
())
{
{
DBUG
(
"Constructing process variable %s"
,
_name
.
c_str
());
DBUG
(
"Constructing process variable %s"
,
_name
.
c_str
());
...
@@ -82,6 +83,49 @@ ProcessVariable::ProcessVariable(
...
@@ -82,6 +83,49 @@ ProcessVariable::ProcessVariable(
}
else
{
}
else
{
INFO
(
"No boundary conditions found."
);
INFO
(
"No boundary conditions found."
);
}
}
// Source terms
//! \ogs_file_param{prj__process_variables__process_variable__source_terms}
if
(
auto
sts_config
=
config
.
getConfigSubtreeOptional
(
"source_terms"
))
{
for
(
auto
st_config
:
//! \ogs_file_param{prj__process_variables__process_variable__source_terms__source_term}
sts_config
->
getConfigSubtreeList
(
"source_term"
))
{
auto
const
geometrical_set_name
=
//! \ogs_file_param{prj__process_variables__process_variable__source_terms__source_term__geometrical_set}
st_config
.
getConfigParameter
<
std
::
string
>
(
"geometrical_set"
);
auto
const
geometry_name
=
//! \ogs_file_param{prj__process_variables__process_variable__source_terms__source_term__geometry}
st_config
.
getConfigParameter
<
std
::
string
>
(
"geometry"
);
GeoLib
::
GeoObject
const
*
const
geometry
=
geometries
.
getGeoObject
(
geometrical_set_name
,
geometry_name
);
if
(
!
geometry
)
OGS_FATAL
(
"No geometry with name `%s' has been found in the "
"geometrical set `%s'."
,
geometry_name
.
c_str
(),
geometrical_set_name
.
c_str
());
DBUG
(
"Found geometry type
\"
%s
\"
"
,
GeoLib
::
convertGeoTypeToString
(
geometry
->
getGeoType
()).
c_str
());
auto
component_id
=
//! \ogs_file_param{prj__process_variables__process_variable__source_terms__source_term__component}
st_config
.
getConfigParameterOptional
<
int
>
(
"component"
);
if
(
!
component_id
&&
_n_components
==
1
)
// default value for single component vars.
component_id
=
0
;
_source_term_configs
.
emplace_back
(
std
::
move
(
st_config
),
*
geometry
,
component_id
);
}
}
else
{
INFO
(
"No source terms found."
);
}
}
}
ProcessVariable
::
ProcessVariable
(
ProcessVariable
&&
other
)
ProcessVariable
::
ProcessVariable
(
ProcessVariable
&&
other
)
...
@@ -91,7 +135,9 @@ ProcessVariable::ProcessVariable(ProcessVariable&& other)
...
@@ -91,7 +135,9 @@ ProcessVariable::ProcessVariable(ProcessVariable&& other)
_shapefunction_order
(
other
.
_shapefunction_order
),
_shapefunction_order
(
other
.
_shapefunction_order
),
_initial_condition
(
std
::
move
(
other
.
_initial_condition
)),
_initial_condition
(
std
::
move
(
other
.
_initial_condition
)),
_bc_configs
(
std
::
move
(
other
.
_bc_configs
)),
_bc_configs
(
std
::
move
(
other
.
_bc_configs
)),
_bc_builder
(
std
::
move
(
other
.
_bc_builder
))
_bc_builder
(
std
::
move
(
other
.
_bc_builder
)),
_source_term_configs
(
std
::
move
(
other
.
_source_term_configs
)),
_source_term_builder
(
std
::
move
(
other
.
_source_term_builder
))
{
{
}
}
...
@@ -128,4 +174,20 @@ ProcessVariable::createBoundaryConditions(
...
@@ -128,4 +174,20 @@ ProcessVariable::createBoundaryConditions(
return
bcs
;
return
bcs
;
}
}
std
::
vector
<
std
::
unique_ptr
<
NodalSourceTerm
>>
ProcessVariable
::
createSourceTerms
(
const
NumLib
::
LocalToGlobalIndexMap
&
dof_table
,
const
int
variable_id
,
unsigned
const
integration_order
)
{
std
::
vector
<
std
::
unique_ptr
<
NodalSourceTerm
>>
source_terms
;
for
(
auto
&
config
:
_source_term_configs
)
source_terms
.
emplace_back
(
_source_term_builder
->
createSourceTerm
(
config
,
dof_table
,
_mesh
,
variable_id
,
integration_order
,
_shapefunction_order
));
return
source_terms
;
}
}
// namespace ProcessLib
}
// namespace ProcessLib
This diff is collapsed.
Click to expand it.
ProcessLib/ProcessVariable.h
+
8
−
0
View file @
fc36bb51
...
@@ -12,6 +12,8 @@
...
@@ -12,6 +12,8 @@
#include
"ProcessLib/BoundaryCondition/BoundaryCondition.h"
#include
"ProcessLib/BoundaryCondition/BoundaryCondition.h"
#include
"ProcessLib/BoundaryCondition/BoundaryConditionConfig.h"
#include
"ProcessLib/BoundaryCondition/BoundaryConditionConfig.h"
#include
"ProcessLib/Parameter/Parameter.h"
#include
"ProcessLib/Parameter/Parameter.h"
#include
"ProcessLib/SourceTerms/SourceTermConfig.h"
#include
"ProcessLib/SourceTerms/SourceTermBuilder.h"
namespace
MeshLib
namespace
MeshLib
{
{
...
@@ -53,6 +55,10 @@ public:
...
@@ -53,6 +55,10 @@ public:
unsigned
const
integration_order
,
unsigned
const
integration_order
,
std
::
vector
<
std
::
unique_ptr
<
ParameterBase
>>
const
&
parameters
);
std
::
vector
<
std
::
unique_ptr
<
ParameterBase
>>
const
&
parameters
);
std
::
vector
<
std
::
unique_ptr
<
NodalSourceTerm
>>
createSourceTerms
(
const
NumLib
::
LocalToGlobalIndexMap
&
dof_table
,
const
int
variable_id
,
unsigned
const
integration_order
);
Parameter
<
double
>
const
&
getInitialCondition
()
const
Parameter
<
double
>
const
&
getInitialCondition
()
const
{
{
return
_initial_condition
;
return
_initial_condition
;
...
@@ -87,6 +93,8 @@ private:
...
@@ -87,6 +93,8 @@ private:
std
::
vector
<
BoundaryConditionConfig
>
_bc_configs
;
std
::
vector
<
BoundaryConditionConfig
>
_bc_configs
;
std
::
unique_ptr
<
BoundaryConditionBuilder
>
_bc_builder
;
std
::
unique_ptr
<
BoundaryConditionBuilder
>
_bc_builder
;
std
::
vector
<
SourceTermConfig
>
_source_term_configs
;
std
::
unique_ptr
<
SourceTermBuilder
>
_source_term_builder
;
};
};
}
// namespace ProcessLib
}
// namespace ProcessLib
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