Skip to content
Snippets Groups Projects
Commit 3ecbfc41 authored by Ansgar Burchardt's avatar Ansgar Burchardt
Browse files

remove `move` command

parent 32055309
No related branches found
No related tags found
1 merge request!69More cleanup
......@@ -2155,125 +2155,6 @@ Exit_gn:
}
/** \brief Implementation of \ref move. */
static INT MoveNodeCommand (INT argc, char **argv)
{
MULTIGRID *theMG;
VERTEX *myVertex;
NODE *theNode;
DOUBLE xc[DIM];
INT type,i,j,level,relative;
/* following variables: keep type for sscanf */
double x[DIM_MAX];
int id,segid;
theMG = currMG;
if (theMG==NULL)
{
PrintErrorMessage('E',"move","no open multigrid");
return (CMDERRORCODE);
}
theNode = NULL;
/* check parameters */
if (sscanf(argv[0],"move %d",&id)==1)
{
/* search node */
for (level=0; level<=TOPLEVEL(theMG); level++)
if ((theNode=FindNodeFromId(GRID_ON_LEVEL(theMG,level),id))!=NULL)
break;
if (theNode==NULL)
{
PrintErrorMessageF('E',"move","node with ID %ld not found",(long)id);
return (CMDERRORCODE);
}
}
/* check options */
relative = false;
for (i=1; i<argc; i++)
switch (argv[i][0])
{
case 'i' :
if (OBJT(MYVERTEX(theNode))!=IVOBJ)
{
PrintErrorMessageF('E',"move","node with ID %ld is no inner node",(long)id);
return (CMDERRORCODE);
}
type = IVOBJ;
if (sscanf(argv[i],"i %lf %lf %lf",x,x+1,x+2)!=DIM)
{
PrintErrorMessageF('E',"move","specify %d new coordinates for an inner node",(int)DIM);
return (PARAMERRORCODE);
}
for (j=0; j<DIM; j++)
xc[j] = x[j];
break;
case 'b' :
if (OBJT(MYVERTEX(theNode))!=BVOBJ)
{
PrintErrorMessageF('E',"move","node with ID %ld is no boundary node",(long)id);
return (CMDERRORCODE);
}
type = BVOBJ;
if (sscanf(argv[i],"b %d %lf %lf",&segid,x,x+1)!=1+DIM_OF_BND)
{
PrintErrorMessageF('E',"move","specify the segment if and %d new coordinates for a boundary node",(int)DIM_OF_BND);
return (PARAMERRORCODE);
}
for (j=0; j<DIM_OF_BND; j++)
xc[j] = x[j];
break;
case 'r' :
relative = true;
break;
default :
PrintErrorMessageF('E', "MoveNodeCommand", "Unknown option '%s'", argv[i]);
return (PARAMERRORCODE);
}
if (theNode==NULL)
{
PrintErrorMessage('E',"move","you have to either specify\n"
"the ID of the node to move or the s option");
return (PARAMERRORCODE);
}
myVertex = MYVERTEX(theNode);
if (type==IVOBJ)
{
if (relative)
{
/* move relative to old position */
for (j=0; j<DIM; j++)
xc[j] += CVECT(myVertex)[j];
}
if (MoveNode(theMG,theNode,xc,true)!=GM_OK)
{
PrintErrorMessage('E',"move","failed moving the node");
return (CMDERRORCODE);
}
}
else if (type==BVOBJ)
{
PrintErrorMessage('E',"move","moving boundary nodes not implemented yet");
return (CMDERRORCODE);
}
else
{
PrintErrorMessage('E', "MoveNodeCommand", "either i or b option is mandatory");
return (PARAMERRORCODE);
}
return (OKCODE);
}
/** \brief Implementation of \ref adapt. */
static INT AdaptCommand (INT argc, char **argv)
{
......@@ -4367,7 +4248,6 @@ INT NS_DIM_PREFIX InitCommands ()
if (CreateCommand("bn", InsertBoundaryNodeCommand )==NULL) return (__LINE__);
if (CreateCommand("ngbn", NGInsertBoundaryNodeCommand )==NULL) return (__LINE__);
if (CreateCommand("gn", InsertGlobalNodeCommand )==NULL) return (__LINE__);
if (CreateCommand("move", MoveNodeCommand )==NULL) return (__LINE__);
if (CreateCommand("refine", AdaptCommand )==NULL) return (__LINE__);
if (CreateCommand("adapt", AdaptCommand )==NULL) return (__LINE__);
if (CreateCommand("fixcoarsegrid", FixCoarseGridCommand )==NULL) return (__LINE__);
......
......@@ -798,27 +798,6 @@ freeaverage $nv uwTrans $s sol $nv unTrans $s sol;
*/
/****************************************************************************/
/****************************************************************************/
/** \page move move - Move a node and vertex
\section Description
This command moves a node and the corresponding vertex
of the current multigrid to a new position,
calling the functions 'MoveInnerNode' and 'MoveBoundaryNode'.
\section Syntax
'move \<Id> {$i \<x> \<y> [\<z>] | $b \<SegId> \<s> [\<t>]}'
<li> \<Id> - Id of the node to be moved
<li> $i~\<x>~\<y>~[\<z>] - specify as much coordinates as the space has dimensions
<li> $b~\<Id>~\<s>~[\<t>] - in the current implementation (domain module dependent)
boundary nodes can not be moved
\section Keywords
multigrid, move, node, edit
*/
/****************************************************************************/
/****************************************************************************/
/** \page adapt adapt - Adapt the current multigrid
......
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