42 #if !defined(Intrepid_MiniTensor_Geometry_i_h) 43 #define Intrepid_MiniTensor_Geometry_i_h 55 find_type_1D(Index
const nodes)
58 case 2:
return ELEMENT::SEGMENTAL;
59 default:
return ELEMENT::UNKNOWN;
65 find_type_2D(Index
const nodes)
68 case 3:
return ELEMENT::TRIANGULAR;
69 case 4:
return ELEMENT::QUADRILATERAL;
70 default:
return ELEMENT::UNKNOWN;
76 find_type_3D(Index
const nodes)
79 case 4:
return ELEMENT::TETRAHEDRAL;
80 case 8:
return ELEMENT::HEXAHEDRAL;
81 default:
return ELEMENT::UNKNOWN;
93 find_type(Index
const dimension, Index
const number_nodes)
97 type = ELEMENT::UNKNOWN;
102 type = find_type_1D(number_nodes);
106 type = find_type_2D(number_nodes);
110 type = find_type_3D(number_nodes);
118 if (type == ELEMENT::UNKNOWN) {
119 std::cerr <<
"ERROR: " << __PRETTY_FUNCTION__;
120 std::cerr << std::endl;
121 std::cerr <<
"Unknown element type." << std::endl;
122 std::cerr << std::endl;
123 std::cerr <<
"Spatial dimension: ";
124 std::cerr << dimension << std::endl;
125 std::cerr <<
"Vertices per element: ";
126 std::cerr << number_nodes << std::endl;
141 minimum_ = std::numeric_limits<T>::max();
142 maximum_ = std::numeric_limits<T>::min();
160 theta = parameters(1);
163 normal(sin(phi) * sin(theta), cos(phi), sin(phi) * cos(theta));
167 Q = dot(normal, dot(tangent_, normal));
170 determinant = det(Q);
172 if (determinant < minimum_) {
173 minimum_ = determinant;
174 arg_minimum_ = parameters;
177 if (determinant > maximum_) {
178 maximum_ = determinant;
179 arg_maximum_ = parameters;
193 minimum_ = std::numeric_limits<T>::max();
194 maximum_ = std::numeric_limits<T>::min();
218 normal(2.0 * x, 2.0 * y, r2 - 1.0);
220 normal /= (r2 + 1.0);
224 Q = dot(normal, dot(tangent_, normal));
227 determinant = det(Q);
229 if (determinant < minimum_) {
230 minimum_ = determinant;
231 arg_minimum_ = parameters;
234 if (determinant > maximum_) {
235 maximum_ = determinant;
236 arg_maximum_ = parameters;
250 minimum_ = std::numeric_limits<T>::max();
251 maximum_ = std::numeric_limits<T>::min();
275 lambda = parameters(3);
282 Q = dot(normal, dot(tangent_, normal));
285 determinant = det(Q);
288 function = determinant + lambda * (x * x + y * y + z * z - 1.0);
290 if (
function < minimum_) {
292 arg_minimum_ = parameters;
295 if (
function > maximum_) {
297 arg_maximum_ = parameters;
311 minimum_ = std::numeric_limits<T>::max();
312 maximum_ = std::numeric_limits<T>::min();
333 r = std::sqrt(x * x + y * y);
339 normal(0) = x * sin(r) / r;
340 normal(1) = y * sin(r) / r;
346 Q = dot(normal, dot(tangent_, normal));
349 determinant = det(Q);
351 if (determinant < minimum_) {
352 minimum_ = determinant;
353 arg_minimum_ = parameters;
356 if (determinant > maximum_) {
357 maximum_ = determinant;
358 arg_maximum_ = parameters;
372 minimum_ = std::numeric_limits<T>::max();
373 maximum_ = std::numeric_limits<T>::min();
401 Q = dot(normal, dot(tangent_, normal));
404 determinant = det(Q);
406 if (determinant < minimum_) {
407 minimum_ = determinant;
408 arg_minimum_ = parameters;
411 if (determinant > maximum_) {
412 maximum_ = determinant;
413 arg_maximum_ = parameters;
434 points_per_dimension_ = points_per_dimension;
443 template<
typename Visitor>
450 number_parameters = lower_.get_dimension();
453 total_number_points = 1;
455 for (Index dimension = 0; dimension < number_parameters; ++dimension) {
456 total_number_points *= points_per_dimension_(dimension);
462 steps(number_parameters, ONES);
464 for (Index dimension = 1; dimension < number_parameters; ++dimension) {
466 steps(dimension - 1) * points_per_dimension_(dimension - 1);
473 indices(number_parameters, ZEROS);
476 position_in_grid(number_parameters, ZEROS);
479 span = upper_ - lower_;
481 for (LongCount point = 1; point <= total_number_points; ++point) {
485 for (Index dimension = 0; dimension < number_parameters; ++dimension) {
487 position_in_grid(dimension) = indices(dimension) * span(dimension) /
488 (points_per_dimension_(dimension) - 1) + lower_(dimension);
490 visitor(position_in_grid);
495 if (point % steps(dimension) == 0) {
496 ++indices(dimension);
498 if (indices(dimension) == points_per_dimension_(dimension)) {
499 indices(dimension) = 0;
514 #endif // Intrepid_MiniTensor_Geometry_i_h
StereographicParametrization(Tensor4< T > const &A=Tensor4< T >())
SphericalParametrization(Tensor4< T > const &A=Tensor4< T >())
Index get_dimension() const
CartesianParametrization(Tensor4< T > const &A=Tensor4< T >())
TangentParametrization(Tensor4< T > const &A=Tensor4< T >())
ProjectiveParametrization(Tensor4< T > const &A=Tensor4< T >())