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
1685ce44
Commit
1685ce44
authored
8 years ago
by
Christoph Lehmann
Browse files
Options
Downloads
Patches
Plain Diff
[PL] extrapolator moved to base process
parent
bfb48911
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
ProcessLib/Process.cpp
+46
-0
46 additions, 0 deletions
ProcessLib/Process.cpp
ProcessLib/Process.h
+11
-0
11 additions, 0 deletions
ProcessLib/Process.h
with
57 additions
and
0 deletions
ProcessLib/Process.cpp
+
46
−
0
View file @
1685ce44
...
...
@@ -10,6 +10,7 @@
#include
"Process.h"
#include
"NumLib/DOF/ComputeSparsityPattern.h"
#include
"NumLib/Extrapolation/LocalLinearLeastSquaresExtrapolator.h"
#include
"DirichletBc.h"
#include
"NeumannBc.h"
#include
"NeumannBcAssembler.h"
...
...
@@ -52,6 +53,9 @@ void Process::initialize()
DBUG
(
"Compute sparsity pattern"
);
computeSparsityPattern
();
DBUG
(
"Initialize the extrapolator"
);
initializeExtrapolator
();
initializeConcreteProcess
(
*
_local_to_global_index_map
,
_mesh
,
_integration_order
);
...
...
@@ -168,6 +172,48 @@ void Process::constructDofTable()
std
::
move
(
all_mesh_subsets
),
NumLib
::
ComponentOrder
::
BY_LOCATION
));
}
void
Process
::
initializeExtrapolator
()
{
NumLib
::
LocalToGlobalIndexMap
const
*
dof_table_single_component
;
bool
manage_storage
;
if
(
_local_to_global_index_map
->
getNumberOfComponents
()
==
1
)
{
// For single-variable-single-component processes reuse the existing DOF
// table.
dof_table_single_component
=
_local_to_global_index_map
.
get
();
manage_storage
=
false
;
}
else
{
// Otherwise construct a new DOF table.
std
::
vector
<
std
::
unique_ptr
<
MeshLib
::
MeshSubsets
>>
all_mesh_subsets_single_component
;
all_mesh_subsets_single_component
.
emplace_back
(
new
MeshLib
::
MeshSubsets
(
this
->
_mesh_subset_all_nodes
.
get
()));
dof_table_single_component
=
new
NumLib
::
LocalToGlobalIndexMap
(
std
::
move
(
all_mesh_subsets_single_component
),
// by location order is needed for output
NumLib
::
ComponentOrder
::
BY_LOCATION
);
manage_storage
=
true
;
}
MathLib
::
MatrixSpecifications
mat_specs
(
dof_table_single_component
->
dofSizeWithoutGhosts
(),
dof_table_single_component
->
dofSizeWithoutGhosts
(),
&
dof_table_single_component
->
getGhostIndices
(),
nullptr
);
std
::
unique_ptr
<
NumLib
::
Extrapolator
>
extrapolator
(
new
NumLib
::
LocalLinearLeastSquaresExtrapolator
(
mat_specs
,
*
dof_table_single_component
));
// TODO Later on the DOF table can change during the simulation!
_extrapolator_data
=
ExtrapolatorData
(
std
::
move
(
extrapolator
),
dof_table_single_component
,
manage_storage
);
}
void
Process
::
setInitialConditions
(
ProcessVariable
const
&
variable
,
int
const
variable_id
,
int
const
component_id
,
...
...
This diff is collapsed.
Click to expand it.
ProcessLib/Process.h
+
11
−
0
View file @
1685ce44
...
...
@@ -14,6 +14,7 @@
#include
"NumLib/ODESolver/ODESystem.h"
#include
"NumLib/ODESolver/TimeDiscretization.h"
#include
"ExtrapolatorData.h"
#include
"Parameter.h"
#include
"ProcessOutput.h"
#include
"SecondaryVariable.h"
...
...
@@ -85,6 +86,12 @@ public:
return
*
_time_discretization
;
}
protected
:
NumLib
::
Extrapolator
&
getExtrapolator
()
{
return
*
_extrapolator_data
.
extrapolator
;
}
private
:
/// Process specific initialization called by initialize().
virtual
void
initializeConcreteProcess
(
...
...
@@ -104,6 +111,8 @@ private:
void
constructDofTable
();
void
initializeExtrapolator
();
/// Sets the initial condition values in the solution vector x for a given
/// process variable and component.
void
setInitialConditions
(
ProcessVariable
const
&
variable
,
...
...
@@ -142,6 +151,8 @@ private:
/// Variables used by this process.
std
::
vector
<
std
::
reference_wrapper
<
ProcessVariable
>>
_process_variables
;
ExtrapolatorData
_extrapolator_data
;
};
/// Find process variables in \c variables whose names match the settings under
...
...
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