switch (structdim)
{
case 1:
- return std::sqrt((this->vertex(1)-this->vertex(0)).square());
+ return (this->vertex(1)-this->vertex(0)).norm();
case 2:
- return std::sqrt(std::max((this->vertex(3)-this->vertex(0)).square(),
- (this->vertex(2)-this->vertex(1)).square()));
+ return std::max((this->vertex(3)-this->vertex(0)).norm(),
+ (this->vertex(2)-this->vertex(1)).norm());
case 3:
- return std::sqrt(std::max( std::max((this->vertex(7)-this->vertex(0)).square(),
- (this->vertex(6)-this->vertex(1)).square()),
- std::max((this->vertex(2)-this->vertex(5)).square(),
- (this->vertex(3)-this->vertex(4)).square()) ));
+ return std::max( std::max((this->vertex(7)-this->vertex(0)).norm(),
+ (this->vertex(6)-this->vertex(1)).norm()),
+ std::max((this->vertex(2)-this->vertex(5)).norm(),
+ (this->vertex(3)-this->vertex(4)).norm()) );
default:
Assert (false, ExcNotImplemented());
return -1e10;
switch (structdim)
{
case 1:
- return std::sqrt((this->vertex(1)-this->vertex(0)).square());
+ return (this->vertex(1)-this->vertex(0)).norm();
case 2:
case 3:
{
double min = std::numeric_limits<double>::max();
for (unsigned int i=0; i<GeometryInfo<structdim>::vertices_per_cell; ++i)
for (unsigned int j=i+1; j<GeometryInfo<structdim>::vertices_per_cell; ++j)
- min = std::min(min, (this->vertex(i)-this->vertex(j)).square());
+ min = std::min(min, (this->vertex(i)-this->vertex(j)) * (this->vertex(i)-this->vertex(j)));
return std::sqrt(min);
}
default: