Skip to content
Snippets Groups Projects
Unverified Commit 5052e4bc authored by Tom Fischer's avatar Tom Fischer Committed by GitHub
Browse files

Merge pull request #2530 from TomFischer/UseConstVarsForSizesAndIndexes

[HT] Use const vars for sizes and indexes in local assembly.
parents c9c865ff d9636044
No related branches found
No related tags found
No related merge requests found
...@@ -354,6 +354,12 @@ protected: ...@@ -354,6 +354,12 @@ protected:
return cache; return cache;
} }
protected:
static const int pressure_index = ShapeFunction::NPOINTS;
static const int pressure_size = ShapeFunction::NPOINTS;
static const int temperature_index = 0;
static const int temperature_size = ShapeFunction::NPOINTS;
}; };
} // namespace HT } // namespace HT
......
...@@ -81,21 +81,21 @@ public: ...@@ -81,21 +81,21 @@ public:
auto local_b = MathLib::createZeroedVector<LocalVectorType>( auto local_b = MathLib::createZeroedVector<LocalVectorType>(
local_b_data, local_matrix_size); local_b_data, local_matrix_size);
auto const num_nodes = ShapeFunction::NPOINTS; auto KTT = local_K.template block<temperature_size, temperature_size>(
temperature_index, temperature_index);
auto Ktt = local_K.template block<num_nodes, num_nodes>(0, 0); auto MTT = local_M.template block<temperature_size, temperature_size>(
auto Mtt = local_M.template block<num_nodes, num_nodes>(0, 0); temperature_index, temperature_index);
auto Kpp = auto Kpp = local_K.template block<pressure_size, pressure_size>(
local_K.template block<num_nodes, num_nodes>(num_nodes, num_nodes); pressure_index, pressure_index);
auto Mpp = auto Mpp = local_M.template block<pressure_size, pressure_size>(
local_M.template block<num_nodes, num_nodes>(num_nodes, num_nodes); pressure_index, pressure_index);
auto Bp = local_b.template block<num_nodes, 1>(num_nodes, 0); auto Bp = local_b.template block<pressure_size, 1>(pressure_index, 0);
ParameterLib::SpatialPosition pos; ParameterLib::SpatialPosition pos;
pos.setElementID(this->_element.getID()); pos.setElementID(this->_element.getID());
auto p_nodal_values = auto p_nodal_values = Eigen::Map<const NodalVectorType>(
Eigen::Map<const NodalVectorType>(&local_x[num_nodes], num_nodes); &local_x[pressure_index], pressure_size);
auto const& process_data = this->_material_properties; auto const& process_data = this->_material_properties;
auto const& medium = auto const& medium =
...@@ -178,13 +178,13 @@ public: ...@@ -178,13 +178,13 @@ public:
this->getThermalConductivityDispersivity( this->getThermalConductivityDispersivity(
vars, porosity, fluid_density, specific_heat_capacity_fluid, vars, porosity, fluid_density, specific_heat_capacity_fluid,
velocity, I); velocity, I);
Ktt.noalias() += KTT.noalias() +=
(dNdx.transpose() * thermal_conductivity_dispersivity * dNdx + (dNdx.transpose() * thermal_conductivity_dispersivity * dNdx +
N.transpose() * velocity.transpose() * dNdx * fluid_density * N.transpose() * velocity.transpose() * dNdx * fluid_density *
specific_heat_capacity_fluid) * specific_heat_capacity_fluid) *
w; w;
Kpp.noalias() += w * dNdx.transpose() * K_over_mu * dNdx; Kpp.noalias() += w * dNdx.transpose() * K_over_mu * dNdx;
Mtt.noalias() += MTT.noalias() +=
w * w *
this->getHeatEnergyCoefficient(vars, porosity, fluid_density, this->getHeatEnergyCoefficient(vars, porosity, fluid_density,
specific_heat_capacity_fluid) * specific_heat_capacity_fluid) *
...@@ -218,6 +218,12 @@ public: ...@@ -218,6 +218,12 @@ public:
return this->getIntPtDarcyVelocityLocal(t, local_p, local_x, cache); return this->getIntPtDarcyVelocityLocal(t, local_p, local_x, cache);
} }
private:
using HTFEM<ShapeFunction, IntegrationMethod, GlobalDim>::pressure_index;
using HTFEM<ShapeFunction, IntegrationMethod, GlobalDim>::pressure_size;
using HTFEM<ShapeFunction, IntegrationMethod, GlobalDim>::temperature_index;
using HTFEM<ShapeFunction, IntegrationMethod, GlobalDim>::temperature_size;
}; };
} // namespace HT } // namespace HT
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment