Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
ogs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
Dmitri Naumov
ogs
Commits
1ef32f3d
Commit
1ef32f3d
authored
8 years ago
by
Dmitri Naumov
Committed by
Tom Fischer
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[PL/HT] Introduce integration point data.
parent
a06e8608
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ProcessLib/HT/HTFEM.h
+65
-29
65 additions, 29 deletions
ProcessLib/HT/HTFEM.h
with
65 additions
and
29 deletions
ProcessLib/HT/HTFEM.h
+
65
−
29
View file @
1ef32f3d
...
...
@@ -28,6 +28,20 @@ namespace ProcessLib
{
namespace
HT
{
template
<
typename
NodalRowVectorType
,
typename
GlobalDimNodalMatrixType
>
struct
IntegrationPointData
final
{
IntegrationPointData
(
NodalRowVectorType
const
&
N_
,
GlobalDimNodalMatrixType
const
&
dNdx_
,
double
const
&
integration_weight_
)
:
N
(
N_
),
dNdx
(
dNdx_
),
integration_weight
(
integration_weight_
)
{}
NodalRowVectorType
const
N
;
GlobalDimNodalMatrixType
const
dNdx
;
double
const
integration_weight
;
};
const
unsigned
NUM_NODAL_DOF
=
2
;
class
HTLocalAssemblerInterface
...
...
@@ -52,10 +66,19 @@ class LocalAssemblerData : public HTLocalAssemblerInterface
using
ShapeMatricesType
=
ShapeMatrixPolicyType
<
ShapeFunction
,
GlobalDim
>
;
using
ShapeMatrices
=
typename
ShapeMatricesType
::
ShapeMatrices
;
using
NodalMatrixType
=
typename
ShapeMatricesType
::
NodalMatrixType
;
using
LocalMatrixType
=
typename
ShapeMatricesType
::
template
MatrixType
<
NUM_NODAL_DOF
*
ShapeFunction
::
NPOINTS
,
NUM_NODAL_DOF
*
ShapeFunction
::
NPOINTS
>;
using
LocalVectorType
=
typename
ShapeMatricesType
::
template
VectorType
<
NUM_NODAL_DOF
*
ShapeFunction
::
NPOINTS
>;
using
NodalVectorType
=
typename
ShapeMatricesType
::
NodalVectorType
;
using
NodalRowVectorType
=
typename
ShapeMatricesType
::
NodalRowVectorType
;
using
NodalRowVectorType
=
typename
ShapeMatricesType
::
NodalRowVectorType
;
using
GlobalDimVectorType
=
typename
ShapeMatricesType
::
GlobalDimVectorType
;
using
GlobalDimNodalMatrixType
=
typename
ShapeMatricesType
::
GlobalDimNodalMatrixType
;
using
GlobalDimMatrixType
=
typename
ShapeMatricesType
::
GlobalDimMatrixType
;
public:
...
...
@@ -67,9 +90,6 @@ public:
:
_element
(
element
),
_process_data
(
process_data
),
_integration_method
(
integration_order
),
_shape_matrices
(
initShapeMatrices
<
ShapeFunction
,
ShapeMatricesType
,
IntegrationMethod
,
GlobalDim
>
(
element
,
is_axially_symmetric
,
_integration_method
)),
_darcy_velocities
(
GlobalDim
,
std
::
vector
<
double
>
(
_integration_method
.
getNumberOfPoints
()))
...
...
@@ -78,6 +98,24 @@ public:
// matrices.
assert
(
local_matrix_size
==
ShapeFunction
::
NPOINTS
*
NUM_NODAL_DOF
);
(
void
)
local_matrix_size
;
unsigned
const
n_integration_points
=
_integration_method
.
getNumberOfPoints
();
_ip_data
.
reserve
(
n_integration_points
);
auto
const
shape_matrices
=
initShapeMatrices
<
ShapeFunction
,
ShapeMatricesType
,
IntegrationMethod
,
GlobalDim
>
(
element
,
is_axially_symmetric
,
_integration_method
);
for
(
unsigned
ip
=
0
;
ip
<
n_integration_points
;
ip
++
)
{
_ip_data
.
emplace_back
(
shape_matrices
[
ip
].
N
,
shape_matrices
[
ip
].
dNdx
,
_integration_method
.
getWeightedPoint
(
ip
).
getWeight
()
*
shape_matrices
[
ip
].
integralMeasure
*
shape_matrices
[
ip
].
detJ
);
}
}
void
assemble
(
double
const
t
,
std
::
vector
<
double
>
const
&
local_x
,
...
...
@@ -90,11 +128,11 @@ public:
// matrices.
assert
(
local_matrix_size
==
ShapeFunction
::
NPOINTS
*
NUM_NODAL_DOF
);
auto
local_M
=
MathLib
::
createZeroedMatrix
<
Nod
alMatrixType
>
(
auto
local_M
=
MathLib
::
createZeroedMatrix
<
Loc
alMatrixType
>
(
local_M_data
,
local_matrix_size
,
local_matrix_size
);
auto
local_K
=
MathLib
::
createZeroedMatrix
<
Nod
alMatrixType
>
(
auto
local_K
=
MathLib
::
createZeroedMatrix
<
Loc
alMatrixType
>
(
local_K_data
,
local_matrix_size
,
local_matrix_size
);
auto
local_b
=
MathLib
::
createZeroedVector
<
Nod
alVectorType
>
(
auto
local_b
=
MathLib
::
createZeroedVector
<
Loc
alVectorType
>
(
local_b_data
,
local_matrix_size
);
unsigned
const
n_integration_points
=
...
...
@@ -131,11 +169,15 @@ public:
auto
const
thermal_conductivity_fluid
=
_process_data
.
thermal_conductivity_fluid
(
t
,
pos
)[
0
];
auto
const
&
sm
=
_shape_matrices
[
ip
];
auto
const
&
ip_data
=
_ip_data
[
ip
];
auto
const
&
N
=
ip_data
.
N
;
auto
const
&
dNdx
=
ip_data
.
dNdx
;
auto
const
&
w
=
ip_data
.
integration_weight
;
double
T_int_pt
=
0.0
;
double
p_int_pt
=
0.0
;
// Order matters: First T, then P!
NumLib
::
shapeFunctionInterpolate
(
local_x
,
sm
.
N
,
T_int_pt
,
p_int_pt
);
NumLib
::
shapeFunctionInterpolate
(
local_x
,
N
,
T_int_pt
,
p_int_pt
);
// TODO the first argument has to be changed for non constant
// porosity model
...
...
@@ -156,7 +198,6 @@ public:
auto
const
thermal_dispersivity_transversal
=
_process_data
.
thermal_dispersivity_transversal
(
t
,
pos
)[
0
];
auto
const
&
wp
=
_integration_method
.
getWeightedPoint
(
ip
);
auto
Ktt
=
local_K
.
template
block
<
num_nodes
,
num_nodes
>(
0
,
0
);
auto
Mtt
=
local_M
.
template
block
<
num_nodes
,
num_nodes
>(
0
,
0
);
auto
Kpp
=
local_K
.
template
block
<
num_nodes
,
num_nodes
>(
num_nodes
,
...
...
@@ -180,8 +221,7 @@ public:
intrinsic_permeability
/
viscosity
;
GlobalDimVectorType
const
velocity
=
-
perm_over_visc
*
(
sm
.
dNdx
*
p_nodal_values
-
density_water_T
*
b
);
-
perm_over_visc
*
(
dNdx
*
p_nodal_values
-
density_water_T
*
b
);
double
const
velocity_magnitude
=
velocity
.
norm
();
GlobalDimMatrixType
const
&
I
(
...
...
@@ -201,22 +241,16 @@ public:
density_solid
*
specific_heat_capacity_solid
*
(
1
-
porosity
)
+
fluid_reference_density
*
specific_heat_capacity_fluid
*
porosity
;
auto
const
integral_term
=
sm
.
integralMeasure
*
sm
.
detJ
*
wp
.
getWeight
();
// matrix assembly
Ktt
.
noalias
()
+=
integral_term
*
(
sm
.
dNdx
.
transpose
()
*
hydrodynamic_thermodispersion
*
sm
.
dNdx
+
sm
.
N
.
transpose
()
*
velocity
.
transpose
()
*
sm
.
dNdx
*
fluid_reference_density
*
specific_heat_capacity_fluid
);
Kpp
.
noalias
()
+=
integral_term
*
sm
.
dNdx
.
transpose
()
*
perm_over_visc
*
sm
.
dNdx
;
Mtt
.
noalias
()
+=
integral_term
*
sm
.
N
.
transpose
()
*
heat_capacity
*
sm
.
N
;
Mpp
.
noalias
()
+=
integral_term
*
sm
.
N
.
transpose
()
*
specific_storage
*
sm
.
N
;
Bp
+=
integral_term
*
density_water_T
*
sm
.
dNdx
.
transpose
()
*
perm_over_visc
*
b
;
(
dNdx
.
transpose
()
*
hydrodynamic_thermodispersion
*
dNdx
+
N
.
transpose
()
*
velocity
.
transpose
()
*
dNdx
*
fluid_reference_density
*
specific_heat_capacity_fluid
)
*
w
;
Kpp
.
noalias
()
+=
w
*
dNdx
.
transpose
()
*
perm_over_visc
*
dNdx
;
Mtt
.
noalias
()
+=
w
*
N
.
transpose
()
*
heat_capacity
*
N
;
Mpp
.
noalias
()
+=
w
*
N
.
transpose
()
*
specific_storage
*
N
;
Bp
+=
w
*
density_water_T
*
dNdx
.
transpose
()
*
perm_over_visc
*
b
;
/* with Oberbeck-Boussing assumption density difference only exists
* in buoyancy effects */
...
...
@@ -231,7 +265,7 @@ public:
Eigen
::
Map
<
const
Eigen
::
RowVectorXd
>
getShapeMatrix
(
const
unsigned
integration_point
)
const
override
{
auto
const
&
N
=
_
shape_matrices
[
integration_point
].
N
;
auto
const
&
N
=
_
ip_data
[
integration_point
].
N
;
// assumes N is stored contiguously in memory
return
Eigen
::
Map
<
const
Eigen
::
RowVectorXd
>
(
N
.
data
(),
N
.
size
());
...
...
@@ -263,7 +297,9 @@ private:
HTProcessData
const
&
_process_data
;
IntegrationMethod
const
_integration_method
;
std
::
vector
<
ShapeMatrices
>
_shape_matrices
;
std
::
vector
<
IntegrationPointData
<
NodalRowVectorType
,
GlobalDimNodalMatrixType
>>
_ip_data
;
std
::
vector
<
std
::
vector
<
double
>>
_darcy_velocities
;
};
...
...
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