24#ifndef DUMUX_GEOMETRY_NORMAL_HH
25#define DUMUX_GEOMETRY_NORMAL_HH
28#include <dune/common/float_cmp.hh>
40 static_assert(Vector::size() > 1,
"normal expects a coordinate dimension > 1");
42 if constexpr (Vector::size() == 2)
43 return Vector({-v[1], v[0]});
45 const auto it = std::find_if(v.begin(), v.end(), [](
const auto& x) { return Dune::FloatCmp::ne(x, 0.0); });
47 if (index != Vector::size()-1)
50 normal[index] = -v[index+1];
51 normal[index+1] = v[index];
57 normal[index-1] = -v[index];
58 normal[index] = v[index-1];
static ctype distance(const Dune::FieldVector< ctype, dimWorld > &a, const Dune::FieldVector< ctype, dimWorld > &b)
Compute the shortest distance between two points.
Definition: distance.hh:294
Vector normal(const Vector &v)
Create a vector normal to the given one (v is expected to be non-zero)
Definition: normal.hh:38
Vector unitNormal(const Vector &v)
Create a vector normal to the given one (v is expected to be non-zero)
Definition: normal.hh:70
Adaption of the non-isothermal two-phase two-component flow model to problems with CO2.
Definition: adapt.hh:29