OGS
ProcessLib::Assembly::CommonAssemblyData Struct Reference

Detailed Description

Data necessary for global equation system assembly.

Base of both bulk mesh and submesh assembly data.

Definition at line 14 of file AssemblyData.h.

#include <AssemblyData.h>

Inheritance diagram for ProcessLib::Assembly::CommonAssemblyData:
[legend]

Public Member Functions

 CommonAssemblyData (std::vector< std::vector< std::reference_wrapper< MeshLib::PropertyVector< double > > > > &&residuum_vectors)
std::shared_ptr< std::vector< std::size_t > const > activeElementIDsSorted (std::vector< std::size_t > const *const sorted_element_subset) const
virtual ~CommonAssemblyData ()=default

Public Attributes

std::vector< std::vector< std::reference_wrapper< MeshLib::PropertyVector< double > > > > residuum_vectors
 Residuum vectors for each process ID.

Protected Member Functions

bool areAllElementsActive () const

Protected Attributes

std::shared_ptr< std::vector< std::size_t > const > sorted_active_element_ids_

Constructor & Destructor Documentation

◆ CommonAssemblyData()

ProcessLib::Assembly::CommonAssemblyData::CommonAssemblyData ( std::vector< std::vector< std::reference_wrapper< MeshLib::PropertyVector< double > > > > && residuum_vectors)
inlineexplicit

Definition at line 16 of file AssemblyData.h.

21 {
22 }
std::vector< std::vector< std::reference_wrapper< MeshLib::PropertyVector< double > > > > residuum_vectors
Residuum vectors for each process ID.

References residuum_vectors.

Referenced by ProcessLib::Assembly::SubmeshAssemblyData::SubmeshAssemblyData().

◆ ~CommonAssemblyData()

virtual ProcessLib::Assembly::CommonAssemblyData::~CommonAssemblyData ( )
virtualdefault

Member Function Documentation

◆ activeElementIDsSorted()

std::shared_ptr< std::vector< std::size_t > const > ProcessLib::Assembly::CommonAssemblyData::activeElementIDsSorted ( std::vector< std::size_t > const *const sorted_element_subset) const

Returns active element ids.

Precondition
setAllElementsActive() or setElementSelectionActive() must have been called before.

If sorted_element_subset is not nullptr, only the intersection between the previously set values and sorted_element_subset is returned. sorted_element_subset must be sorted in ascending order in that case. At the moment (Nov 2025) this is used for assembly optimizations in the HeatTransportBHE process.

Returns
The returned range of element IDs is sorted in ascending order. (NOTE: That's specified for std::ranges::set_intersection only, I hope it is true for range-v3, too.) If this method returns nullptr it means that all elements are active.

Definition at line 13 of file AssemblyData.cpp.

15{
16 if (!sorted_element_subset)
17 {
19 }
20
21 assert(ranges::is_sorted(*sorted_element_subset));
22
24 {
25 // We do not own sorted_element_subset, so the returned data must not be
26 // deleted by us.
27 auto do_not_delete = [](auto*) {};
28 return {sorted_element_subset, do_not_delete};
29 }
30
31 // Final case: there are both some deactivated elements and a further
32 // subselection by sorted_element_subset.
33
34 // TODO frequent re-computations might occur here. Optimization potential.
35 auto aeis = std::make_shared<std::vector<std::size_t>>();
36 aeis->reserve(std::min(sorted_active_element_ids_->size(),
37 sorted_element_subset->size()));
38
39 ranges::set_intersection(*sorted_active_element_ids_,
40 *sorted_element_subset, std::back_inserter(*aeis));
41 return aeis;
42}
std::shared_ptr< std::vector< std::size_t > const > sorted_active_element_ids_

References areAllElementsActive(), and sorted_active_element_ids_.

Referenced by ProcessLib::AssemblyMixin< Process >::assembleOnBulkMeshOrOnSubmeshCommon(), and ProcessLib::AssemblyMixin< Process >::assembleWithJacobianOnBulkMeshOrOnSubmeshCommon().

◆ areAllElementsActive()

bool ProcessLib::Assembly::CommonAssemblyData::areAllElementsActive ( ) const
inlineprotected

Definition at line 53 of file AssemblyData.h.

54 {
55 return sorted_active_element_ids_ == nullptr;
56 }

References sorted_active_element_ids_.

Referenced by activeElementIDsSorted().

Member Data Documentation

◆ residuum_vectors

std::vector< std::vector<std::reference_wrapper<MeshLib::PropertyVector<double> > > > ProcessLib::Assembly::CommonAssemblyData::residuum_vectors

◆ sorted_active_element_ids_


The documentation for this struct was generated from the following files: