From d6d0143ae2821de7c87af088d3c5626bdd5ffbfd Mon Sep 17 00:00:00 2001 From: Ansgar Burchardt <Ansgar.Burchardt@tu-dresden.de> Date: Wed, 5 Apr 2017 18:40:12 +0200 Subject: [PATCH] Remove `ie` and `ngie` commands --- ui/commands.cc | 222 ------------------------------------------------ ui/commands.doc | 19 ----- 2 files changed, 241 deletions(-) diff --git a/ui/commands.cc b/ui/commands.cc index f52273cca..8b708afe9 100644 --- a/ui/commands.cc +++ b/ui/commands.cc @@ -2794,226 +2794,6 @@ static INT MoveNodeCommand (INT argc, char **argv) } -/** \brief Implementation of \ref ie. */ -static INT InsertElementCommand (INT argc, char **argv) -{ - MULTIGRID *theMG; - NODE *theNode,*theNodes[MAX_CORNERS_OF_ELEM]; - char *token,*vstr; - INT i,nNodes,Id[MAX_CORNERS_OF_ELEM]; - - /* following variables: keep type for sscanf */ - int id; - - #ifdef ModelP - if (me!=master) return (OKCODE); - #endif - - theMG = currMG; - if (theMG==NULL) - { - PrintErrorMessage('E',"ie","no open multigrid"); - return (CMDERRORCODE); - } - - /* check options */ - nNodes = 0; - for (i=1; i<argc; i++) - switch (argv[i][0]) - { - case 's' : - if (SELECTIONMODE(theMG)==nodeSelection) - for (nNodes=0; nNodes<SELECTIONSIZE(theMG); nNodes++) - { - theNode = (NODE *)SELECTIONOBJECT(theMG,nNodes); - if (nNodes>=MAX_CORNERS_OF_ELEM) - { - PrintErrorMessage('E',"ie","too many nodes are in the selection"); - return (CMDERRORCODE); - } - theNodes[nNodes] = theNode; - } - else - { - PrintErrorMessage('E',"ie","objects other than nodes are in the selection"); - return (PARAMERRORCODE); - } - if (nNodes==0) - { - PrintErrorMessage('E',"ie","no nodes are in the selection"); - return (PARAMERRORCODE); - } - break; - - default : - PrintErrorMessageF('E', "InsertElementCommand", "Unknown option '%s'", argv[i]); - return (PARAMERRORCODE); - } - - /* got the nodes via s option? */ - if (nNodes>0) - { - if (InsertElement(GRID_ON_LEVEL(theMG,0),nNodes,theNodes,NULL,NULL,NULL)==NULL) - { - PrintErrorMessage('E',"ie","inserting the element failed"); - return (CMDERRORCODE); - } - else - { - return (OKCODE); - } - } - - /* set vstr after 'ie' */ - if ((vstr=strchr(argv[0],'e'))!=NULL) - ++vstr; - else - return (CMDERRORCODE); - - /* we need the string split into tokens */ - nNodes = 0; - token = strtok(vstr,WHITESPACE); - while (token!=NULL) - { - if (nNodes>=MAX_CORNERS_OF_ELEM) - { - PrintErrorMessageF('E',"ie","specify at most %d id's",(int)MAX_CORNERS_OF_ELEM); - return (PARAMERRORCODE); /* too many items */ - } - if (sscanf(token," %d",&id)!=1) - { - PrintErrorMessageF('E',"ie","could not read the id of corner no %d",(int)i); - return (PARAMERRORCODE); /* too many items */ - } - Id[nNodes++] = id; - token = strtok(NULL,WHITESPACE); - } - - /* NB: toplevel=0 is checked by InsertElementFromIDs() */ - if (InsertElementFromIDs(GRID_ON_LEVEL(theMG,0),nNodes,Id,NULL)==NULL) - { - PrintErrorMessage('E',"ie","inserting the element failed"); - return (CMDERRORCODE); - } - - return (OKCODE); -} - -/** \todo Please doc me! */ -static INT NGInsertElementCommand (INT argc, char **argv) -{ - MULTIGRID *theMG; - char *token,*vstr; - INT i,bf,nNodes,Id[MAX_CORNERS_OF_ELEM]; - static int n; - - /* following variables: keep type for sscanf */ - int id; - - #ifdef ModelP - if (me!=master) return (OKCODE); - #endif - - theMG = currMG; - if (theMG==NULL) - { - PrintErrorMessage('E',"ngie","no open multigrid"); - return (CMDERRORCODE); - } - - /* set vstr after 'ngie' */ - if ((vstr=strchr(argv[0],'e'))!=NULL) - ++vstr; - else - return (CMDERRORCODE); - - UserWriteF("# %s\n",argv[0]); - UserWriteF("# element %d\n",n); - n++; - UserWriteF("E "); - - /* we need the string split into tokens */ - nNodes = bf = 0; - token = strtok(vstr,WHITESPACE); - i = 0; - while (token!=NULL) - { - /* separator for boundary faces */ - if (strcmp(token,"F") == 0) - { - UserWriteF("\n"); - bf = 1; - goto NEXTTOKEN; - } - - /* read next boundary face */ - if (bf > 0) - { - - if (sscanf(token," %d",&id)!=1) - { - PrintErrorMessageF('E',"ngie","could not read the id of boundary face no %d",(int)bf); - return (PARAMERRORCODE); /* too many items */ - } - UserWriteF(" F"); - switch (nNodes) - { - case 4 : - case 5 : - case 6 : - UserWriteF("ngie: elementtype = %d not implemented!\n",nNodes); - break; - case 8 : - { - INT n; - /* assert(id<SIDES_OF_ELEM_TAG(nNodes));*/ - - for (n=0; n<CORNERS_OF_SIDE_TAG(7,id); n++) - { - UserWriteF(" %d",Id[CORNER_OF_SIDE_TAG(7,id,n)]); - } - UserWriteF("\n"); - } - break; - default : - assert(0); - } - - bf++; - goto NEXTTOKEN; - } - - /* read next node */ - if (nNodes>=MAX_CORNERS_OF_ELEM) - { - PrintErrorMessageF('E',"ngie","specify at most %d id's",(int)MAX_CORNERS_OF_ELEM); - return (PARAMERRORCODE); /* too many items */ - } - if (sscanf(token," %d",&id)!=1) - { - PrintErrorMessageF('E',"ngie","could not read the id of corner no %d",(int)nNodes); - return (PARAMERRORCODE); /* too many items */ - } - - /* first id is subdomain */ - if (i > 0) - { - Id[nNodes] = id; - nNodes++; - } - UserWriteF(" %d",id); - -NEXTTOKEN: - token = strtok(NULL,WHITESPACE); - i++; - } - - UserWriteF(";\n"); - - return (OKCODE); -} - - /** \brief Implementation of \ref adapt. */ static INT AdaptCommand (INT argc, char **argv) { @@ -5663,8 +5443,6 @@ INT NS_DIM_PREFIX InitCommands () if (CreateCommand("ngbn", NGInsertBoundaryNodeCommand )==NULL) return (__LINE__); if (CreateCommand("gn", InsertGlobalNodeCommand )==NULL) return (__LINE__); if (CreateCommand("move", MoveNodeCommand )==NULL) return (__LINE__); - if (CreateCommand("ie", InsertElementCommand )==NULL) return (__LINE__); - if (CreateCommand("ngie", NGInsertElementCommand )==NULL) return (__LINE__); if (CreateCommand("refine", AdaptCommand )==NULL) return (__LINE__); if (CreateCommand("adapt", AdaptCommand )==NULL) return (__LINE__); if (CreateCommand("fixcoarsegrid", FixCoarseGridCommand )==NULL) return (__LINE__); diff --git a/ui/commands.doc b/ui/commands.doc index f7b4a23ac..8e66bfbe7 100644 --- a/ui/commands.doc +++ b/ui/commands.doc @@ -904,25 +904,6 @@ freeaverage $nv uwTrans $s sol $nv unTrans $s sol; */ /****************************************************************************/ -/****************************************************************************/ -/** \page ie ie - Insert an element - - \section Description - This command inserts an element into a multigrid with only level 0, - calling the function 'InsertElement'. - - -\section Syntax - 'ie {\<Id>}+ | $s' - - <li> {\<Id>}+ - specify at least three (2d) or four (3d) corner nodes, the corresponding (unique) element will be created - <li> $s - taking selected nodes - - \section Keywords - multigrid, insert, create, element, edit -*/ -/****************************************************************************/ - /****************************************************************************/ /** \page adapt adapt - Adapt the current multigrid -- GitLab