Skip to content
Snippets Groups Projects
Commit 4ff268a4 authored by Oliver Sander's avatar Oliver Sander
Browse files

Merge branch 'more-modernization' into 'master'

More modernization

See merge request !203
parents 0f8bf1a1 22c52392
No related branches found
No related tags found
1 merge request!203More modernization
Pipeline #46060 passed
...@@ -331,75 +331,6 @@ INT NS_DIM_PREFIX GetVectorsOfOType (const ELEMENT *theElement, INT type, INT *c ...@@ -331,75 +331,6 @@ INT NS_DIM_PREFIX GetVectorsOfOType (const ELEMENT *theElement, INT type, INT *c
RETURN (GM_ERROR); 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 /** \brief Get vector list
...@@ -483,43 +414,6 @@ INT NS_DIM_PREFIX GetElementInfoFromSideVector (const VECTOR *theVector, ELEMENT ...@@ -483,43 +414,6 @@ INT NS_DIM_PREFIX GetElementInfoFromSideVector (const VECTOR *theVector, ELEMENT
} }
#endif #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 #ifdef ModelP
static int Gather_VectorVNew (DDD::DDDContext&, DDD_OBJ obj, void *data) static int Gather_VectorVNew (DDD::DDDContext&, DDD_OBJ obj, void *data)
{ {
...@@ -1106,39 +1000,6 @@ INT NS_DIM_PREFIX CheckAlgebra (GRID *theGrid) ...@@ -1106,39 +1000,6 @@ INT NS_DIM_PREFIX CheckAlgebra (GRID *theGrid)
return(errors); 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 /** \brief Calc coordinate position of vector
......
...@@ -108,8 +108,6 @@ INT DisposeDoubledSideVector (GRID *theGrid, ELEMENT ...@@ -108,8 +108,6 @@ INT DisposeDoubledSideVector (GRID *theGrid, ELEMENT
/*@{*/ /*@{*/
INT GetVectorsOfSides (const ELEMENT *theElement, INT *cnt, VECTOR **vList); INT GetVectorsOfSides (const ELEMENT *theElement, INT *cnt, VECTOR **vList);
INT GetVectorsOfOType (const ELEMENT *theElement, INT type, 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); INT GetElementInfoFromSideVector (const VECTOR *theVector, ELEMENT **Elements, INT *Sides);
/*@}*/ /*@}*/
......
...@@ -71,18 +71,6 @@ ...@@ -71,18 +71,6 @@
# include <dune/uggrid/parallel/ddd/dddcontext.hh> # include <dune/uggrid/parallel/ddd/dddcontext.hh>
#endif #endif
/****************************************************************************/
/* */
/* consistency of commandline defines */
/* */
/****************************************************************************/
#ifdef UG_DIM_2
#ifdef Sideon
#error **** two dimensional case cannot have side data ****
#endif
#endif
/****************************************************************************/ /****************************************************************************/
/* */ /* */
/* derive additional switches from commandline specified basic switches */ /* derive additional switches from commandline specified basic switches */
...@@ -160,11 +148,7 @@ enum {MAX_SONS = 30}; ...@@ -160,11 +148,7 @@ enum {MAX_SONS = 30};
#define MAX_SIDE_NODES 9 #define MAX_SIDE_NODES 9
/** \brief max number of son edges of edge */ /** \brief max number of son edges of edge */
#define MAX_SON_EDGES 2 #define MAX_SON_EDGES 2
/** \brief max #fine sides touching a coarse*/
#define MAX_SIDES_TOUCHING 10
/** \todo Please doc me! */
#define MAX_ELEM_VECTORS (MAX_CORNERS_OF_ELEM+MAX_EDGES_OF_ELEM+1+MAX_SIDES_OF_ELEM)
/** \brief max number of doubles in a vector or matrix mod 32 */ /** \brief max number of doubles in a vector or matrix mod 32 */
#define MAX_NDOF_MOD_32 256 #define MAX_NDOF_MOD_32 256
/** \brief max number of doubles in a vector or matrix */ /** \brief max number of doubles in a vector or matrix */
...@@ -2919,7 +2903,6 @@ INT GetSons (const ELEMENT *theEleme ...@@ -2919,7 +2903,6 @@ INT GetSons (const ELEMENT *theEleme
INT GetAllSons (const ELEMENT *theElement, ELEMENT *SonList[MAX_SONS]); INT GetAllSons (const ELEMENT *theElement, ELEMENT *SonList[MAX_SONS]);
#endif #endif
INT VectorPosition (const VECTOR *theVector, DOUBLE *position); INT VectorPosition (const VECTOR *theVector, DOUBLE *position);
INT VectorInElement (ELEMENT *theElement, VECTOR *theVector);
/* check */ /* check */
#ifndef ModelP #ifndef ModelP
......
...@@ -218,7 +218,7 @@ static void VectorUpdate (DDD::DDDContext& context, DDD_OBJ obj) ...@@ -218,7 +218,7 @@ static void VectorUpdate (DDD::DDDContext& context, DDD_OBJ obj)
VECTOR *pv = (VECTOR *)obj; VECTOR *pv = (VECTOR *)obj;
INT level = ATTR_TO_GLEVEL(DDD_InfoAttr(PARHDR(pv))); INT level = ATTR_TO_GLEVEL(DDD_InfoAttr(PARHDR(pv)));
GRID *theGrid = GRID_ON_LEVEL(ddd_ctrl(context).currMG,level); GRID *theGrid = GRID_ON_LEVEL(ddd_ctrl(context).currMG,level);
INT prio = PRIO(pv); const DDD_PRIO prio = PRIO(pv);
PRINTDEBUG(dddif,1,(PFMT " VectorUpdate(): v=" VINDEX_FMTX PRINTDEBUG(dddif,1,(PFMT " VectorUpdate(): v=" VINDEX_FMTX
" VEOBJ=%d\n",me,VINDEX_PRTX(pv),OBJT(pv))) " VEOBJ=%d\n",me,VINDEX_PRTX(pv),OBJT(pv)))
...@@ -231,12 +231,8 @@ static void VectorUpdate (DDD::DDDContext& context, DDD_OBJ obj) ...@@ -231,12 +231,8 @@ static void VectorUpdate (DDD::DDDContext& context, DDD_OBJ obj)
static void VectorXferCopy(DDD::DDDContext& context, DDD_OBJ obj, DDD_PROC proc, DDD_PRIO prio) static void VectorXferCopy(DDD::DDDContext& context, DDD_OBJ obj, DDD_PROC proc, DDD_PRIO prio)
{ {
INT nmat = 0;
VECTOR *pv = (VECTOR *)obj; VECTOR *pv = (VECTOR *)obj;
INT level = ATTR_TO_GLEVEL(DDD_InfoAttr(PARHDR(pv))); INT level = ATTR_TO_GLEVEL(DDD_InfoAttr(PARHDR(pv)));
/* TODO: define this static global */
/* TODO: take size as maximum of possible connections */
size_t sizeArray[256];
INT flag; INT flag;
PRINTDEBUG(dddif,1,(PFMT " VectorXferCopy(): v=" VINDEX_FMTX " proc=%d " PRINTDEBUG(dddif,1,(PFMT " VectorXferCopy(): v=" VINDEX_FMTX " proc=%d "
...@@ -272,7 +268,7 @@ static void VectorPriorityUpdate (DDD::DDDContext& context, DDD_OBJ obj, DDD_PRI ...@@ -272,7 +268,7 @@ static void VectorPriorityUpdate (DDD::DDDContext& context, DDD_OBJ obj, DDD_PRI
VECTOR *pv = (VECTOR *)obj; VECTOR *pv = (VECTOR *)obj;
INT level = ATTR_TO_GLEVEL(DDD_InfoAttr(PARHDR(pv))); INT level = ATTR_TO_GLEVEL(DDD_InfoAttr(PARHDR(pv)));
GRID *theGrid = GRID_ON_LEVEL(ddd_ctrl(context).currMG,level); GRID *theGrid = GRID_ON_LEVEL(ddd_ctrl(context).currMG,level);
INT old = PRIO(pv); DDD_PRIO old = PRIO(pv);
PRINTDEBUG(dddif,2,(PFMT " VectorPriorityUpdate(): v=" VINDEX_FMTX PRINTDEBUG(dddif,2,(PFMT " VectorPriorityUpdate(): v=" VINDEX_FMTX
" old=%d new=%d level=%d attr=%d\n", " old=%d new=%d level=%d attr=%d\n",
...@@ -441,7 +437,7 @@ static void VertexPriorityUpdate (DDD::DDDContext& context, DDD_OBJ obj, DDD_PRI ...@@ -441,7 +437,7 @@ static void VertexPriorityUpdate (DDD::DDDContext& context, DDD_OBJ obj, DDD_PRI
VERTEX *theVertex = (VERTEX *)obj; VERTEX *theVertex = (VERTEX *)obj;
INT level = LEVEL(theVertex); INT level = LEVEL(theVertex);
GRID *theGrid = GetGridOnDemand(ddd_ctrl(context).currMG,level); GRID *theGrid = GetGridOnDemand(ddd_ctrl(context).currMG,level);
INT old = VXPRIO(theVertex); DDD_PRIO old = VXPRIO(theVertex);
PRINTDEBUG(dddif,2,(PFMT " VertexPriorityUpdate(): v=" VID_FMTX PRINTDEBUG(dddif,2,(PFMT " VertexPriorityUpdate(): v=" VID_FMTX
" old=%d new=%d level=%d\n",me,VID_PRTX(theVertex),old,new_,level)) " old=%d new=%d level=%d\n",me,VID_PRTX(theVertex),old,new_,level))
...@@ -626,7 +622,6 @@ static void NodeUpdate (DDD::DDDContext& context, DDD_OBJ obj) ...@@ -626,7 +622,6 @@ static void NodeUpdate (DDD::DDDContext& context, DDD_OBJ obj)
static void NodeXferCopy (DDD::DDDContext& context, DDD_OBJ obj, DDD_PROC proc, DDD_PRIO prio) static void NodeXferCopy (DDD::DDDContext& context, DDD_OBJ obj, DDD_PROC proc, DDD_PRIO prio)
{ {
NODE *theNode = (NODE *)obj; NODE *theNode = (NODE *)obj;
VECTOR *vec = NULL;
PRINTDEBUG(dddif,1,(PFMT " NodeXferCopy(): n=" ID_FMTX PRINTDEBUG(dddif,1,(PFMT " NodeXferCopy(): n=" ID_FMTX
" proc=%d prio=%d\n", " proc=%d prio=%d\n",
...@@ -675,7 +670,7 @@ static void NodePriorityUpdate (DDD::DDDContext& context, DDD_OBJ obj, DDD_PRIO ...@@ -675,7 +670,7 @@ static void NodePriorityUpdate (DDD::DDDContext& context, DDD_OBJ obj, DDD_PRIO
NODE *pn = (NODE *)obj; NODE *pn = (NODE *)obj;
INT level = LEVEL(pn); INT level = LEVEL(pn);
GRID *theGrid = GetGridOnDemand(ddd_ctrl(context).currMG,level); GRID *theGrid = GetGridOnDemand(ddd_ctrl(context).currMG,level);
INT old = PRIO(pn); const DDD_PRIO old = PRIO(pn);
PRINTDEBUG(dddif,2,(PFMT " NodePriorityUpdate(): n=" ID_FMTX " old=%d new=%d " PRINTDEBUG(dddif,2,(PFMT " NodePriorityUpdate(): n=" ID_FMTX " old=%d new=%d "
"level=%d\n",me,ID_PRTX(pn),old,new_,level)) "level=%d\n",me,ID_PRTX(pn),old,new_,level))
...@@ -1436,7 +1431,7 @@ static void ElementPriorityUpdate (DDD::DDDContext& context, DDD_OBJ obj, DDD_PR ...@@ -1436,7 +1431,7 @@ static void ElementPriorityUpdate (DDD::DDDContext& context, DDD_OBJ obj, DDD_PR
ELEMENT *succe = SUCCE(pe); ELEMENT *succe = SUCCE(pe);
INT level = LEVEL(pe); INT level = LEVEL(pe);
GRID *theGrid = GetGridOnDemand(ddd_ctrl(context).currMG,level); GRID *theGrid = GetGridOnDemand(ddd_ctrl(context).currMG,level);
INT old = EPRIO(pe); const DDD_PRIO old = EPRIO(pe);
INT lostson = 1; INT lostson = 1;
PRINTDEBUG(dddif,1,(PFMT " ElementPriorityUpdate(): e=" EID_FMTX PRINTDEBUG(dddif,1,(PFMT " ElementPriorityUpdate(): e=" EID_FMTX
......
...@@ -179,9 +179,6 @@ provided with UG. ...@@ -179,9 +179,6 @@ provided with UG.
. MAX_SONS - Maximum number of sons per element. . MAX_SONS - Maximum number of sons per element.
. MAX_SIDES_TOUCHING - Maximum number of sides on the next finer mesh that make up
a side on the coarser mesh.
. MAXMATRICES - Maximum number of MATRIX types with different size. . MAXMATRICES - Maximum number of MATRIX types with different size.
. MAXCONNECTIONS - Maximum number of different CONNECTION types. . MAXCONNECTIONS - Maximum number of different CONNECTION types.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment