ug4
domain_util.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2010-2015: G-CSC, Goethe University Frankfurt
3  * Authors: Sebastian Reiter, Andreas Vogel, Jan Friebertshäuser
4  *
5  * This file is part of UG4.
6  *
7  * UG4 is free software: you can redistribute it and/or modify it under the
8  * terms of the GNU Lesser General Public License version 3 (as published by the
9  * Free Software Foundation) with the following additional attribution
10  * requirements (according to LGPL/GPL v3 §7):
11  *
12  * (1) The following notice must be displayed in the Appropriate Legal Notices
13  * of covered and combined works: "Based on UG4 (www.ug4.org/license)".
14  *
15  * (2) The following notice must be displayed at a prominent place in the
16  * terminal output of covered works: "Based on UG4 (www.ug4.org/license)".
17  *
18  * (3) The following bibliography is recommended for citation and must be
19  * preserved in all covered files:
20  * "Reiter, S., Vogel, A., Heppner, I., Rupp, M., and Wittum, G. A massively
21  * parallel geometric multigrid solver on hierarchically distributed grids.
22  * Computing and visualization in science 16, 4 (2013), 151-164"
23  * "Vogel, A., Reiter, S., Rupp, M., Nägel, A., and Wittum, G. UG4 -- a novel
24  * flexible software system for simulating pde based models on high performance
25  * computers. Computing and visualization in science 16, 4 (2013), 165-179"
26  *
27  * This program is distributed in the hope that it will be useful,
28  * but WITHOUT ANY WARRANTY; without even the implied warranty of
29  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30  * GNU Lesser General Public License for more details.
31  */
32 
33 #ifndef __H__UG__LIB_DISC__DOMAIN_UTIL__
34 #define __H__UG__LIB_DISC__DOMAIN_UTIL__
35 
36 // other lib_discretization headers
37 #include "domain.h"
38 
39 namespace ug{
40 
43 
45 
50 template <typename TDomain>
51 void LoadDomain(TDomain& domain, const char* filename);
52 
53 template <typename TDomain>
54 void LoadDomain(TDomain& domain, const char* filename, int procId);
58 template <typename TDomain>
59 void SaveDomain(TDomain& domain, const char* filename);
60 
61 
64 
74 template <typename TElem, typename TAAPos>
75 void CollectCornerCoordinates( std::vector<typename TAAPos::ValueType>& vCornerCoordsOut,
76  const TElem& elem, const TAAPos& aaPos,
77  bool clearContainer = true);
78 
79 
82 
92 template <typename TElem, typename TDomain>
93 void CollectCornerCoordinates( std::vector<typename TDomain::position_type>& vCornerCoordsOut,
94  const TElem& elem, const TDomain& domain,
95  bool clearContainer = true);
96 
100 
110 template <typename TDomain>
111 void CollectCornerCoordinates(int base_object_id,
112  std::vector<typename TDomain::position_type>& vCornerCoordsOut,
113  GridObject& elem, const TDomain& domain, bool clearContainer);
114 
117 
125 template <typename TElem, typename TPosition>
126 number ElementSize(const TElem& elem,
127  const Grid::VertexAttachmentAccessor<Attachment<TPosition> >& aaPos);
128 
131 
139 template <typename TElem, typename TDomain>
140 number ElementSize(const TElem& elem, const TDomain& domain);
141 
143 // ElementDiameter
145 template <typename TElem, typename TDomain>
146 number ElementDiameterSq(const TElem& elem, TDomain& domain);
147 
149 template <typename TElem, typename TDomain>
150 number ElementDiameter(const TElem& elem, TDomain& domain);
151 
153 template <typename TDomain>
154 number MaxElementDiameter(TDomain& domain, int level);
155 
157 template <typename TDomain>
158 number MinElementDiameter(TDomain& domain, int level);
159 
160 // end group lib_disc_domain
162 
163 } // end namespace ug
164 
166 // include implementation
167 #include "domain_util_impl.h"
168 
169 #endif /* __H__UG__LIB_DISC__DOMAIN_UTIL__ */
number ElementDiameter(const TElem &elem, TDomain &domain)
returns the maximal distance between to element vertices
void SaveDomain(TDomain &domain, const char *filename)
Saves the domain to a grid-file.
Definition: domain_util.cpp:79
number ElementDiameterSq(const TElem &elem, TDomain &domain)
returns the maximal squared distance between to element vertices
number MinElementDiameter(TDomain &domain, int level)
returns the minimal diameter of all elements between iterBegin and iterEnd.
Definition: domain_util.cpp:113
number MaxElementDiameter(TDomain &domain, int level)
returns the maximal diameter of all elements between iterBegin and iterEnd.
Definition: domain_util.cpp:104
void LoadDomain(TDomain &domain, const char *filename)
Loads a domain from a grid-file.
Definition: domain_util.cpp:48
void CollectCornerCoordinates(std::vector< typename TAAPos::ValueType > &vCornerCoordsOut, const TElem &elem, const TAAPos &aaPos, bool clearContainer=true)
returns the corner coordinates of a geometric object
Definition: domain_util_impl.h:75
double number
Definition: types.h:124
the ug namespace
number ElementSize(const MathVector< TWorldDim > *vCornerCoords)
Volume of an Element in a given Dimension.