From 2c5c3f642b397f9670b9c478848c84abb6b3ead6 Mon Sep 17 00:00:00 2001 From: gdd Date: Tue, 16 Oct 2012 14:18:59 +0000 Subject: [PATCH] Quadratic mesh and viscous layer not compatible --- src/BLSURFPlugin/BLSURFPlugin_BLSURF.cxx | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/BLSURFPlugin/BLSURFPlugin_BLSURF.cxx b/src/BLSURFPlugin/BLSURFPlugin_BLSURF.cxx index 6a91546..c9b964a 100644 --- a/src/BLSURFPlugin/BLSURFPlugin_BLSURF.cxx +++ b/src/BLSURFPlugin/BLSURFPlugin_BLSURF.cxx @@ -1431,7 +1431,8 @@ bool BLSURFPlugin_BLSURF::Compute(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape) SMESH_MesherHelper helper( aMesh ); // do not call helper.IsQuadraticSubMesh() because sub-meshes // may be cleaned and helper.myTLinkNodeMap gets invalid in such a case - const bool haveQuadraticSubMesh = SMESH_MesherHelper( aMesh ).IsQuadraticSubMesh( aShape ); + bool haveQuadraticSubMesh = SMESH_MesherHelper( aMesh ).IsQuadraticSubMesh( aShape ); + bool quadraticSubMeshAndViscousLayer = false; bool needMerge = false; set< SMESHDS_SubMesh* > edgeSubmeshes, proxySubmeshes; set< SMESHDS_SubMesh* >& mergeSubmeshes = edgeSubmeshes; @@ -1500,8 +1501,19 @@ bool BLSURFPlugin_BLSURF::Compute(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape) _hypothesis, css, pcs, aMesh, &use_precad); MESSAGE("END SetParameters"); - helper.SetIsQuadratic( haveQuadraticSubMesh || (_hypothesis != NULL && _hypothesis->GetQuadraticMesh()) ); + haveQuadraticSubMesh = haveQuadraticSubMesh || (_hypothesis != NULL && _hypothesis->GetQuadraticMesh()); + helper.SetIsQuadratic( haveQuadraticSubMesh ); + // To remove as soon as quadratic mesh is allowed - BEGIN + // GDD: Viscous layer is not allowed with quadratic mesh + if (_haveViscousLayers && haveQuadraticSubMesh ) { + quadraticSubMeshAndViscousLayer = true; + _haveViscousLayers = !haveQuadraticSubMesh; + _comment += "Warning: Viscous layer is not possible with a quadratic mesh, it is ignored."; + error(COMPERR_WARNING, _comment); + } + // To remove as soon as quadratic mesh is allowed - END + // needed to prevent the opencascade memory managmement from freeing things vector curves; vector surfaces; @@ -2399,7 +2411,7 @@ bool BLSURFPlugin_BLSURF::Compute(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape) */ MESSAGE("END OF BLSURFPlugin_BLSURF::Compute()"); - return ( status == STATUS_OK ); + return ( status == STATUS_OK && !quadraticSubMeshAndViscousLayer ); } //================================================================================ -- 2.39.2