From 68679548e240e0ab0f198c9ad2ddd8684cb4f638 Mon Sep 17 00:00:00 2001
From: webmanue <manuel.weberndorfer@id.ethz.ch>
Date: Mon, 24 Jan 2022 14:12:54 +0000
Subject: [PATCH] conditionally check base mesh

- disable check if AE108_CPPPETSC_DISABLE_BASE_MESH_CHECK is defined
---
 cpppetsc/src/include/ae108/cpppetsc/Mesh.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/cpppetsc/src/include/ae108/cpppetsc/Mesh.h b/cpppetsc/src/include/ae108/cpppetsc/Mesh.h
index 127ca7fa..31b64720 100644
--- a/cpppetsc/src/include/ae108/cpppetsc/Mesh.h
+++ b/cpppetsc/src/include/ae108/cpppetsc/Mesh.h
@@ -673,7 +673,7 @@ Mesh<Policy>::fromCanonicalOrder(const distributed<vector_type> &vector) const {
 
 template <class Policy>
 void Mesh<Policy>::assertCorrectBaseMesh(const vector_type &vector) const {
-#ifndef NDEBUG
+#if !defined(NDEBUG) && !defined(AE108_CPPPETSC_DISABLE_BASE_MESH_CHECK)
   const auto extractDM = [](const vector_type &vector) {
     auto dm = DM{};
     Policy::handleError(VecGetDM(vector.data(), &dm));
@@ -687,4 +687,4 @@ void Mesh<Policy>::assertCorrectBaseMesh(const vector_type &vector) const {
 #endif
 }
 } // namespace cpppetsc
-} // namespace ae108
\ No newline at end of file
+} // namespace ae108
-- 
GitLab