Flow123d  jenkins-Flow123d-windows-release-multijob-285
boundaries.h
Go to the documentation of this file.
1 /*!
2  *
3  * Copyright (C) 2007 Technical University of Liberec. All rights reserved.
4  *
5  * Please make a following refer to Flow123d on your project site if you use the program for any purpose,
6  * especially for academic research:
7  * Flow123d, Research Centre: Advanced Remedial Technologies, Technical University of Liberec, Czech Republic
8  *
9  * This program is free software; you can redistribute it and/or modify it under the terms
10  * of the GNU General Public License version 3 as published by the Free Software Foundation.
11  *
12  * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
13  * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14  * See the GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License along with this program; if not,
17  * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 021110-1307, USA.
18  *
19  *
20  * $Id$
21  * $Revision$
22  * $LastChangedBy$
23  * $LastChangedDate$
24  *
25  * @file
26  * @brief ???
27  *
28  */
29 
30 #ifndef BOUNDARIES_H
31 #define BOUNDARIES_H
32 
33 //#include "mesh/mesh.h"
34 #include "mesh/sides.h"
35 #include "mesh/edges.h"
36 #include "system/sys_vector.hh"
37 
38 
39 
40 /**
41  * Setting boundary conditions should have two staps.
42  * 1) Denote by numbers segments of mesh boundary. Possibly every side can be boundary.
43  * 2) Assign particular type and values of BC on every boundary segment.
44  *
45  * So in future Boundary should keep only side and segment and there should be
46  * one Boundary for every external side. Side is external either when it does not
47  * neighbor with another element or when it belongs to an segment.
48  */
49 
50 class Element;
51 
52 //=============================================================================
53 // STRUCTURE OF THE BOUNDARY CONDITION
54 //=============================================================================
55 class Boundary
56 {
57 public:
58  /**
59  * temporary solution for old type BCD.
60  * Transport BCD refers through IDs to flow BCD, so we have to
61  * store positions of Flow BCD items somewhere.
62  */
64 
65  Boundary();
66 
67  /**
68  * Can not make this inline now.
69  */
70  Edge * edge();
71 
72  Element * element();
73 
75  return element()->region();
76  }
77 
79 
80 
81  inline SideIter side() {
82  if (edge()->n_sides != 1) xprintf(Err, "Using side method for boundary, but there is boundary with multiple sides.\n");
83  return edge()->side_[0];
84  }
85 
86  // Topology of the mesh
87  unsigned int edge_idx_; // more then one side can be at one boundary element
88  unsigned int bc_ele_idx_; // in near future this should replace Boundary itself, when we remove BC data members
90 
91 };
92 #endif
93 //-----------------------------------------------------------------------------
94 // vim: set cindent:
Definition: mesh.h:109
Definition: edges.h:38
Region region()
Definition: boundaries.h:74
SideIter side()
Definition: boundaries.h:81
Edge * edge()
Definition: boundaries.cc:51
Region region() const
Definition: elements.cc:167
#define xprintf(...)
Definition: system.hh:100
Element * element()
Definition: boundaries.cc:47
unsigned int edge_idx_
Definition: boundaries.h:87
unsigned int bc_ele_idx_
Definition: boundaries.h:88
Vector classes to support both Iterator, index and Id access and creating co-located vectors...
Definition: system.hh:72
Mesh * mesh_
Definition: boundaries.h:89
SideIter * side_
Definition: edges.h:49
ElementAccessor< 3 > element_accessor()
Definition: boundaries.cc:55
static flow::VectorId< unsigned int > id_to_bcd
Definition: boundaries.h:63