Flow123d  release_2.2.0-914-gf1a3a4f
boundaries.h
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 boundaries.h
15  * @brief
16  */
17 
18 #ifndef BOUNDARIES_H
19 #define BOUNDARIES_H
20 
21 //#include "mesh/mesh.h"
22 #include "mesh/mesh_types.hh"
23 #include "mesh/sides.h"
24 #include "mesh/edges.h"
25 #include "mesh/region.hh"
26 #include "system/sys_vector.hh"
27 
28 
29 
30 /**
31  * Setting boundary conditions should have two staps.
32  * 1) Denote by numbers segments of mesh boundary. Possibly every side can be boundary.
33  * 2) Assign particular type and values of BC on every boundary segment.
34  *
35  * So in future Boundary should keep only side and segment and there should be
36  * one Boundary for every external side. Side is external either when it does not
37  * neighbor with another element or when it belongs to an segment.
38  */
39 
40 class Element;
41 
42 //=============================================================================
43 // STRUCTURE OF THE BOUNDARY CONDITION
44 //=============================================================================
45 class Boundary
46 {
47 public:
48  /**
49  * temporary solution for old type BCD.
50  * Transport BCD refers through IDs to flow BCD, so we have to
51  * store positions of Flow BCD items somewhere.
52  */
54 
55  Boundary();
56 
57  /**
58  * Can not make this inline now.
59  */
60  Edge * edge();
61 
62  Element * element();
63 
64  Region region();
65 
67 
68 
69  inline SideIter side() {
70  if (edge()->n_sides != 1) xprintf(Err, "Using side method for boundary, but there is boundary with multiple sides.\n");
71  return edge()->side_[0];
72  }
73 
74  // Topology of the mesh
75  unsigned int edge_idx_; // more then one side can be at one boundary element
76  unsigned int bc_ele_idx_; // in near future this should replace Boundary itself, when we remove BC data members
78 
79 };
80 #endif
81 //-----------------------------------------------------------------------------
82 // vim: set cindent:
Definition: mesh.h:99
Definition: edges.h:26
Region region()
Definition: boundaries.cc:34
SideIter side()
Definition: boundaries.h:69
Edge * edge()
Definition: boundaries.cc:43
#define xprintf(...)
Definition: system.hh:92
Element * element()
Definition: boundaries.cc:39
unsigned int edge_idx_
Definition: boundaries.h:75
unsigned int bc_ele_idx_
Definition: boundaries.h:76
Vector classes to support both Iterator, index and Id access and creating co-located vectors...
Definition: system.hh:64
Mesh * mesh_
Definition: boundaries.h:77
SideIter * side_
Definition: edges.h:37
ElementAccessor< 3 > element_accessor()
Definition: boundaries.cc:47
static flow::VectorId< unsigned int > id_to_bcd
Definition: boundaries.h:53