TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
MD_Vector_mono.h
1/****************************************************************************
2* Copyright (c) 2025, CEA
3* All rights reserved.
4*
5* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
6* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
7* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
8* 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
9*
10* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
11* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
12* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
13*
14*****************************************************************************/
15
16#ifndef MD_Vector_mono_included
17#define MD_Vector_mono_included
18
19#include <MD_Vector_base.h>
20
21/*! @brief Generic class for all mono-block MD_Vectors (i.e. non compoosite)
22 *
23 * The two main members of this class are blocs_items_to_sum_ and blocs_items_to_compute_.
24 * Note that those two members are hence **not** present in a MD_Vector_composite. For this case
25 * the redirection is made to the inner MD_Vector_mono member which aggregates the information.
26 *
27 * See also class MD_Vector_composite
28 */
30{
31
32 Declare_base(MD_Vector_mono);
33
34public:
35 const ArrOfInt& get_blocs_items_to_sum() const override { return blocs_items_to_sum_; }
36 const ArrOfInt& get_items_to_sum() const override;
37 const ArrOfInt& get_blocs_items_to_compute() const override { return blocs_items_to_compute_; }
38 const ArrOfInt& get_items_to_compute() const override;
39
40protected:
41 // MD_Vector_composite needs to see inside MD_Vector_mono because of its global_md_ member:
42 friend class MD_Vector_composite;
43
44 // Methods to extend/complete a MD_Vector_mono with another MD_Vector_mono - not all combinations are possible.
45 // See derived classes MD_Vector_seq and MD_Vector_std.
46 // For example extending a MD_Vector_std with a MD_Vector_seq is not possible.
47 virtual void append_from_other_std(const MD_Vector_std& src, int offset, int multiplier) { throw; }
48 virtual void append_from_other_seq(const MD_Vector_seq& src, int offset, int multiplier) { throw; }
49
50 // ***** The following members are used to compute sums, dot products, norms ******
51 // Indices of all items owned by this processor (these are the "sequential items", defined as
52 // all items whose value is not received from another processor during an echange_espace_virtuel).
53 // To sum over all items, the values of all items in these blocks must be summed.
54 // The array contains start_bloc1, end_bloc1, start_bloc2, end_bloc2, etc...
55 // (end_bloc is the index of the last element + 1)
56 // (structure used for sequential saves (xyz or debog), vector norm computations, etc)
58 mutable ArrOfInt items_to_sum_; // All items (more suitable for TRUSTVect_tools kernels on GPU)
59 // Indices of all items for which a value must be computed
60 // (used by DoubleTab::operator+=(const DoubleTab &) for example)
61 // In theory, blocs_items_to_sum_ would suffice, but it is full of holes
62 // and can be inefficient. In practice, all real values are computed.
64 mutable ArrOfInt items_to_compute_; // All items (more suitable for TRUSTVect_tools kernels on GPU)
65};
66#endif
Base class for distributed vectors parallel descriptors.
Generic class for all mono-block MD_Vectors (i.e. non compoosite).
friend class MD_Vector_composite
ArrOfInt items_to_sum_
const ArrOfInt & get_items_to_compute() const override
ArrOfInt items_to_compute_
ArrOfInt blocs_items_to_sum_
virtual void append_from_other_std(const MD_Vector_std &src, int offset, int multiplier)
const ArrOfInt & get_items_to_sum() const override
virtual void append_from_other_seq(const MD_Vector_seq &src, int offset, int multiplier)
const ArrOfInt & get_blocs_items_to_sum() const override
const ArrOfInt & get_blocs_items_to_compute() const override
ArrOfInt blocs_items_to_compute_
Dummy parallel descriptor used for sequential computations.
This is the simplest descriptor, used for arrays of values at vertices, elements, faces,...