aboutsummaryrefslogtreecommitdiff
path: root/src/vector.h
diff options
context:
space:
mode:
authorAdrian Kummerlaender2018-10-16 12:44:24 +0200
committerAdrian Kummerlaender2018-10-16 12:44:24 +0200
commit2bcbae122b141147e472bdbbad219c3571f71d0b (patch)
treee4e0f67dbe052708a8259da4247fa025d182efcf /src/vector.h
parentd1d96371a0d857bf874d6370c17595ffa0bfeaec (diff)
downloadboltzbub-2bcbae122b141147e472bdbbad219c3571f71d0b.tar
boltzbub-2bcbae122b141147e472bdbbad219c3571f71d0b.tar.gz
boltzbub-2bcbae122b141147e472bdbbad219c3571f71d0b.tar.bz2
boltzbub-2bcbae122b141147e472bdbbad219c3571f71d0b.tar.lz
boltzbub-2bcbae122b141147e472bdbbad219c3571f71d0b.tar.xz
boltzbub-2bcbae122b141147e472bdbbad219c3571f71d0b.tar.zst
boltzbub-2bcbae122b141147e472bdbbad219c3571f71d0b.zip
Implement moving wall / velocity Dirichlet boundary condition
Usable as both the inflow condition of the channel example and the top wall of a lid driven cavity.
Diffstat (limited to 'src/vector.h')
-rw-r--r--src/vector.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/vector.h b/src/vector.h
index 5e105c4..839707f 100644
--- a/src/vector.h
+++ b/src/vector.h
@@ -53,6 +53,11 @@ Vector<T> operator*(T scalar, const Vector<T>& v) {
}
template <typename T, typename W>
+decltype(T{}*W{}) operator*(const Vector<T>& a, const Vector<W>& b) {
+ return a[0]*b[0] + a[1]*b[1];
+}
+
+template <typename T, typename W>
Vector<T> operator-(const Vector<T>& a, const Vector<W>& b) {
return Vector<T>{
a[0] - b[0],