Flow123d
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  // Data readed from boundary conditions files (REMOVE)
87  //int type; // Type of boundary condition
88  //double scalar; // Scalar - for Dirichlet's or Newton's type
89  //double flux; // Flux - for Neumann's type or source
90  //double sigma; // Sigma koef. - for Newton's type
91 
92  //int group; // Group of condition
93  // Topology of the mesh
94  unsigned int edge_idx_; // more then one side can be at one boundary element
95  unsigned int bc_ele_idx_; // in near future this should replace Boundary itself, when we remove BC data members
97 
98 };
99 /*
100 #define DIRICHLET 1
101 #define NEUMANN 2
102 #define NEWTON 3
103 */
104 
105 //void read_boundary(Mesh*, const string &boundary_filename);
106 
107 #endif
108 //-----------------------------------------------------------------------------
109 // vim: set cindent: