41 #ifndef DTK_CLOUDDOMAIN_IMPL_HPP 42 #define DTK_CLOUDDOMAIN_IMPL_HPP 56 Teuchos::Array<double> zero( 2 * DIM, 0.0 );
57 std::copy( zero.begin(), zero.end(), d_bounds );
69 std::copy( bounds, bounds + 2 * DIM, d_bounds );
79 DTK_CHECK( radius >= 0.0 );
80 d_bounds[0] -= radius;
81 d_bounds[1] += radius;
91 DTK_CHECK( radius >= 0.0 );
92 d_bounds[0] -= radius;
93 d_bounds[1] += radius;
94 d_bounds[2] -= radius;
95 d_bounds[3] += radius;
105 DTK_CHECK( radius >= 0.0 );
106 d_bounds[0] -= radius;
107 d_bounds[1] += radius;
108 d_bounds[2] -= radius;
109 d_bounds[3] += radius;
110 d_bounds[4] -= radius;
111 d_bounds[5] += radius;
125 const Teuchos::ArrayView<const double> &coords )
const 127 DTK_REQUIRE( coords.size() == 1 );
128 DTK_CHECK( d_bounds[0] <= d_bounds[1] );
130 return ( coords[0] >= d_bounds[0] && coords[0] <= d_bounds[1] ) ?
true 145 const Teuchos::ArrayView<const double> &coords )
const 147 DTK_REQUIRE( coords.size() == 2 );
148 DTK_CHECK( d_bounds[0] <= d_bounds[1] );
149 DTK_CHECK( d_bounds[2] <= d_bounds[3] );
151 return ( coords[0] >= d_bounds[0] && coords[0] <= d_bounds[1] &&
152 coords[1] >= d_bounds[2] && coords[1] <= d_bounds[3] )
168 const Teuchos::ArrayView<const double> &coords )
const 170 DTK_REQUIRE( coords.size() == 3 );
171 DTK_CHECK( d_bounds[0] <= d_bounds[1] );
172 DTK_CHECK( d_bounds[2] <= d_bounds[3] );
173 DTK_CHECK( d_bounds[4] <= d_bounds[5] );
175 return ( coords[0] >= d_bounds[0] && coords[0] <= d_bounds[1] &&
176 coords[1] >= d_bounds[2] && coords[1] <= d_bounds[3] &&
177 coords[2] >= d_bounds[4] && coords[2] <= d_bounds[5] )
193 Teuchos::ArrayView<const double> bounds = domain.bounds();
195 return !( ( d_bounds[0] > bounds[1] || d_bounds[1] < bounds[0] ) );
209 Teuchos::ArrayView<const double> bounds = domain.bounds();
211 return !( ( d_bounds[0] > bounds[1] || d_bounds[1] < bounds[0] ) ||
212 ( d_bounds[2] > bounds[3] || d_bounds[3] < bounds[2] ) );
226 Teuchos::ArrayView<const double> bounds = domain.bounds();
228 return !( ( d_bounds[0] > bounds[1] || d_bounds[1] < bounds[0] ) ||
229 ( d_bounds[2] > bounds[3] || d_bounds[3] < bounds[2] ) ||
230 ( d_bounds[4] > bounds[5] || d_bounds[5] < bounds[4] ) );
240 DTK_CHECK( d_bounds[0] <= d_bounds[1] );
241 return Teuchos::Array<double>( 1, ( d_bounds[1] + d_bounds[0] ) / 2.0 );
251 DTK_CHECK( d_bounds[0] <= d_bounds[1] );
252 DTK_CHECK( d_bounds[2] <= d_bounds[3] );
254 Teuchos::Array<double> center( 2 );
255 center[0] = ( d_bounds[1] + d_bounds[0] ) / 2.0;
256 center[1] = ( d_bounds[3] + d_bounds[2] ) / 2.0;
267 DTK_CHECK( d_bounds[0] <= d_bounds[1] );
268 DTK_CHECK( d_bounds[2] <= d_bounds[3] );
269 DTK_CHECK( d_bounds[4] <= d_bounds[5] );
271 Teuchos::Array<double> center( 3 );
272 center[0] = ( d_bounds[1] + d_bounds[0] ) / 2.0;
273 center[1] = ( d_bounds[3] + d_bounds[2] ) / 2.0;
274 center[2] = ( d_bounds[5] + d_bounds[4] ) / 2.0;
282 #endif // end DTK_CLOUDDOMAIN_IMPL_HPP CloudDomain()
Default constructor.
Assertions and Design-by-Contract for error handling.
Axis-aligned Cartesian cloud domain container.
Cloud domain declaration.