Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
yezhigangzju
ogs
Commits
8df4d40c
Commit
8df4d40c
authored
Nov 23, 2020
by
renchao.lu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PL] Update postTimeStep interface for other processes.
parent
2becc837
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
97 additions
and
40 deletions
+97
-40
ProcessLib/HydroMechanics/HydroMechanicsFEM.h
ProcessLib/HydroMechanics/HydroMechanicsFEM.h
+1
-1
ProcessLib/HydroMechanics/HydroMechanicsProcess.cpp
ProcessLib/HydroMechanics/HydroMechanicsProcess.cpp
+14
-2
ProcessLib/LIE/HydroMechanics/HydroMechanicsProcess.cpp
ProcessLib/LIE/HydroMechanics/HydroMechanicsProcess.cpp
+15
-6
ProcessLib/LIE/HydroMechanics/LocalAssembler/HydroMechanicsLocalAssemblerInterface.h
...cs/LocalAssembler/HydroMechanicsLocalAssemblerInterface.h
+3
-5
ProcessLib/PhaseField/PhaseFieldFEM.h
ProcessLib/PhaseField/PhaseFieldFEM.h
+1
-1
ProcessLib/RichardsMechanics/RichardsMechanicsFEM.h
ProcessLib/RichardsMechanics/RichardsMechanicsFEM.h
+1
-1
ProcessLib/RichardsMechanics/RichardsMechanicsProcess.cpp
ProcessLib/RichardsMechanics/RichardsMechanicsProcess.cpp
+10
-4
ProcessLib/SmallDeformation/SmallDeformationFEM.h
ProcessLib/SmallDeformation/SmallDeformationFEM.h
+1
-1
ProcessLib/SmallDeformation/SmallDeformationProcess.cpp
ProcessLib/SmallDeformation/SmallDeformationProcess.cpp
+5
-3
ProcessLib/SmallDeformationNonlocal/SmallDeformationNonlocalFEM.h
...ib/SmallDeformationNonlocal/SmallDeformationNonlocalFEM.h
+1
-1
ProcessLib/SmallDeformationNonlocal/SmallDeformationNonlocalProcess.cpp
...llDeformationNonlocal/SmallDeformationNonlocalProcess.cpp
+5
-3
ProcessLib/ThermoHydroMechanics/ThermoHydroMechanicsFEM.h
ProcessLib/ThermoHydroMechanics/ThermoHydroMechanicsFEM.h
+1
-1
ProcessLib/ThermoHydroMechanics/ThermoHydroMechanicsProcess.cpp
...sLib/ThermoHydroMechanics/ThermoHydroMechanicsProcess.cpp
+15
-2
ProcessLib/ThermoMechanicalPhaseField/ThermoMechanicalPhaseFieldFEM.h
...hermoMechanicalPhaseField/ThermoMechanicalPhaseFieldFEM.h
+1
-1
ProcessLib/ThermoMechanicalPhaseField/ThermoMechanicalPhaseFieldProcess.cpp
...echanicalPhaseField/ThermoMechanicalPhaseFieldProcess.cpp
+13
-3
ProcessLib/ThermoMechanics/ThermoMechanicsFEM.h
ProcessLib/ThermoMechanics/ThermoMechanicsFEM.h
+1
-1
ProcessLib/ThermoMechanics/ThermoMechanicsProcess.cpp
ProcessLib/ThermoMechanics/ThermoMechanicsProcess.cpp
+9
-4
No files found.
ProcessLib/HydroMechanics/HydroMechanicsFEM.h
View file @
8df4d40c
...
...
@@ -178,7 +178,7 @@ public:
}
}
void
postTimestepConcrete
(
std
::
v
ector
<
double
>
const
&
/*local_x*/
,
void
postTimestepConcrete
(
Eigen
::
V
ector
Xd
const
&
/*local_x*/
,
double
const
/*t*/
,
double
const
/*dt*/
)
override
{
...
...
ProcessLib/HydroMechanics/HydroMechanicsProcess.cpp
View file @
8df4d40c
...
...
@@ -492,12 +492,24 @@ void HydroMechanicsProcess<DisplacementDim>::postTimestepConcreteProcess(
std
::
vector
<
GlobalVector
*>
const
&
x
,
double
const
t
,
double
const
dt
,
const
int
process_id
)
{
if
(
process_id
!=
0
)
{
return
;
}
DBUG
(
"PostTimestep HydroMechanicsProcess."
);
std
::
vector
<
NumLib
::
LocalToGlobalIndexMap
const
*>
dof_tables
;
auto
const
n_processes
=
x
.
size
();
dof_tables
.
reserve
(
n_processes
);
for
(
std
::
size_t
process_id
=
0
;
process_id
<
n_processes
;
++
process_id
)
{
dof_tables
.
push_back
(
&
getDOFTable
(
process_id
));
}
ProcessLib
::
ProcessVariable
const
&
pv
=
getProcessVariables
(
process_id
)[
0
];
GlobalExecutor
::
executeSelectedMemberOnDereferenced
(
&
LocalAssemblerIF
::
postTimestep
,
_local_assemblers
,
pv
.
getActiveElementIDs
(),
getDOFTable
(
process_id
),
*
x
[
process_id
],
t
,
dt
);
pv
.
getActiveElementIDs
(),
dof_tables
,
x
,
t
,
dt
);
}
template
<
int
DisplacementDim
>
...
...
ProcessLib/LIE/HydroMechanics/HydroMechanicsProcess.cpp
View file @
8df4d40c
...
...
@@ -459,19 +459,28 @@ void HydroMechanicsProcess<GlobalDim>::postTimestepConcreteProcess(
std
::
vector
<
GlobalVector
*>
const
&
x
,
const
double
t
,
double
const
dt
,
int
const
process_id
)
{
DBUG
(
"Compute the secondary variables for HydroMechanicsProcess."
);
const
auto
&
dof_table
=
getDOFTable
(
process_id
);
if
(
process_id
==
0
)
{
DBUG
(
"PostTimestep HydroMechanicsProcess."
);
std
::
vector
<
NumLib
::
LocalToGlobalIndexMap
const
*>
dof_tables
;
auto
const
n_processes
=
x
.
size
();
dof_tables
.
reserve
(
n_processes
);
for
(
std
::
size_t
process_id
=
0
;
process_id
<
n_processes
;
++
process_id
)
{
dof_tables
.
push_back
(
&
getDOFTable
(
process_id
));
}
ProcessLib
::
ProcessVariable
const
&
pv
=
getProcessVariables
(
process_id
)[
0
];
GlobalExecutor
::
executeSelectedMemberOnDereferenced
(
&
HydroMechanicsLocalAssemblerInterface
::
postTimestep
,
_local_assemblers
,
pv
.
getActiveElementIDs
(),
dof_table
,
*
x
[
process_id
],
t
,
dt
);
_local_assemblers
,
pv
.
getActiveElementIDs
(),
dof_tables
,
x
,
t
,
dt
);
}
DBUG
(
"Compute the secondary variables for HydroMechanicsProcess."
);
const
auto
&
dof_table
=
getDOFTable
(
process_id
);
// Copy displacement jumps in a solution vector to mesh property
// Remark: the copy is required because mesh properties for primary
// variables are set during output and are not ready yet when this function
...
...
ProcessLib/LIE/HydroMechanics/LocalAssembler/HydroMechanicsLocalAssemblerInterface.h
View file @
8df4d40c
...
...
@@ -100,13 +100,11 @@ public:
}
}
void
postTimestepConcrete
(
std
::
v
ector
<
double
>
const
&
local_x_
,
const
double
t
,
double
const
dt
)
override
void
postTimestepConcrete
(
Eigen
::
V
ector
Xd
const
&
local_x_
,
const
double
t
,
double
const
dt
)
override
{
auto
const
local_dof_size
=
local_x_
.
size
();
_local_u
.
setZero
();
for
(
unsigned
i
=
0
;
i
<
local_
dof_size
;
i
++
)
for
(
Eigen
::
Index
i
=
0
;
i
<
local_
x_
.
rows
()
;
i
++
)
{
_local_u
[
_dofIndex_to_localIndex
[
i
]]
=
local_x_
[
i
];
}
...
...
ProcessLib/PhaseField/PhaseFieldFEM.h
View file @
8df4d40c
...
...
@@ -240,7 +240,7 @@ public:
}
}
void
postTimestepConcrete
(
std
::
v
ector
<
double
>
const
&
/*local_x*/
,
void
postTimestepConcrete
(
Eigen
::
V
ector
Xd
const
&
/*local_x*/
,
double
const
/*t*/
,
double
const
/*dt*/
)
override
{
unsigned
const
n_integration_points
=
...
...
ProcessLib/RichardsMechanics/RichardsMechanicsFEM.h
View file @
8df4d40c
...
...
@@ -147,7 +147,7 @@ public:
}
}
void
postTimestepConcrete
(
std
::
v
ector
<
double
>
const
&
/*local_x*/
,
void
postTimestepConcrete
(
Eigen
::
V
ector
Xd
const
&
/*local_x*/
,
double
const
/*t*/
,
double
const
/*dt*/
)
override
{
...
...
ProcessLib/RichardsMechanics/RichardsMechanicsProcess.cpp
View file @
8df4d40c
...
...
@@ -543,16 +543,22 @@ void RichardsMechanicsProcess<DisplacementDim>::postTimestepConcreteProcess(
std
::
vector
<
GlobalVector
*>
const
&
x
,
double
const
t
,
double
const
dt
,
const
int
process_id
)
{
DBUG
(
"PostTimestep RichardsMechanicsProcess."
);
if
(
hasMechanicalProcess
(
process_id
))
{
DBUG
(
"PostTimestep RichardsMechanicsProcess."
);
std
::
vector
<
NumLib
::
LocalToGlobalIndexMap
const
*>
dof_tables
;
auto
const
n_processes
=
x
.
size
();
dof_tables
.
reserve
(
n_processes
);
for
(
std
::
size_t
process_id
=
0
;
process_id
<
n_processes
;
++
process_id
)
{
dof_tables
.
push_back
(
&
getDOFTable
(
process_id
));
}
ProcessLib
::
ProcessVariable
const
&
pv
=
getProcessVariables
(
process_id
)[
0
];
GlobalExecutor
::
executeSelectedMemberOnDereferenced
(
&
LocalAssemblerIF
::
postTimestep
,
_local_assemblers
,
pv
.
getActiveElementIDs
(),
*
_local_to_global_index_map
,
*
x
[
process_id
],
t
,
dt
);
pv
.
getActiveElementIDs
(),
dof_tables
,
x
,
t
,
dt
);
}
}
...
...
ProcessLib/SmallDeformation/SmallDeformationFEM.h
View file @
8df4d40c
...
...
@@ -319,7 +319,7 @@ public:
}
}
void
postTimestepConcrete
(
std
::
v
ector
<
double
>
const
&
/*local_x*/
,
void
postTimestepConcrete
(
Eigen
::
V
ector
Xd
const
&
/*local_x*/
,
double
const
t
,
double
const
dt
)
override
{
unsigned
const
n_integration_points
=
...
...
ProcessLib/SmallDeformation/SmallDeformationProcess.cpp
View file @
8df4d40c
...
...
@@ -245,13 +245,15 @@ void SmallDeformationProcess<DisplacementDim>::postTimestepConcreteProcess(
int
const
process_id
)
{
DBUG
(
"PostTimestep SmallDeformationProcess."
);
std
::
vector
<
NumLib
::
LocalToGlobalIndexMap
const
*>
dof_tables
;
dof_tables
.
reserve
(
x
.
size
());
std
::
generate_n
(
std
::
back_inserter
(
dof_tables
),
x
.
size
(),
[
&
]()
{
return
_local_to_global_index_map
.
get
();
});
ProcessLib
::
ProcessVariable
const
&
pv
=
getProcessVariables
(
process_id
)[
0
];
GlobalExecutor
::
executeSelectedMemberOnDereferenced
(
&
LocalAssemblerInterface
::
postTimestep
,
_local_assemblers
,
pv
.
getActiveElementIDs
(),
*
_local_to_global_index_map
,
*
x
[
process_id
],
t
,
dt
);
pv
.
getActiveElementIDs
(),
dof_tables
,
x
,
t
,
dt
);
std
::
unique_ptr
<
GlobalVector
>
material_forces
;
ProcessLib
::
SmallDeformation
::
writeMaterialForces
(
...
...
ProcessLib/SmallDeformationNonlocal/SmallDeformationNonlocalFEM.h
View file @
8df4d40c
...
...
@@ -529,7 +529,7 @@ public:
}
}
void
postTimestepConcrete
(
std
::
v
ector
<
double
>
const
&
/*local_x*/
,
void
postTimestepConcrete
(
Eigen
::
V
ector
Xd
const
&
/*local_x*/
,
double
const
/*t*/
,
double
const
/*dt*/
)
override
{
unsigned
const
n_integration_points
=
...
...
ProcessLib/SmallDeformationNonlocal/SmallDeformationNonlocalProcess.cpp
View file @
8df4d40c
...
...
@@ -302,13 +302,15 @@ void SmallDeformationNonlocalProcess<DisplacementDim>::
int
const
process_id
)
{
DBUG
(
"PostTimestep SmallDeformationNonlocalProcess."
);
std
::
vector
<
NumLib
::
LocalToGlobalIndexMap
const
*>
dof_tables
;
dof_tables
.
reserve
(
x
.
size
());
std
::
generate_n
(
std
::
back_inserter
(
dof_tables
),
x
.
size
(),
[
&
]()
{
return
_local_to_global_index_map
.
get
();
});
ProcessLib
::
ProcessVariable
const
&
pv
=
getProcessVariables
(
process_id
)[
0
];
GlobalExecutor
::
executeSelectedMemberOnDereferenced
(
&
LocalAssemblerInterface
::
postTimestep
,
_local_assemblers
,
pv
.
getActiveElementIDs
(),
*
_local_to_global_index_map
,
*
x
[
process_id
],
t
,
dt
);
pv
.
getActiveElementIDs
(),
dof_tables
,
x
,
t
,
dt
);
}
template
<
int
DisplacementDim
>
...
...
ProcessLib/ThermoHydroMechanics/ThermoHydroMechanicsFEM.h
View file @
8df4d40c
...
...
@@ -109,7 +109,7 @@ public:
}
}
void
postTimestepConcrete
(
std
::
v
ector
<
double
>
const
&
/*local_x*/
,
void
postTimestepConcrete
(
Eigen
::
V
ector
Xd
const
&
/*local_x*/
,
double
const
/*t*/
,
double
const
/*dt*/
)
override
{
...
...
ProcessLib/ThermoHydroMechanics/ThermoHydroMechanicsProcess.cpp
View file @
8df4d40c
...
...
@@ -350,10 +350,23 @@ void ThermoHydroMechanicsProcess<DisplacementDim>::postTimestepConcreteProcess(
std
::
vector
<
GlobalVector
*>
const
&
x
,
double
const
t
,
double
const
dt
,
const
int
process_id
)
{
if
(
process_id
!=
0
)
{
return
;
}
DBUG
(
"PostTimestep ThermoHydroMechanicsProcess."
);
std
::
vector
<
NumLib
::
LocalToGlobalIndexMap
const
*>
dof_tables
;
auto
const
n_processes
=
x
.
size
();
dof_tables
.
reserve
(
n_processes
);
for
(
std
::
size_t
process_id
=
0
;
process_id
<
n_processes
;
++
process_id
)
{
dof_tables
.
push_back
(
&
getDOFTable
(
process_id
));
}
GlobalExecutor
::
executeMemberOnDereferenced
(
&
LocalAssemblerInterface
::
postTimestep
,
_local_assemblers
,
getDOFTable
(
process_id
),
*
x
[
process_id
]
,
t
,
dt
);
&
LocalAssemblerInterface
::
postTimestep
,
_local_assemblers
,
dof_tables
,
x
,
t
,
dt
);
}
template
<
int
DisplacementDim
>
...
...
ProcessLib/ThermoMechanicalPhaseField/ThermoMechanicalPhaseFieldFEM.h
View file @
8df4d40c
...
...
@@ -254,7 +254,7 @@ public:
}
}
void
postTimestepConcrete
(
std
::
v
ector
<
double
>
const
&
/*local_x*/
,
void
postTimestepConcrete
(
Eigen
::
V
ector
Xd
const
&
/*local_x*/
,
double
const
/*t*/
,
double
const
/*dt*/
)
override
{
unsigned
const
n_integration_points
=
...
...
ProcessLib/ThermoMechanicalPhaseField/ThermoMechanicalPhaseFieldProcess.cpp
View file @
8df4d40c
...
...
@@ -286,14 +286,24 @@ void ThermoMechanicalPhaseFieldProcess<DisplacementDim>::
double
const
dt
,
int
const
process_id
)
{
if
(
process_id
!=
0
)
{
return
;
}
DBUG
(
"PostTimestep ThermoMechanicalPhaseFieldProcess."
);
std
::
vector
<
NumLib
::
LocalToGlobalIndexMap
const
*>
dof_tables
;
auto
const
n_processes
=
x
.
size
();
dof_tables
.
reserve
(
n_processes
);
for
(
std
::
size_t
process_id
=
0
;
process_id
<
n_processes
;
++
process_id
)
{
dof_tables
.
push_back
(
&
getDOFTable
(
process_id
));
}
ProcessLib
::
ProcessVariable
const
&
pv
=
getProcessVariables
(
process_id
)[
0
];
GlobalExecutor
::
executeSelectedMemberOnDereferenced
(
&
ThermoMechanicalPhaseFieldLocalAssemblerInterface
::
postTimestep
,
_local_assemblers
,
pv
.
getActiveElementIDs
(),
getDOFTable
(
process_id
),
*
x
[
process_id
],
t
,
dt
);
_local_assemblers
,
pv
.
getActiveElementIDs
(),
dof_tables
,
x
,
t
,
dt
);
}
template
<
int
DisplacementDim
>
...
...
ProcessLib/ThermoMechanics/ThermoMechanicsFEM.h
View file @
8df4d40c
...
...
@@ -182,7 +182,7 @@ public:
}
}
void
postTimestepConcrete
(
std
::
v
ector
<
double
>
const
&
/*local_x*/
,
void
postTimestepConcrete
(
Eigen
::
V
ector
Xd
const
&
/*local_x*/
,
double
const
/*t*/
,
double
const
/*dt*/
)
override
{
unsigned
const
n_integration_points
=
...
...
ProcessLib/ThermoMechanics/ThermoMechanicsProcess.cpp
View file @
8df4d40c
...
...
@@ -415,19 +415,24 @@ void ThermoMechanicsProcess<DisplacementDim>::postTimestepConcreteProcess(
std
::
vector
<
GlobalVector
*>
const
&
x
,
double
const
t
,
double
const
dt
,
int
const
process_id
)
{
if
(
process_id
!=
_process_data
.
mechanics_process_id
)
if
(
process_id
!=
0
)
{
return
;
}
DBUG
(
"PostTimestep ThermoMechanicsProcess."
);
std
::
vector
<
NumLib
::
LocalToGlobalIndexMap
const
*>
dof_tables
;
auto
const
n_processes
=
x
.
size
();
dof_tables
.
reserve
(
n_processes
);
for
(
std
::
size_t
process_id
=
0
;
process_id
<
n_processes
;
++
process_id
)
{
dof_tables
.
push_back
(
&
getDOFTable
(
process_id
));
}
ProcessLib
::
ProcessVariable
const
&
pv
=
getProcessVariables
(
process_id
)[
0
];
GlobalExecutor
::
executeSelectedMemberOnDereferenced
(
&
LocalAssemblerInterface
::
postTimestep
,
_local_assemblers
,
pv
.
getActiveElementIDs
(),
*
_local_to_global_index_map
,
*
x
[
process_id
],
t
,
dt
);
pv
.
getActiveElementIDs
(),
dof_tables
,
x
,
t
,
dt
);
}
template
<
int
DisplacementDim
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment