Skip to content
Snippets Groups Projects
Commit 4cc7647e authored by Tom Fischer's avatar Tom Fischer
Browse files

[PL/RichardsComponentTransport] Vars for matrix access.

Use variables for indices and size for accessing local matrices.
parent 9cd0967e
Branches
Tags
No related merge requests found
...@@ -157,9 +157,8 @@ public: ...@@ -157,9 +157,8 @@ public:
SpatialPosition pos; SpatialPosition pos;
pos.setElementID(_element_id); pos.setElementID(_element_id);
auto const num_nodes = ShapeFunction::NPOINTS; auto p_nodal_values = Eigen::Map<const NodalVectorType>(
auto p_nodal_values = &local_x[pressure_index], pressure_size);
Eigen::Map<const NodalVectorType>(&local_x[num_nodes], num_nodes);
auto const& b = _process_data.specific_body_force; auto const& b = _process_data.specific_body_force;
...@@ -168,13 +167,17 @@ public: ...@@ -168,13 +167,17 @@ public:
GlobalDimMatrixType const& I( GlobalDimMatrixType const& I(
GlobalDimMatrixType::Identity(GlobalDim, GlobalDim)); GlobalDimMatrixType::Identity(GlobalDim, GlobalDim));
auto KCC = local_K.template block<num_nodes, num_nodes>(0, 0); auto KCC =
auto MCC = local_M.template block<num_nodes, num_nodes>(0, 0); local_K.template block<concentration_size, concentration_size>(
auto Kpp = concentration_index, concentration_index);
local_K.template block<num_nodes, num_nodes>(num_nodes, num_nodes); auto MCC =
auto Mpp = local_M.template block<concentration_size, concentration_size>(
local_M.template block<num_nodes, num_nodes>(num_nodes, num_nodes); concentration_index, concentration_index);
auto Bp = local_b.template block<num_nodes, 1>(num_nodes, 0); auto Kpp = local_K.template block<pressure_size, pressure_size>(
pressure_index, pressure_index);
auto Mpp = local_M.template block<pressure_size, pressure_size>(
pressure_index, pressure_index);
auto Bp = local_b.template block<pressure_size, 1>(pressure_index, 0);
for (std::size_t ip(0); ip < n_integration_points; ++ip) for (std::size_t ip(0); ip < n_integration_points; ++ip)
{ {
...@@ -437,6 +440,11 @@ private: ...@@ -437,6 +440,11 @@ private:
Eigen::aligned_allocator<IntegrationPointData< Eigen::aligned_allocator<IntegrationPointData<
NodalRowVectorType, GlobalDimNodalMatrixType, NodalMatrixType>>> NodalRowVectorType, GlobalDimNodalMatrixType, NodalMatrixType>>>
_ip_data; _ip_data;
static const int concentration_index = 0;
static const int concentration_size = ShapeFunction::NPOINTS;
static const int pressure_index = ShapeFunction::NPOINTS;
static const int pressure_size = ShapeFunction::NPOINTS;
}; };
} // namespace RichardsComponentTransport } // namespace RichardsComponentTransport
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment