From 181821685e772e678e7db47c962e736ab90d6e46 Mon Sep 17 00:00:00 2001 From: Oliver Sander <oliver.sander@tu-dresden.de> Date: Wed, 22 Nov 2023 12:02:09 +0100 Subject: [PATCH] Remove methods that print control words or control entries These are never used. --- dune/uggrid/gm/cw.cc | 238 ------------------------------------------- dune/uggrid/gm/gm.h | 3 - 2 files changed, 241 deletions(-) diff --git a/dune/uggrid/gm/cw.cc b/dune/uggrid/gm/cw.cc index fab7c4475..47c8f85d5 100644 --- a/dune/uggrid/gm/cw.cc +++ b/dune/uggrid/gm/cw.cc @@ -233,240 +233,6 @@ static CONTROL_ENTRY_PREDEF ce_predefines[MAX_CONTROL_ENTRIES] = { #endif /* ModelP */ }; -/****************************************************************************/ -/** \brief Print all control entries of an objects control word - - * @param obj - object pointer - * @param offset - controlword offset in (UINT) in object - - This function prints the contents of all control entries of an objects control word at a - given offset. - - */ -/****************************************************************************/ - -void NS_DIM_PREFIX ListCWofObject (const void *obj, UINT offset) -{ - INT i,n,ce,last_ce,sub,min,cw_objt,oiw; - - ASSERT(obj!=NULL); - - cw_objt = BITWISE_TYPE(OBJT(obj)); - sub = -1; - last_ce = -1; - - /* print control word entries in ascending order of offsets in word */ - do - { - min = INT_MAX; - for (i=0; i<MAX_CONTROL_ENTRIES; i++) - if (control_entries[i].used) - if (control_entries[i].objt_used & cw_objt) - if (control_entries[i].offset_in_object==offset) - { - oiw = control_entries[i].offset_in_word; - if ((oiw<min) && (oiw>=sub)) - { - if ((oiw==sub) && (i<=last_ce)) - continue; - ce = i; - min = oiw; - } - } - if (min==INT_MAX) - break; - - n = CW_READ(obj,ce); - UserWriteF(" ce %s with offset in cw %3d: %10d\n",control_entries[ce].name,min,n); - sub = min; - last_ce = ce; - } - while (true); - - ASSERT(sub>=0); -} - -/****************************************************************************/ -/** \brief Print all control entries of all control words of an object - - * @param obj - object pointer - - This function prints the contents of all control entries of all control words - of the object. 'ListCWofObject' is called. - */ -/****************************************************************************/ - -void NS_DIM_PREFIX ListAllCWsOfObject (const void *obj) -{ - INT i,cw,last_cw,sub,min,cw_objt,offset; - - ASSERT(obj!=NULL); - - cw_objt = BITWISE_TYPE(OBJT(obj)); - sub = -1; - last_cw = -1; - - /* print control word contents in ascending order of offsets */ - do - { - min = INT_MAX; - for (i=0; i<MAX_CONTROL_WORDS; i++) - if (control_words[i].used) - if (control_words[i].objt_used & cw_objt) - { - offset = control_words[i].offset_in_object; - if ((offset<min) && (offset>=sub)) - { - if ((offset==sub) && (i<=last_cw)) - continue; - cw = i; - min = offset; - } - } - if (min==INT_MAX) - break; - - UserWriteF("cw %s with offset %3d:\n",control_words[cw].name,min); - ListCWofObject(obj,min); - sub = min; - last_cw = cw; - } - while (true); - - ASSERT(sub>=0); -} - -/****************************************************************************/ -/** \brief Print used pattern of all control entries of an object types control word - - * @param obj - object pointer - * @param offset - controlword offset in (UINT) in object - * @param myprintf - pointer to a printf function (maybe UserWriteF) - - This function prints the used pattern of all control entries of an object types control word at a - given offset. - */ -/****************************************************************************/ - -static void ListCWofObjectType (INT objt, UINT offset, PrintfProcPtr myprintf) -{ - INT i,ce,last_ce,sub,min,cw_objt,oiw; - char bitpat[33]; - - cw_objt = BITWISE_TYPE(objt); - sub = -1; - last_ce = -1; - - /* print control word entries in ascending order of offsets in word */ - do - { - min = INT_MAX; - for (i=0; i<MAX_CONTROL_ENTRIES; i++) - if (control_entries[i].used) - if (control_entries[i].objt_used & cw_objt) - if (control_entries[i].offset_in_object==offset) - { - oiw = control_entries[i].offset_in_word; - if ((oiw<min) && (oiw>=sub)) - { - if ((oiw==sub) && (i<=last_ce)) - continue; - ce = i; - min = oiw; - } - } - if (min==INT_MAX) - break; - - INT_2_bitpattern(control_entries[ce].mask,bitpat); - myprintf(" ce %-20s offset in cw %3d, len %3d: %s\n", - control_entries[ce].name, - control_entries[ce].offset_in_word, - control_entries[ce].length, - bitpat); - sub = min; - last_ce = ce; - } - while (true); - - if (sub==-1) - myprintf(" --- no ce found with objt %d\n",objt); -} - -/****************************************************************************/ -/** \brief Print used pattern of all control entries of all - control words of an object type - - * @param obj - object pointer - * @param myprintf - pointer to a printf function (maybe UserWriteF) - - This function prints the used pattern of all control entries of all control words - of an object type. 'ListCWofObjectType' is called. - */ -/****************************************************************************/ - -static void ListAllCWsOfObjectType (INT objt, PrintfProcPtr myprintf) -{ - INT i,cw,last_cw,sub,min,cw_objt,offset; - - cw_objt = BITWISE_TYPE(objt); - sub = -1; - last_cw = -1; - - /* print control word contents in ascending order of offsets */ - do - { - min = INT_MAX; - for (i=0; i<MAX_CONTROL_WORDS; i++) - if (control_words[i].used) - if (control_words[i].objt_used & cw_objt) - { - offset = control_words[i].offset_in_object; - if ((offset<min) && (offset>=sub)) - { - if ((offset==sub) && (i<=last_cw)) - continue; - cw = i; - min = offset; - } - } - if (min==INT_MAX) - break; - - myprintf("cw %-20s with offset in object %3d (UINTs):\n",control_words[cw].name,min); - ListCWofObjectType(objt,min,myprintf); - sub = min; - last_cw = cw; - } - while (true); - - if (sub==-1) - printf(" --- no cw found with objt %d\n",objt); -} - -/****************************************************************************/ -/** \brief Print used pattern of all control entries of all - control words of all object types - - * @param obj - object pointer - * @param myprintf - pointer to a printf function (maybe UserWriteF) - - This function prints the used pattern of all control entries of all control words - of all object types. 'ListAllCWsOfObjectType' is called. - */ -/****************************************************************************/ - -void NS_DIM_PREFIX ListAllCWsOfAllObjectTypes (PrintfProcPtr myprintf) -{ - ListAllCWsOfObjectType(IVOBJ,myprintf); - ListAllCWsOfObjectType(IEOBJ,myprintf); - ListAllCWsOfObjectType(EDOBJ,myprintf); - ListAllCWsOfObjectType(NDOBJ,myprintf); - ListAllCWsOfObjectType(VEOBJ,myprintf); - ListAllCWsOfObjectType(GROBJ,myprintf); - ListAllCWsOfObjectType(MGOBJ,myprintf); -} - /****************************************************************************/ /** \brief Initialize control words @@ -609,10 +375,6 @@ static INT InitPredefinedControlEntries (void) } } - IFDEBUG(gm,1) - ListAllCWsOfAllObjectTypes(printf); - ENDDEBUG - /* TODO: enable next lines for error control */ IFDEBUG(gm,1) if (error) diff --git a/dune/uggrid/gm/gm.h b/dune/uggrid/gm/gm.h index e5b81baab..8cd6bcc9d 100644 --- a/dune/uggrid/gm/gm.h +++ b/dune/uggrid/gm/gm.h @@ -3173,9 +3173,6 @@ INT CheckSubdomains (MULTIGRID *theMG); /* multigrid user data space management (using the heaps.c block heap management) */ INT AllocateControlEntry (INT cw_id, INT length, INT *ce_id); INT FreeControlEntry (INT ce_id); -void ListCWofObject (const void *obj, UINT offset); -void ListAllCWsOfObject (const void *obj); -void ListAllCWsOfAllObjectTypes (PrintfProcPtr myprintf); UINT ReadCW (const void *obj, INT ce); void WriteCW (void *obj, INT ce, INT n); -- GitLab