From 0bdd151e780da31d41f155d5c61c1918a44e8099 Mon Sep 17 00:00:00 2001 From: Oliver Sander <oliver.sander@tu-dresden.de> Date: Wed, 29 Jan 2020 13:21:30 +0100 Subject: [PATCH] Simplify evaluation of boundary type predicates The predicates do implement operator(), so let's use that. --- src/film-on-substrate.cc | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/film-on-substrate.cc b/src/film-on-substrate.cc index 2563efa5..dbd81056 100644 --- a/src/film-on-substrate.cc +++ b/src/film-on-substrate.cc @@ -230,16 +230,13 @@ int main (int argc, char *argv[]) try PythonFunction<FieldVector<double,dim>, bool> pythonSurfaceShellVertices(Python::evaluate(lambda)); for (auto&& v : vertices(gridView)) { - bool isDirichlet; - pythonDirichletVertices.evaluate(v.geometry().corner(0), isDirichlet); + bool isDirichlet = pythonDirichletVertices(v.geometry().corner(0)); dirichletVertices[indexSet.index(v)] = isDirichlet; - bool isNeumann; - pythonNeumannVertices.evaluate(v.geometry().corner(0), isNeumann); + bool isNeumann = pythonNeumannVertices(v.geometry().corner(0)); neumannVertices[indexSet.index(v)] = isNeumann; - bool isSurfaceShell; - pythonSurfaceShellVertices.evaluate(v.geometry().corner(0), isSurfaceShell); + bool isSurfaceShell = pythonSurfaceShellVertices(v.geometry().corner(0)); surfaceShellVertices[indexSet.index(v)] = isSurfaceShell; } -- GitLab