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