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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MostafaMollaali
dynamic
Commits
fbba6551
Commit
fbba6551
authored
Oct 22, 2019
by
Tom Fischer
Browse files
Options
Downloads
Patches
Plain Diff
[PL/BC] Enable 'integral_measure' in Robin-BC.
parent
e0b8a687
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
ProcessLib/BoundaryCondition/RobinBoundaryCondition.cpp
+15
-5
15 additions, 5 deletions
ProcessLib/BoundaryCondition/RobinBoundaryCondition.cpp
ProcessLib/BoundaryCondition/RobinBoundaryConditionLocalAssembler.h
+15
-2
15 additions, 2 deletions
.../BoundaryCondition/RobinBoundaryConditionLocalAssembler.h
with
30 additions
and
7 deletions
ProcessLib/BoundaryCondition/RobinBoundaryCondition.cpp
+
15
−
5
View file @
fbba6551
...
...
@@ -25,11 +25,11 @@ std::unique_ptr<RobinBoundaryCondition> createRobinBoundaryCondition(
//! \ogs_file_param{prj__process_variables__process_variable__boundary_conditions__boundary_condition__type}
config
.
checkConfigParameter
(
"type"
,
"Robin"
);
if
(
bc_mesh
.
getDimension
()
+
1
!
=
global_dim
)
if
(
bc_mesh
.
getDimension
()
>
=
global_dim
)
{
OGS_FATAL
(
"The dimension (%d) of the given boundary mesh '%s' is not
by one
"
"
lower
than the bulk dimension (%d)."
,
"The dimension (%d) of the given boundary mesh '%s' is not
lower
"
"than the bulk dimension (%d)."
,
bc_mesh
.
getDimension
(),
bc_mesh
.
getName
().
c_str
(),
global_dim
);
}
...
...
@@ -40,10 +40,20 @@ std::unique_ptr<RobinBoundaryCondition> createRobinBoundaryCondition(
auto
const
&
alpha
=
ParameterLib
::
findParameter
<
double
>
(
alpha_name
,
parameters
,
1
,
&
bc_mesh
);
auto
const
&
u_0
=
ParameterLib
::
findParameter
<
double
>
(
u_0_name
,
parameters
,
1
,
&
bc_mesh
);
ParameterLib
::
Parameter
<
double
>
const
*
integral_measure
(
nullptr
);
if
(
global_dim
-
bc_mesh
.
getDimension
()
!=
1
)
{
//! \ogs_file_param{prj__process_variables__process_variable__boundary_conditions__boundary_condition__Robin__area_parameter}
auto
const
area_parameter_name
=
config
.
getConfigParameter
<
std
::
string
>
(
"area_parameter"
);
DBUG
(
"area parameter name '%s'"
,
area_parameter_name
.
c_str
());
integral_measure
=
&
ParameterLib
::
findParameter
<
double
>
(
area_parameter_name
,
parameters
,
1
,
&
bc_mesh
);
}
// In case of partitioned mesh the boundary could be empty, i.e. there is no
// boundary condition.
#ifdef USE_PETSC
...
...
@@ -61,7 +71,7 @@ std::unique_ptr<RobinBoundaryCondition> createRobinBoundaryCondition(
return
std
::
make_unique
<
RobinBoundaryCondition
>
(
integration_order
,
shapefunction_order
,
dof_table
,
variable_id
,
component_id
,
global_dim
,
bc_mesh
,
RobinBoundaryConditionData
{
alpha
,
u_0
});
RobinBoundaryConditionData
{
alpha
,
u_0
,
integral_measure
});
}
}
// namespace ProcessLib
This diff is collapsed.
Click to expand it.
ProcessLib/BoundaryCondition/RobinBoundaryConditionLocalAssembler.h
+
15
−
2
View file @
fbba6551
...
...
@@ -20,6 +20,7 @@ struct RobinBoundaryConditionData final
{
ParameterLib
::
Parameter
<
double
>
const
&
alpha
;
ParameterLib
::
Parameter
<
double
>
const
&
u_0
;
ParameterLib
::
Parameter
<
double
>
const
*
const
integral_measure
;
};
template
<
typename
ShapeFunction
,
typename
IntegrationMethod
,
...
...
@@ -64,17 +65,29 @@ public:
_data
.
u_0
.
getNodalValuesOnElement
(
Base
::
_element
,
t
)
.
template
topRows
<
ShapeFunction
::
MeshElement
::
n_all_nodes
>();
ParameterLib
::
SpatialPosition
position
;
position
.
setElementID
(
Base
::
_element
.
getID
());
for
(
unsigned
ip
=
0
;
ip
<
n_integration_points
;
++
ip
)
{
position
.
setIntegrationPoint
(
ip
);
auto
const
&
ip_data
=
Base
::
_ns_and_weights
[
ip
];
auto
const
&
N
=
ip_data
.
N
;
auto
const
&
w
=
ip_data
.
weight
;
double
integral_measure
=
1.0
;
if
(
_data
.
integral_measure
)
{
integral_measure
=
(
*
_data
.
integral_measure
)(
t
,
position
)[
0
];
}
// flux = alpha * ( u_0 - u )
// adding a alpha term to the diagonal of the stiffness matrix
// and a alpha * u_0 term to the rhs vector
_local_K
.
diagonal
().
noalias
()
+=
N
*
alpha
.
dot
(
N
)
*
w
;
_local_rhs
.
noalias
()
+=
N
*
alpha
.
dot
(
N
)
*
u_0
.
dot
(
N
)
*
w
;
_local_K
.
diagonal
().
noalias
()
+=
N
*
alpha
.
dot
(
N
)
*
w
*
integral_measure
;
_local_rhs
.
noalias
()
+=
N
*
alpha
.
dot
(
N
)
*
u_0
.
dot
(
N
)
*
w
*
integral_measure
;
}
auto
const
indices
=
NumLib
::
getIndices
(
id
,
dof_table_boundary
);
...
...
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