Use less allocations on UGGrid intersection geometries
- Nov 13, 2024
-
-
Santiago Ospina De Los Ríos authored
Avoid storing coordinates on the heap by exploiting the fact that we only have cubes and simplices up to 3D. When the number of corners is the same use an std::array, otherwise use a ReservedVector. This avoid many allocations during grid iteration.
-
Santiago Ospina De Los Ríos authored
The common case of an intersection is when it has only one face. For this case we use a variant that either holds one face, a vector of faces, or none. This way the common case is stored in the stack whereas the general case is still possible but needs dynamic allocation
-
- Nov 12, 2024
-
-
Santiago Ospina De Los Ríos authored
There is no inherent need to store geometries in the heap. This changes the data layout to store them in the stack. Incidentally, this also moves coordinates into the geometries to avoid an extra allocation on the vector of coordinates.
-