Flow123d
release_3.0.0-973-g92f55e826
flow123d
src
mesh
elements.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 elements.cc
15
* @ingroup mesh
16
* @brief Various element oriented stuff, should be restricted to purely geometric functions
17
*/
18
19
#include <vector>
20
#include <string>
21
22
#include "
system/system.hh
"
23
#include "
mesh/side_impl.hh
"
24
#include "
elements.h
"
25
#include "
mesh/mesh.h
"
26
#include "
mesh/ref_element.hh
"
27
28
// following deps. should be removed
29
#include "
mesh/boundaries.h
"
30
//#include "materials.hh"
31
#include "
mesh/accessors.hh
"
32
#include "
la/distribution.hh
"
33
34
35
36
Element::Element
()
37
: boundary_idx_(NULL),
38
neigh_vb(NULL),
39
pid_(0),
40
n_neighs_vb_(0),
41
dim_(0)
42
{
43
}
44
45
46
Element::Element
(
unsigned
int
dim,
RegionIdx
reg)
47
{
48
init
(
dim
, reg);
49
}
50
51
52
53
void
Element::init
(
unsigned
int
dim,
RegionIdx
reg) {
54
pid_
=0;
55
n_neighs_vb_
=0;
56
neigh_vb
=NULL;
57
dim_
=
dim
;
58
region_idx_
=reg;
59
60
edge_idx_
.resize(
n_sides
() );
61
permutation_idx_
.resize(
n_sides
() );
62
boundary_idx_
= NULL;
63
64
for
(
unsigned
int
si=0; si<this->
n_sides
(); si++) {
65
edge_idx_
[ si ]=
Mesh::undef_idx
;
66
permutation_idx_
[si] =
Mesh::undef_idx
;
67
}
68
}
69
70
71
Element::~Element
() {
72
// Can not make deallocation here since then resize of
73
// vectors of elements deallocates what should be keeped.
74
}
75
76
77
/**
78
* Count element sides of the space dimension @p side_dim.
79
*/
80
81
/* If we use this method, it will be moved to mesh accessor class.
82
unsigned int Element::n_sides_by_dim(unsigned int side_dim)
83
{
84
if (side_dim == dim()) return 1;
85
86
unsigned int n = 0;
87
for (unsigned int i=0; i<n_sides(); i++)
88
if (side(i)->dim() == side_dim) n++;
89
return n;
90
}*/
91
92
93
94
//-----------------------------------------------------------------------------
95
// vim: set cindent:
Element::edge_idx_
std::vector< unsigned int > edge_idx_
Edges on sides.
Definition:
elements.h:93
ref_element.hh
Class RefElement defines numbering of vertices, sides, calculation of normal vectors etc.
Mesh::undef_idx
static const unsigned int undef_idx
Definition:
mesh.h:106
Element::dim
unsigned int dim() const
Definition:
elements.h:124
distribution.hh
Support classes for parallel programing.
Element::pid_
int pid_
Id # of mesh partition.
Definition:
elements.h:92
system.hh
Element::permutation_idx_
std::vector< unsigned int > permutation_idx_
Definition:
elements.h:107
Element::~Element
~Element()
Definition:
elements.cc:71
accessors.hh
Element::dim_
unsigned int dim_
Definition:
elements.h:111
elements.h
Element::n_neighs_vb_
unsigned int n_neighs_vb_
Definition:
elements.h:94
Element::init
void init(unsigned int dim, RegionIdx reg)
Definition:
elements.cc:53
mesh.h
Element::region_idx_
RegionIdx region_idx_
Definition:
elements.h:110
Element::neigh_vb
Neighbour ** neigh_vb
Definition:
elements.h:87
Element::Element
Element()
Definition:
elements.cc:36
Element::n_sides
unsigned int n_sides() const
Definition:
elements.h:135
boundaries.h
RegionIdx
Definition:
region.hh:67
side_impl.hh
Element::boundary_idx_
unsigned int * boundary_idx_
Definition:
elements.h:83
Generated by
1.8.17