From 1c7a2dad4c5d686fdee53ea29e5edff49a1ec72a Mon Sep 17 00:00:00 2001 From: Oliver Sander <oliver.sander@tu-dresden.de> Date: Wed, 15 Jun 2022 14:13:15 +0200 Subject: [PATCH] Remove unused methods from algebra.cc --- dune/uggrid/gm/algebra.cc | 139 -------------------------------------- dune/uggrid/gm/algebra.h | 2 - dune/uggrid/gm/gm.h | 1 - 3 files changed, 142 deletions(-) diff --git a/dune/uggrid/gm/algebra.cc b/dune/uggrid/gm/algebra.cc index f2e04c59f..d19bda277 100644 --- a/dune/uggrid/gm/algebra.cc +++ b/dune/uggrid/gm/algebra.cc @@ -331,75 +331,6 @@ INT NS_DIM_PREFIX GetVectorsOfOType (const ELEMENT *theElement, INT type, INT *c RETURN (GM_ERROR); } -/****************************************************************************/ -/** \brief Remove vectors with non-matching type from list - - * @param dt - data type including all vtypes needed - * @param vec - vector list - * @param cnt - number of vectors return in the list - - This function removes vectors with non-matching types from the list. - - * @return - * Number of remaining vectors in the list - */ -/****************************************************************************/ - -INT NS_DIM_PREFIX DataTypeFilterVList (INT dt, VECTOR **vec, INT *cnt) -{ - INT i,n; - - n = *cnt; - *cnt = 0; - for (i=0; i<n; i++) - if (VDATATYPE(vec[i]) & dt) - vec[(*cnt)++] = vec[i]; - - return (*cnt); -} - -/****************************************************************************/ -/** \brief Get vector list including all vectors of specified vtypes - - * @param theElement - pointer to an element - * @param dt - data type including all vtypes needed - * @param obj - flags for objects types needed - * @param cnt - number of vectors return in the list - * @param vec - vector list - - This function gets a list of vectors of the specified vtypes corresponding to an element. - - * @return <ul> - * <li> GM_OK if ok </li> - * <li> GM_ERROR if error occured </li> - </ul> - */ -/****************************************************************************/ - -INT NS_DIM_PREFIX GetVectorsOfDataTypesInObjects (const ELEMENT *theElement, INT dt, INT obj, INT *cnt, VECTOR *VecList[]) -{ - INT n; - - *cnt = n = 0; - - #ifdef UG_DIM_3 - if (obj & BITWISE_TYPE(SIDEVEC)) - { - INT i; - if (GetVectorsOfSides(theElement,&i,VecList+n) != GM_OK) - return(GM_ERROR); - n += i; - } - #endif - - *cnt = n; - - /* remove vectors of types not needed */ - DataTypeFilterVList(dt,VecList,cnt); - - return (GM_OK); -} - /****************************************************************************/ /** \brief Get vector list @@ -483,43 +414,6 @@ INT NS_DIM_PREFIX GetElementInfoFromSideVector (const VECTOR *theVector, ELEMENT } #endif -/****************************************************************************/ -/** \brief Reset all USED flags in neighborhood of an element - - * @param theElement - given element - * @param ActDepth - recursion depth - * @param MaxDepth - end of recursion - - This function calls itself recursively and resets all USED flags in the - neighborhood of depth MaxDepth of theElement. For the first call - ActDepth should be zero. - - * @return <ul> - * <li> 0 if ok - * <li> 1 if error occured. - </ul> - */ -/****************************************************************************/ - -static INT ResetUsedFlagInNeighborhood (ELEMENT *theElement, INT ActDepth, INT MaxDepth) -{ - int i; - - /* is anything to do ? */ - if (theElement==NULL) return (0); - - /* action */ - if (ActDepth>=0) SETUSED(theElement,0); - - /* call all neighbors recursively */ - if (ActDepth<MaxDepth) - for (i=0; i<SIDES_OF_ELEM(theElement); i++) - if (ResetUsedFlagInNeighborhood(NBELEM(theElement,i),ActDepth+1,MaxDepth)) RETURN (1); - - return (0); -} - - #ifdef ModelP static int Gather_VectorVNew (DDD::DDDContext&, DDD_OBJ obj, void *data) { @@ -1106,39 +1000,6 @@ INT NS_DIM_PREFIX CheckAlgebra (GRID *theGrid) return(errors); } -/****************************************************************************/ -/** \brief Decide whether a vector corresponds to an element or not - - * @param theElement - pointer to element - * @param theVector - pointer to a vector - - This function decides whether a given vector belongs to the given element, or - one of its sides, edges or nodes. - - * @return <ul> - * <li> 0 if does not correspond </li> - * <li> 1 if does correspond. </li> - </ul> - */ -/****************************************************************************/ - -INT NS_DIM_PREFIX VectorInElement (ELEMENT *theElement, VECTOR *theVector) -{ -#ifdef UG_DIM_3 - VECTOR *vList[20]; - - if (VOTYPE(theVector) == SIDEVEC) - { - INT cnt; - GetVectorsOfSides(theElement,&cnt,vList); - for (INT i=0; i<cnt; i++) - if (vList[i]==theVector) RETURN(1); - } - #endif - - return (0); -} - /****************************************************************************/ /** \brief Calc coordinate position of vector diff --git a/dune/uggrid/gm/algebra.h b/dune/uggrid/gm/algebra.h index b11ec0b10..73bac100e 100644 --- a/dune/uggrid/gm/algebra.h +++ b/dune/uggrid/gm/algebra.h @@ -108,8 +108,6 @@ INT DisposeDoubledSideVector (GRID *theGrid, ELEMENT /*@{*/ INT GetVectorsOfSides (const ELEMENT *theElement, INT *cnt, VECTOR **vList); INT GetVectorsOfOType (const ELEMENT *theElement, INT type, INT *cnt, VECTOR **vList); -INT DataTypeFilterVList (INT dt, VECTOR **vec, INT *cnt); -INT GetVectorsOfDataTypesInObjects (const ELEMENT *theElement, INT dt, INT obj, INT *cnt, VECTOR *VecList[]); INT GetElementInfoFromSideVector (const VECTOR *theVector, ELEMENT **Elements, INT *Sides); /*@}*/ diff --git a/dune/uggrid/gm/gm.h b/dune/uggrid/gm/gm.h index 14115f317..2556732eb 100644 --- a/dune/uggrid/gm/gm.h +++ b/dune/uggrid/gm/gm.h @@ -2903,7 +2903,6 @@ INT GetSons (const ELEMENT *theEleme INT GetAllSons (const ELEMENT *theElement, ELEMENT *SonList[MAX_SONS]); #endif INT VectorPosition (const VECTOR *theVector, DOUBLE *position); -INT VectorInElement (ELEMENT *theElement, VECTOR *theVector); /* check */ #ifndef ModelP -- GitLab