Flow123d
3.9.0-c2ae2d0a8
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
u
v
w
y
Functions
_
a
b
c
d
e
f
g
h
i
m
n
o
p
r
s
t
u
w
Variables
Typedefs
Enumerations
Enumerator
a
b
c
d
f
g
h
i
m
n
o
p
r
s
u
w
y
Classes
Class List
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
z
Enumerations
a
b
c
d
f
h
i
m
n
o
p
r
s
t
u
v
Enumerator
a
b
c
d
e
f
g
i
k
l
m
n
o
p
r
s
t
u
v
w
x
y
z
Related Functions
a
b
c
d
e
f
g
i
l
m
n
o
p
r
s
t
Files
File List
File Members
All
_
a
b
c
d
e
f
g
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
z
Functions
_
a
c
d
f
i
k
l
m
n
o
p
r
s
t
v
Variables
_
a
c
d
g
m
n
p
q
s
u
v
Typedefs
_
a
d
e
f
g
i
j
l
m
o
q
r
s
t
u
v
Enumerations
Enumerator
a
b
c
d
e
f
i
m
n
o
p
r
s
u
v
w
Macros
_
a
b
c
d
e
f
g
i
j
k
l
m
n
o
p
q
r
s
t
w
z
src
la
local_to_global_map.cc
Go to the documentation of this file.
1
/*!
2
*
3
* Copyright (C) 2015 Technical University of Liberec. All rights reserved.
4
*
5
* This program is free software; you can redistribute it and/or modify it under
6
* the terms of the GNU General Public License version 3 as published by the
7
* Free Software Foundation. (http://www.gnu.org/licenses/gpl-3.0.en.html)
8
*
9
* This program is distributed in the hope that it will be useful, but WITHOUT
10
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12
*
13
*
14
* @file local_to_global_map.cc
15
* @brief
16
*/
17
18
#include <
la/local_to_global_map.hh
>
19
#include <
la/distribution.hh
>
20
21
#include "
system/system.hh
"
22
23
24
LocalToGlobalMap::LocalToGlobalMap
(
const
Distribution
&any_distr)
25
: nonlocal_indices_(new
std
::set<unsigned int>()),
26
distr_(
std
::make_shared<
Distribution
>(any_distr)),
27
global_indices_(0)
28
{}
29
30
LocalToGlobalMap::LocalToGlobalMap
(std::shared_ptr<Distribution> any_distr)
31
: nonlocal_indices_(new
std
::set<unsigned int>()),
32
distr_(any_distr),
33
global_indices_(0)
34
{}
35
36
void
LocalToGlobalMap::insert
(
const
unsigned
int
global_idx) {
37
ASSERT_EQ
(
global_indices_
.size(), 0 ).error(
"Insertion into the map after finalize."
);
38
if
(!
distr_
->is_local( global_idx ) )
nonlocal_indices_
->insert( global_idx );
39
}
40
41
void
LocalToGlobalMap::insert
(
const
std::vector<unsigned int>
&indices) {
42
ASSERT_EQ
(
global_indices_
.size(), 0 ).error(
"Insertion into the map after finalize."
);
43
for
(
std::vector<unsigned int>::const_iterator
it
=indices.begin();
it
!= indices.end(); ++
it
)
44
if
(!
distr_
->is_local( *
it
) )
nonlocal_indices_
->insert( *
it
);
45
}
46
47
void
LocalToGlobalMap::finalize
() {
48
global_indices_
.resize(
distr_
->lsize() +
nonlocal_indices_
->size() );
49
unsigned
int
i;
50
51
for
(i=0; i<
distr_
->lsize(); i++)
global_indices_
[i]=
distr_
->begin()+i;
52
for
(std::set<unsigned int>::iterator
it
=
nonlocal_indices_
->begin();
53
it
!=
nonlocal_indices_
->end(); ++
it
)
54
global_indices_
[i++]=*
it
;
55
delete
nonlocal_indices_
;
56
}
57
58
59
distribution.hh
Support classes for parallel programing.
std::vector< unsigned int >
system.hh
LocalToGlobalMap::nonlocal_indices_
std::set< unsigned int > * nonlocal_indices_
auxiliary set of non-local part of the map
Definition:
local_to_global_map.hh:136
Distribution
Definition:
distribution.hh:50
LocalToGlobalMap::finalize
void finalize()
Definition:
local_to_global_map.cc:47
ASSERT_EQ
#define ASSERT_EQ(a, b)
Definition of comparative assert macro (EQual) only for debug mode.
Definition:
asserts.hh:333
LocalToGlobalMap::global_indices_
std::vector< unsigned int > global_indices_
mapping for all local indices
Definition:
local_to_global_map.hh:140
LocalToGlobalMap::insert
void insert(const unsigned int idx)
Definition:
local_to_global_map.cc:36
Input::Type
Definition:
balance.hh:41
LocalToGlobalMap::distr_
std::shared_ptr< Distribution > distr_
distribution of the global indices
Definition:
local_to_global_map.hh:138
std
Definition:
doxy_dummy_defs.hh:5
LocalToGlobalMap::LocalToGlobalMap
LocalToGlobalMap(const Distribution &distr)
Definition:
local_to_global_map.cc:24
local_to_global_map.hh
Generated by
1.8.17