Skip to content
Snippets Groups Projects
Commit 344a6fba authored by Max Jaeschke's avatar Max Jaeschke
Browse files

Filter BHE and soil elements

Sort soil and bhe elements only, if they are unsorted
parent d479cbca
No related branches found
No related tags found
No related merge requests found
...@@ -161,6 +161,33 @@ void HeatTransportBHEProcess::initializeConcreteProcess( ...@@ -161,6 +161,33 @@ void HeatTransportBHEProcess::initializeConcreteProcess(
// Create BHE boundary conditions for each of the BHEs // Create BHE boundary conditions for each of the BHEs
createBHEBoundaryConditionTopBottom(_bheMeshData.BHE_nodes); createBHEBoundaryConditionTopBottom(_bheMeshData.BHE_nodes);
// Store BHE and soil elements to split the assembly and use the matrix
// cache in the linear case only for soil elements
if (_process_data._algebraic_BC_Setting._is_linear)
{
_bhes_element_ids = _bheMeshData.BHE_elements | ranges::views::join |
MeshLib::views::ids | ranges::to<std::vector>;
// sort bhe elements if needed
if (!std::is_sorted(_bhes_element_ids.begin(), _bhes_element_ids.end()))
{
std::sort(_bhes_element_ids.begin(), _bhes_element_ids.end());
}
_soil_element_ids = mesh.getElements() | MeshLib::views::ids |
ranges::to<std::vector>();
// sort soil elements if needed
if (!std::is_sorted(_soil_element_ids.begin(), _soil_element_ids.end()))
{
std::sort(_soil_element_ids.begin(), _soil_element_ids.end());
}
_soil_element_ids = ranges::views::set_difference(_soil_element_ids,
_bhes_element_ids) |
ranges::to<std::vector>();
}
if (_process_data._mass_lumping) if (_process_data._mass_lumping)
{ {
std::vector<std::size_t> const bhes_node_ids = std::vector<std::size_t> const bhes_node_ids =
......
...@@ -126,6 +126,10 @@ private: ...@@ -126,6 +126,10 @@ private:
const BHEMeshData _bheMeshData; const BHEMeshData _bheMeshData;
AssembledMatrixCache _asm_mat_cache; AssembledMatrixCache _asm_mat_cache;
std::vector<std::size_t> _bhes_element_ids;
std::vector<std::size_t> _soil_element_ids;
}; };
} // namespace HeatTransportBHE } // namespace HeatTransportBHE
} // namespace ProcessLib } // namespace ProcessLib
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