Commit 523a7b49 authored by Henrik Stolzmann's avatar Henrik Stolzmann

Removed data member vector::skip

See Issue `#29`.
Removed `vector::skip` and the  code that uses it. It compiles and the
few existing tests run without problems.
parent a0f1905d
Pipeline #21956 passed with stage
in 6 minutes and 16 seconds
......@@ -354,7 +354,6 @@ static INT CreateVectorInPart (GRID *theGrid, INT DomPart, INT VectorObjType,
VOBJECT(pv) = object;
VINDEX(pv) = (long)NVEC(theGrid);
SUCCVC(pv) = FIRSTVECTOR(theGrid);
VECSKIP(pv) = 0;
VSTART(pv) = NULL;
GRID_LINK_VECTOR(theGrid,pv,PrioMaster);
......@@ -3888,7 +3887,7 @@ static INT LexAlgDep (GRID *theGrid, const char *data)
DOUBLE_VECTOR pos,nbpos;
DOUBLE diff[DIM];
INT i,order,res;
INT Sign[DIM],Order[DIM],xused,yused,zused,error,SpecialTreatSkipVecs;
INT Sign[DIM],Order[DIM],xused,yused,zused,error;
char ord[3];
/* read ordering directions */
......@@ -3959,13 +3958,6 @@ static INT LexAlgDep (GRID *theGrid, const char *data)
return(1);
}
/* treat vectors with skipflag set specially? */
SpecialTreatSkipVecs = false;
if (strchr(data,'<')!=NULL)
SpecialTreatSkipVecs = GM_PUT_AT_BEGIN;
else if (strchr(data,'>')!=NULL)
SpecialTreatSkipVecs = GM_PUT_AT_END;
theMG = MYMG(theGrid);
/* find an approximate measure for the mesh size */
......@@ -3985,50 +3977,30 @@ static INT LexAlgDep (GRID *theGrid, const char *data)
SETMUP(theMatrix,0);
SETMDOWN(theMatrix,0);
if (SpecialTreatSkipVecs)
{
if (VECSKIP(theVector) && !VECSKIP(NBVector))
{
if (SpecialTreatSkipVecs==GM_PUT_AT_BEGIN)
order = -1;
else
order = 1;
}
VectorPosition(NBVector,nbpos);
if (VECSKIP(NBVector) && !VECSKIP(theVector))
V_DIM_SUBTRACT(nbpos,pos,diff);
V_DIM_SCALE(InvMeshSize,diff);
if (fabs(diff[Order[DIM-1]])<ORDERRES)
{
#ifdef __THREEDIM__
if (fabs(diff[Order[DIM-2]])<ORDERRES)
{
if (SpecialTreatSkipVecs==GM_PUT_AT_BEGIN)
order = 1;
else
order = -1;
if (diff[Order[DIM-3]]>0.0) order = -Sign[DIM-3];
else order = Sign[DIM-3];
}
else
#endif
if (diff[Order[DIM-2]]>0.0) order = -Sign[DIM-2];
else order = Sign[DIM-2];
}
else
{
VectorPosition(NBVector,nbpos);
V_DIM_SUBTRACT(nbpos,pos,diff);
V_DIM_SCALE(InvMeshSize,diff);
if (fabs(diff[Order[DIM-1]])<ORDERRES)
{
#ifdef __THREEDIM__
if (fabs(diff[Order[DIM-2]])<ORDERRES)
{
if (diff[Order[DIM-3]]>0.0) order = -Sign[DIM-3];
else order = Sign[DIM-3];
}
else
#endif
if (diff[Order[DIM-2]]>0.0) order = -Sign[DIM-2];
else order = Sign[DIM-2];
}
else
{
if (diff[Order[DIM-1]]>0.0) order = -Sign[DIM-1];
else order = Sign[DIM-1];
}
if (diff[Order[DIM-1]]>0.0) order = -Sign[DIM-1];
else order = Sign[DIM-1];
}
if (order==1) SETMUP(theMatrix,1);
else SETMDOWN(theMatrix,1);
}
......
......@@ -1530,9 +1530,6 @@ all degrees of freedom stored in the vector.
. index - Reflects position of the VECTOR in the double linked list.
. skip - Used bitwise to identify components of a VECTOR that have Dirichlet boundary
conditions. These components have to be treated differently in some parts of the solver.
. start - Points to first element of the MATRIX list of a VECTOR. This
list represents the rows of the matrix belonging to degrees of freedom in
the given VECTOR.
......@@ -1562,22 +1559,6 @@ INT VINDEX (VECTOR *v);
Position of the VECTOR in the doubl linked list. This is useful for
the implementation of some iterative schemes.
\verbatim
INT VSKIPME (VECTOR *v,INT n);
INT VVECSKIP (VECTOR *v,INT n);
INT VFULLSKIP (VECTOR *v,INT n);
void SETVSKIPME (VECTOR *v,INT n);
INT VECSKIP (VECTOR *v);
INT VECSKIPBIT (VECTOR *v,INT n);
void SETVECSKIPBIT (VECTOR *v,INT n);
\endverbatim
????
Macros to modify the skip flags. VECSKIP returns value of the skip word. Since it is
a macro it can also be used for assigning a value to the skip word, e.g.
VECSKIP(v)=0 will reset all bits in the skip word. VECSKIPBIT returns true
if the n th bit of the skip word is set. SETVECSKIPBIT sets the nth
bit of the skip word to 1.
\verbatim
MATRIX *VSTART (VECTOR *v);
......
......@@ -507,9 +507,6 @@ struct vector {
INT id;
#endif
/** \brief used bitwise to skip unknowns */
UINT skip;
/** \brief implements matrix */
struct matrix *start;
......@@ -1899,7 +1896,6 @@ enum GM_CE {
enum LV_MODIFIERS {
LV_SKIP = (1<<0), /* print skip flags in vector */
LV_VO_INFO = (1<<1), /* vector object related info */
LV_POS = (1<<2) /* position vector */
};
......@@ -2106,13 +2102,6 @@ enum LV_ID_TYPES {
#define SUCCVC(v) ((v)->succ)
#define VINDEX(v) ((v)->index)
#define V_IN_DATATYPE(v,dt) (VDATATYPE(v) & (dt))
#define VSKIPME(v,n) ((((v)->skip)>>n) & 1)
#define VVECSKIP(v,n) ((((v)->skip)>>n) & 15)
#define VFULLSKIP(v,n) (VVECSKIP(v,n)==15)
#define SETVSKIPME(v,n) (((v)->skip=n))
#define VECSKIP(v) ((v)->skip)
#define VECSKIPBIT(v,n) (((v)->skip) & (1<<n))
#define SETVECSKIPBIT(v,n) (v)->skip = ((v)->skip & (~(1<<n))) | (1<<n)
#define VSTART(v) ((v)->start)
#define VVALUE(v,n) ((v)->value[n])
#define VVALUEPTR(v,n) (&((v)->value[n]))
......@@ -3139,11 +3128,6 @@ enum {GM_ALL_LEVELS = 1,
enum {GM_ORDER_IN_COLS, GM_ORDER_IN_ROWS};
enum {GM_PUT_AT_BEGIN = 1, /*!< put skip vectors at begin of the list */
GM_PUT_AT_END = 2 /*!< put skip vectors at end of the list */
};
#define GM_TAKE_SKIP (1<<0)
#define GM_TAKE_NONSKIP (1<<1)
/*@}*/
/* get/set current multigrid, loop through multigrids */
......
......@@ -6495,13 +6495,6 @@ void NS_DIM_PREFIX ListVector (const MULTIGRID *theMG, const VECTOR *theVector,
/* print vector data if */
if (dataopt && FMT_PR_VEC(theFormat)!=NULL)
{
/* print skip flags */
if (READ_FLAG(modifiers,LV_SKIP))
{
INT_2_bitpattern(VECSKIP(theVector),buffer);
UserWriteF(" skip=%s\n",buffer);
}
/* print data */
Data = (void*)(&VVALUE(theVector,0));
if ((*(FMT_PR_VEC(theFormat)))(VTYPE(theVector),Data," ",buffer))
......
......@@ -107,12 +107,6 @@ START_UGDIM_NAMESPACE
#define DISPLAY_NP_FORMAT_SIII "%-16.13s = %-2d %-2d %-2d\n"
#define DISPLAY_NP_FORMAT_FF "%-7.4g %-7.4g\n"
#define CLEAR_VECSKIP_OF_GRID(g) \
{ VECTOR *theVector; \
for (theVector=FIRSTVECTOR((g)); theVector!= NULL; \
theVector=SUCCVC(theVector)) \
VECSKIP(theVector) = 0;}
/****************************************************************************/
/* */
/* function declarations */
......
......@@ -108,8 +108,6 @@ static void PrintSingleVectorX (const VECTOR *v, const VECDATA_DESC *X, INT vcla
i += sprintf(buffer+i,"u[%d]=%15.8f ",j,VVALUE(v,comp));
}
i += sprintf(buffer+i," cl %d %d sk ",VCLASS(v),VNCLASS(v));
for (j=0; j<ncomp; j++)
i += sprintf(buffer+i,"%d ",((VECSKIP(v) & (1<<j))!=0));
i += sprintf(buffer+i,"n %d t %d o %d\n",VNEW(v),VTYPE(v),VOTYPE(v));
Printf(buffer);
......
......@@ -406,7 +406,6 @@ static void ddd_DefineTypes(DDD::DDDContext& context)
EL_LDATA, ELDEF(v.pred),
EL_LDATA, ELDEF(v.succ),
EL_GDATA, ELDEF(v.index),
EL_GDATA, ELDEF(v.skip),
EL_LDATA, ELDEF(v.start),
/* TODO: value wird noch ausgelassen. feld variabler laenge? */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment