From 8db9be496e6d23352a943702725e25f8183e3aa2 Mon Sep 17 00:00:00 2001 From: ageay Date: Fri, 23 Oct 2009 05:43:24 +0000 Subject: [PATCH] non conservative Interp 3D --- src/INTERP_KERNEL/PolyhedronIntersector.hxx | 63 -------------- src/INTERP_KERNEL/PolyhedronIntersector.txx | 94 --------------------- 2 files changed, 157 deletions(-) delete mode 100644 src/INTERP_KERNEL/PolyhedronIntersector.hxx delete mode 100644 src/INTERP_KERNEL/PolyhedronIntersector.txx diff --git a/src/INTERP_KERNEL/PolyhedronIntersector.hxx b/src/INTERP_KERNEL/PolyhedronIntersector.hxx deleted file mode 100644 index 4cf4fb4ee..000000000 --- a/src/INTERP_KERNEL/PolyhedronIntersector.hxx +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (C) 2007-2008 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// -#ifndef __POLYHEDRONINTERSECTOR_HXX__ -#define __POLYHEDRONINTERSECTOR_HXX__ - -#include "Intersector3DP0P0.hxx" -#include "SplitterTetra.hxx" -#include "NormalizedUnstructuredMesh.hxx" - -namespace INTERP_KERNEL -{ - - - /** - * \brief Class responsible for calculating intersection between a hexahedron target element and - * the source elements. - * - */ - template - class PolyhedronIntersector : public Intersector3DP0P0 - { - public: - static const int SPACEDIM=MyMeshType::MY_SPACEDIM; - static const int MESHDIM=MyMeshType::MY_MESHDIM; - typedef typename MyMeshType::MyConnType ConnType; - static const NumberingPolicy numPol=MyMeshType::My_numPol; - public: - - PolyhedronIntersector(const MyMeshType& targetMesh, const MyMeshType& srcMesh, SplittingPolicy policy = GENERAL_24); - - ~PolyhedronIntersector(); - - void intersectCells(ConnType targetCell, const std::vector& srcCells, MyMatrix& res); - - private: - void releaseArrays(); - private: - /// pointers to the SplitterTetra objects representing the tetrahedra - /// that result from the splitting of the hexahedron target cell - std::vector< SplitterTetra* > _tetra; - - SplitterTetra2 _split; - - }; -} - -#endif diff --git a/src/INTERP_KERNEL/PolyhedronIntersector.txx b/src/INTERP_KERNEL/PolyhedronIntersector.txx deleted file mode 100644 index 1d58f7a58..000000000 --- a/src/INTERP_KERNEL/PolyhedronIntersector.txx +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright (C) 2007-2008 CEA/DEN, EDF R&D -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// -#ifndef __POLYHEDRONINTERSECTOR_TXX__ -#define __POLYHEDRONINTERSECTOR_TXX__ - -#include "PolyhedronIntersector.hxx" -#include "Intersector3DP0P0.txx" -#include "MeshUtils.hxx" - -#include "SplitterTetra.txx" - -namespace INTERP_KERNEL -{ - - /** - * Constructor creating object from target cell global number - * The constructor first calculates the necessary nodes, - * (depending on the splitting policy) and then splits the hexahedron into - * tetrahedra, placing these in the internal vector _tetra. - * - * @param targetMesh mesh containing the target elements - * @param srcMesh mesh containing the source elements - * @param policy splitting policy to be used - */ - template - PolyhedronIntersector::PolyhedronIntersector(const MyMeshType& targetMesh, const MyMeshType& srcMesh, SplittingPolicy policy):Intersector3DP0P0(targetMesh,srcMesh),_split(targetMesh,srcMesh,policy) - { - } - - /** - * Destructor. - * Liberates the SplitterTetra objects and potential sub-node points that have been allocated. - * - */ - template - PolyhedronIntersector::~PolyhedronIntersector() - { - releaseArrays(); - } - - template - void PolyhedronIntersector::releaseArrays() - { - for(typename std::vector< SplitterTetra* >::iterator iter = _tetra.begin(); iter != _tetra.end(); ++iter) - delete *iter; - _split.releaseArrays(); - _tetra.clear(); - } - - /** - * Calculates the volume of intersection of an element in the source mesh and the target element - * represented by the object. - * The calculation is performed by calling the corresponding method for - * each SplitterTetra object created by the splitting. - * - * @param targetCell in C mode. - * @param srcCells in C mode. - * - */ - template - void PolyhedronIntersector::intersectCells(ConnType targetCell, const std::vector& srcCells, MyMatrix& res) - { - int nbOfNodesT=Intersector3D::_target_mesh.getNumberOfNodesOfElement(OTT::indFC(targetCell)); - releaseArrays(); - _split.splitTargetCell(targetCell,nbOfNodesT,_tetra); - for(typename std::vector::const_iterator iterCellS=srcCells.begin();iterCellS!=srcCells.end();iterCellS++) - { - double volume = 0.; - for(typename std::vector*>::iterator iter = _tetra.begin(); iter != _tetra.end(); ++iter) - volume += (*iter)->intersectSourceCell(*iterCellS); - if(volume!=0.) - res[targetCell].insert(std::make_pair(OTT::indFC(*iterCellS), volume)); - } - _split.releaseArrays(); - } -} - -#endif -- 2.39.2