From fdc5c6c1520abc53942003af758a228df3209154 Mon Sep 17 00:00:00 2001 From: Oliver Sander <oliver.sander@tu-dresden.de> Date: Wed, 13 Jul 2022 14:14:15 +0200 Subject: [PATCH] Remove unused files scan.h and scan.cc --- dune/uggrid/domain/domain.h | 17 -- dune/uggrid/domain/std_domain.cc | 323 ------------------------------- dune/uggrid/low/CMakeLists.txt | 2 - dune/uggrid/low/scan.cc | 146 -------------- dune/uggrid/low/scan.h | 92 --------- 5 files changed, 580 deletions(-) delete mode 100644 dune/uggrid/low/scan.cc delete mode 100644 dune/uggrid/low/scan.h diff --git a/dune/uggrid/domain/domain.h b/dune/uggrid/domain/domain.h index 646b5b551..61763984b 100644 --- a/dune/uggrid/domain/domain.h +++ b/dune/uggrid/domain/domain.h @@ -365,23 +365,6 @@ INT BVP_SetUserFct (BVP *theBVP, INT n, UserProcPtr *UserFct); /****************************************************************************/ INT BVP_Check (BVP *aBVP); -/****************************************************************************/ -/** \brief Sets a BNDP from command input - * - * @param theBVP - BVP structure - * @param argc, argv - command parameters - - This function sets a BNDP from command input parameters. - Options are implementation specific. - - * @return <ul> - * <li> 0 if ok </li> - * <li> 1 if error. </li> - * </ul> - */ -/****************************************************************************/ -BNDP* BVP_InsertBndP (NS_PREFIX HEAP *Heap, BVP *theBVP, INT argc, char **argv); - /****************************************************************************/ /** \brief Write command to insert this BNDP * diff --git a/dune/uggrid/domain/std_domain.cc b/dune/uggrid/domain/std_domain.cc index 2748d339c..ecbac44d1 100644 --- a/dune/uggrid/domain/std_domain.cc +++ b/dune/uggrid/domain/std_domain.cc @@ -60,7 +60,6 @@ #include <dune/uggrid/low/heaps.h> #include <dune/uggrid/low/misc.h> #include <dune/uggrid/low/namespace.h> -#include <dune/uggrid/low/scan.h> #include <dune/uggrid/low/ugenv.h> #include <dune/uggrid/low/ugtypes.h> @@ -1413,139 +1412,6 @@ GetCommonLinePatchId (PATCH * p0, PATCH * p1) return (-1); } - -static BNDP * -CreateBndPOnLine (HEAP * Heap, PATCH * p0, PATCH * p1, DOUBLE lcoord) -{ - BND_PS *bp; - PATCH *p, *pp; - DOUBLE local0[DIM_OF_BND]; - DOUBLE local1[DIM_OF_BND]; - INT k, l, cnt; - - if (PATCH_TYPE (p0) != POINT_PATCH_TYPE) - return (NULL); - if (PATCH_TYPE (p1) != POINT_PATCH_TYPE) - return (NULL); - - PRINTDEBUG (dom, 1, (" p0 p1 %d %d\n", PATCH_ID (p0), PATCH_ID (p1))); - for (l = 0; l < GetNumberOfPatches (p0); l++) - PRINTDEBUG (dom, 1, (" bp pid %d\n", GetPatchId (p0, l))); - for (l = 0; l < GetNumberOfPatches (p1); l++) - PRINTDEBUG (dom, 1, (" bp pid %d\n", GetPatchId (p1, l))); - - cnt = GetNumberOfCommonPatches (p0, p1, &k); - - if (cnt < 2) - return (NULL); - - bp = - (BND_PS *) GetFreelistMemory (Heap, - (cnt - 1) * sizeof (COORD_BND_VECTOR) + - sizeof (BND_PS)); - if (bp == NULL) - return (NULL); - bp->n = cnt; - - k = GetCommonLinePatchId (p0, p1); - if ((k < currBVP->ncorners) || (k >= currBVP->sideoffset)) - return (NULL); - p = currBVP->patches[k]; - bp->patch_id = k; - - PRINTDEBUG (dom, 1, (" Create BNDP line %d cnt %d\n", k, cnt)); - for (l = 0; l < GetNumberOfPatches (p0); l++) - PRINTDEBUG (dom, 1, (" bp pid %d\n", GetPatchId (p0, l))); - for (l = 0; l < GetNumberOfPatches (p1); l++) - PRINTDEBUG (dom, 1, (" bp pid %d\n", GetPatchId (p1, l))); - - for (l = 0; l < LINE_PATCH_N (p); l++) - { - pp = currBVP->patches[LINE_PATCH_PID (p, l)]; - switch (LINE_PATCH_CID0 (p, l)) - { - case 0 : - local0[0] = PARAM_PATCH_RANGE (pp)[0][0]; - local0[1] = PARAM_PATCH_RANGE (pp)[0][1]; - break; - case 1 : - local0[0] = PARAM_PATCH_RANGE (pp)[1][0]; - local0[1] = PARAM_PATCH_RANGE (pp)[0][1]; - break; - case 2 : - local0[0] = PARAM_PATCH_RANGE (pp)[1][0]; - local0[1] = PARAM_PATCH_RANGE (pp)[1][1]; - break; - case 3 : - local0[0] = PARAM_PATCH_RANGE (pp)[0][0]; - local0[1] = PARAM_PATCH_RANGE (pp)[1][1]; - break; - } - switch (LINE_PATCH_CID1 (p, l)) - { - case 0 : - local1[0] = PARAM_PATCH_RANGE (pp)[0][0]; - local1[1] = PARAM_PATCH_RANGE (pp)[0][1]; - break; - case 1 : - local1[0] = PARAM_PATCH_RANGE (pp)[1][0]; - local1[1] = PARAM_PATCH_RANGE (pp)[0][1]; - break; - case 2 : - local1[0] = PARAM_PATCH_RANGE (pp)[1][0]; - local1[1] = PARAM_PATCH_RANGE (pp)[1][1]; - break; - case 3 : - local1[0] = PARAM_PATCH_RANGE (pp)[0][0]; - local1[1] = PARAM_PATCH_RANGE (pp)[1][1]; - break; - } - - /* TODO: Why this? */ - if ((LINE_PATCH_CID0 (p, l) == 2) && (LINE_PATCH_CID1 (p, l) == 3)) - lcoord = 1.0 - lcoord; - if ((LINE_PATCH_CID0 (p, l) == 1) && (LINE_PATCH_CID1 (p, l) == 0)) - lcoord = 1.0 - lcoord; - if ((LINE_PATCH_CID0 (p, l) == 3) && (LINE_PATCH_CID1 (p, l) == 0)) - lcoord = 1.0 - lcoord; - if ((LINE_PATCH_CID0 (p, l) == 2) && (LINE_PATCH_CID1 (p, l) == 1)) - lcoord = 1.0 - lcoord; - - bp->local[l][0] = (1.0 - lcoord) * local0[0] + lcoord * local1[0]; - bp->local[l][1] = (1.0 - lcoord) * local0[1] + lcoord * local1[1]; - - if ((LINE_PATCH_CID0 (p, l) == 2) && (LINE_PATCH_CID1 (p, l) == 3)) - lcoord = 1.0 - lcoord; - if ((LINE_PATCH_CID0 (p, l) == 1) && (LINE_PATCH_CID1 (p, l) == 0)) - lcoord = 1.0 - lcoord; - if ((LINE_PATCH_CID0 (p, l) == 3) && (LINE_PATCH_CID1 (p, l) == 0)) - lcoord = 1.0 - lcoord; - if ((LINE_PATCH_CID0 (p, l) == 2) && (LINE_PATCH_CID1 (p, l) == 1)) - lcoord = 1.0 - lcoord; - - - PRINTDEBUG (dom, 1, - (" Create bndp %d line %d C0 %d C1 %d l %d %f %f\n", - bp->patch_id, LINE_PATCH_PID (p, l), LINE_PATCH_CID0 (p, - l), - LINE_PATCH_CID1 (p, l), l, bp->local[l][0], - bp->local[l][1])); - PRINTDEBUG (dom, 1, (" lcoord %f\n", lcoord)); - } - - if (!PATCH_IS_FIXED (p)) - { - /* store global coordinates */ - BND_DATA (bp) = GetFreelistMemory (Heap, DIM * sizeof (DOUBLE)); - if (BND_DATA (bp) == NULL) - return (NULL); - - if (BndPointGlobal ((BNDP *) bp, (DOUBLE *) BND_DATA (bp))) - return (NULL); - } - - return ((BNDP *) bp); -} #endif #define BN_RES 100 @@ -1633,195 +1499,6 @@ ResolvePointOnSegment (PATCH * patch, int depth, double resolution2, return 0; } -/* domain interface function: for description see domain.h */ -BNDP *NS_DIM_PREFIX -BVP_InsertBndP (HEAP * Heap, BVP * aBVP, INT argc, char **argv) -{ - using std::abs; - - STD_BVP *theBVP; - BND_PS *ps; - PATCH *p; - INT j, pid; - int i; - DOUBLE pos[DIM_OF_BND]; - - theBVP = GetSTD_BVP (aBVP); - - if (ReadArgvOption ("g", argc, argv)) - { - DOUBLE resolution2; - /* double global[DIM]; extension to constant 3 components for sscanf; Ch. Wrobel 981002 */ - double global[3]; - - /* insert bn from global coordinates */ - if (sscanf (argv[0], "bn %lf %lf %lf", global, global +1, global +2) != - DIM) - { - PrintErrorMessageF ('E', "BVP_InsertBndP", - "g option specified but could not scan\n" - "global coordinates from '%s'\n", argv[0]); - return (NULL); - } - - if (ReadArgvDOUBLE ("r", &resolution2, argc, argv) != 0) - resolution2 = 1e-2; /* default */ - resolution2 *= resolution2; - - /* find segment id and local coordinates (on any segment) */ - { - DOUBLE mindist2 = MAX_D; - int seg; - DOUBLE lambda[DIM_OF_BND]; - - for (seg = 0; seg < STD_BVP_NSIDES (theBVP); seg++) - { - PATCH *patch = - STD_BVP_PATCH (theBVP, seg + STD_BVP_SIDEOFFSET (theBVP)); - DOUBLE seg_mindist2 = mindist2; - - if (DropPerpendicularOnSegment - (patch, PARAM_PATCH_RANGE (patch), global, lambda, - &seg_mindist2)) - return NULL; - - if (mindist2 > seg_mindist2) - { - mindist2 = seg_mindist2; - i = seg; - V_BDIM_COPY (lambda, pos); - } - if (mindist2 <= resolution2) - break; - } - if (mindist2 > resolution2) - { - /* refine search */ - PATCH *patch = - STD_BVP_PATCH (theBVP, i + STD_BVP_SIDEOFFSET (theBVP)); - - V_BDIM_COPY (pos, lambda); - if (ResolvePointOnSegment - (patch, 2, resolution2, PARAM_PATCH_RANGE (patch), global, - lambda)) - return NULL; - V_BDIM_COPY (lambda, pos); - } - } - - } - else - { - if (sscanf (argv[0], "bn %d %lf %lf", &i, pos, pos + 1) != DIM_OF_BND + 1) - { - PrintErrorMessageF ('E', "BVP_InsertBndP", - "could not scan segment id and\n" - "local coordinates on segment from '%s'\n", - argv[0]); - return (NULL); - } - } - pid = i + theBVP->sideoffset; - p = theBVP->patches[pid]; - -#ifdef UG_DIM_3 - /* check point on line or on point patch */ - if (abs(pos[0] - PARAM_PATCH_RANGE (p)[0][0]) < SMALL_DIFF) - { - const DOUBLE lc = (pos[1] - PARAM_PATCH_RANGE (p)[0][1]) - / (PARAM_PATCH_RANGE (p)[1][1] - PARAM_PATCH_RANGE (p)[0][1]); - if (abs(lc) < SMALL_DIFF) - return (CreateBndPOnPoint - (Heap, currBVP->patches[PARAM_PATCH_POINTS (p, 0)])); - else if (abs(lc - 1.) < SMALL_DIFF) - return (CreateBndPOnPoint - (Heap, currBVP->patches[PARAM_PATCH_POINTS (p, 3)])); - return (CreateBndPOnLine - (Heap, currBVP->patches[PARAM_PATCH_POINTS (p, 0)], - currBVP->patches[PARAM_PATCH_POINTS (p, 3)], lc)); - } - else if (abs(pos[0] - PARAM_PATCH_RANGE (p)[1][0]) < SMALL_DIFF) - { - const DOUBLE lc = (pos[1] - PARAM_PATCH_RANGE (p)[0][1]) - / (PARAM_PATCH_RANGE (p)[1][1] - PARAM_PATCH_RANGE (p)[0][1]); - if (abs(lc) < SMALL_DIFF) - return (CreateBndPOnPoint - (Heap, currBVP->patches[PARAM_PATCH_POINTS (p, 1)])); - else if (abs(lc - 1.) < SMALL_DIFF) - return (CreateBndPOnPoint - (Heap, currBVP->patches[PARAM_PATCH_POINTS (p, 2)])); - return (CreateBndPOnLine - (Heap, currBVP->patches[PARAM_PATCH_POINTS (p, 1)], - currBVP->patches[PARAM_PATCH_POINTS (p, 2)], lc)); - } - else if (abs(pos[1] - PARAM_PATCH_RANGE (p)[0][1]) < SMALL_DIFF) - { - const DOUBLE lc = (pos[0] - PARAM_PATCH_RANGE (p)[0][0]) - / (PARAM_PATCH_RANGE (p)[1][0] - PARAM_PATCH_RANGE (p)[0][0]); - if (abs(lc) < SMALL_DIFF) - return (CreateBndPOnPoint - (Heap, currBVP->patches[PARAM_PATCH_POINTS (p, 0)])); - else if (abs(lc - 1.) < SMALL_DIFF) - return (CreateBndPOnPoint - (Heap, currBVP->patches[PARAM_PATCH_POINTS (p, 1)])); - return (CreateBndPOnLine - (Heap, currBVP->patches[PARAM_PATCH_POINTS (p, 0)], - currBVP->patches[PARAM_PATCH_POINTS (p, 1)], lc)); - } - else if (abs(pos[1] - PARAM_PATCH_RANGE (p)[1][1]) < SMALL_DIFF) - { - const DOUBLE lc = (pos[0] - PARAM_PATCH_RANGE (p)[0][0]) - / (PARAM_PATCH_RANGE (p)[1][0] - PARAM_PATCH_RANGE (p)[0][0]); - if (abs(lc) < SMALL_DIFF) - return (CreateBndPOnPoint - (Heap, currBVP->patches[PARAM_PATCH_POINTS (p, 3)])); - else if (abs(lc - 1.) < SMALL_DIFF) - return (CreateBndPOnPoint - (Heap, currBVP->patches[PARAM_PATCH_POINTS (p, 2)])); - return (CreateBndPOnLine - (Heap, currBVP->patches[PARAM_PATCH_POINTS (p, 3)], - currBVP->patches[PARAM_PATCH_POINTS (p, 2)], lc)); - } -#endif -#ifdef UG_DIM_2 - /* check point on point patch */ - if (abs(pos[0] - PARAM_PATCH_RANGE (p)[0][0]) < SMALL_DIFF) - return (CreateBndPOnPoint - (Heap, currBVP->patches[PARAM_PATCH_POINTS (p, 0)])); - else if (abs(pos[0] - PARAM_PATCH_RANGE (p)[1][0]) < SMALL_DIFF) - return (CreateBndPOnPoint - (Heap, currBVP->patches[PARAM_PATCH_POINTS (p, 1)])); -#endif - - if (PATCH_TYPE (p) == PARAMETRIC_PATCH_TYPE) - { - PRINTDEBUG (dom, 1, (" id %d i %d ns %d %s pos %f\n", - pid, i, currBVP->sideoffset, argv[0], pos[0])); - ps = (BND_PS *) GetFreelistMemory (Heap, sizeof (BND_PS)); - if (ps == NULL) - return (NULL); - ps->patch_id = pid; - ps->n = 1; - for (j = 0; j < DIM_OF_BND; j++) - ps->local[0][j] = pos[j]; - } - else - return (NULL); - - if (!PATCH_IS_FIXED (p)) - { - /* store global coordinates */ - BND_DATA (ps) = GetFreelistMemory (Heap, DIM * sizeof (DOUBLE)); - if (BND_DATA (ps) == NULL) - return (NULL); - - if (BndPointGlobal ((BNDP *) ps, (DOUBLE *) BND_DATA (ps))) - return (NULL); - } - - return ((BNDP *) ps); -} - static INT AddBoundaryElement (INT n, INT * nodelist, INT left, INT right, INT *** corners, INT * sides) diff --git a/dune/uggrid/low/CMakeLists.txt b/dune/uggrid/low/CMakeLists.txt index cc096e952..83546c057 100644 --- a/dune/uggrid/low/CMakeLists.txt +++ b/dune/uggrid/low/CMakeLists.txt @@ -8,7 +8,6 @@ target_sources(duneuggrid PRIVATE heaps.cc initlow.cc misc.cc - scan.cc ugenv.cc ugstruct.cc ugtimer.cc) @@ -20,7 +19,6 @@ install(FILES heaps.h misc.h namespace.h - scan.h ugenv.h ugstruct.h ugtimer.h diff --git a/dune/uggrid/low/scan.cc b/dune/uggrid/low/scan.cc deleted file mode 100644 index 3c16af387..000000000 --- a/dune/uggrid/low/scan.cc +++ /dev/null @@ -1,146 +0,0 @@ -// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- -// vi: set et ts=4 sw=2 sts=2: -/****************************************************************************/ -/* */ -/* File: scan.c */ -/* */ -/* Purpose: tools for reading script arguments */ -/* */ -/* */ -/* Author: Christian Wieners */ -/* Institut fuer Computeranwendungen III */ -/* Universitaet Stuttgart */ -/* Pfaffenwaldring 27 */ -/* 70569 Stuttgart */ -/* email: ug@ica3.uni-stuttgart.de */ -/* */ -/* History: November 23, 1996 */ -/* low part of former np/udm/scan.c, 15.5.97 */ -/* */ -/* Remarks: */ -/* */ -/****************************************************************************/ - -/****************************************************************************/ -/* */ -/* include files */ -/* system include files */ -/* application include files */ -/* */ -/****************************************************************************/ - -#include <config.h> - -#include <cstring> -#include <cstdio> -#include <cstdlib> - -#include "debug.h" -#include "ugenv.h" -#include "misc.h" -#include "scan.h" - -USING_UG_NAMESPACE - -/****************************************************************************/ -/* */ -/* defines in the following order */ -/* */ -/* compile time constants defining static data size (i.e. arrays) */ -/* other constants */ -/* macros */ -/* */ -/****************************************************************************/ - -/****************************************************************************/ -/* */ -/* data structures used in this source file (exported data structures are */ -/* in the corresponding include file!) */ -/* */ -/****************************************************************************/ - -/****************************************************************************/ -/* */ -/* definition of exported global variables */ -/* */ -/****************************************************************************/ - -/****************************************************************************/ -/* */ -/* forward declarations of functions used before they are defined */ -/* */ -/****************************************************************************/ - -/****************************************************************************/ -/** \brief Read command line doubles - - \param name - name of the argument - \param a - DOUBLE value - \param argc - argument counter - \param argv - argument vector - - This function reads command strings and returns a DOUBLE value. - - \return <ul> - <li> 0 if the argument was found and a DOUBLE value could be read </li> - <li> 1 else. </li> - </ul> - */ -/****************************************************************************/ - -INT NS_PREFIX ReadArgvDOUBLE (const char *name, DOUBLE *a, INT argc, char **argv) -{ - INT i; - char option[OPTIONLEN]; - double value; - - for (i=0; i<argc; i++) - if (argv[i][0]==name[0]) - { - if (sscanf(argv[i],"%s %lf",option,&value)!=2) - continue; - if (strcmp(option,name) == 0) - { - a[0] = value; - return(0); - } - } - - return (1); -} - -/****************************************************************************/ -/** \brief Read command line options - - \param name - name of the argument - \param argc - argument counter - \param argv - argument vector - - This function reads command strings and returns an integer value. - - \return <ul> - <li> 0 if the option is not set </li> - <li> n if an integer n is given with the option </li> - <li> 1 else. </li> - </ul> - */ -/****************************************************************************/ - -INT NS_PREFIX ReadArgvOption (const char *name, INT argc, char **argv) -{ - INT i; - char option[OPTIONLEN]; - int value; - - for (i=0; i<argc; i++) - if (argv[i][0]==name[0]) - { - if (sscanf(argv[i],"%s %d",option,&value) == 2) - if (strcmp(option,name) == 0) - return(value); - if (strcmp(argv[i],name) == 0) - return(1); - } - - return (0); -} diff --git a/dune/uggrid/low/scan.h b/dune/uggrid/low/scan.h deleted file mode 100644 index 4137fc06d..000000000 --- a/dune/uggrid/low/scan.h +++ /dev/null @@ -1,92 +0,0 @@ -// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- -// vi: set et ts=4 sw=2 sts=2: -/****************************************************************************/ -/* */ -/* File: scan.h */ -/* */ -/* Purpose: header file for scanning routines for npinit calls */ -/* */ -/* Author: Christian Wieners */ -/* Institut fuer Computeranwendungen III */ -/* Universitaet Stuttgart */ -/* Pfaffenwaldring 27 */ -/* 70569 Stuttgart */ -/* email: ug@ica3.uni-stuttgart.de */ -/* */ -/* History: December 8, 1996 */ -/* low part of former np/scan.c, 15.5.97 */ -/* */ -/* Remarks: */ -/* */ -/****************************************************************************/ - - - -/****************************************************************************/ -/* */ -/* auto include mechanism and other include files */ -/* */ -/****************************************************************************/ - -#ifndef __SCAN__ -#define __SCAN__ - -#include "ugtypes.h" -#include "heaps.h" - -#include "namespace.h" - -START_UG_NAMESPACE - -/****************************************************************************/ -/* */ -/* defines in the following order */ -/* */ -/* compile time constants defining static data size (i.e. arrays) */ -/* other constants */ -/* macros */ -/* */ -/****************************************************************************/ - -/****************************************************************************/ -/* */ -/* general numerics defines */ -/* */ -/****************************************************************************/ - -#define OPTIONLEN 32 -#define OPTIONLENSTR "31" -#define VALUELEN 64 -#define VALUELENSTR "63" - -/****************************************************************************/ -/* */ -/* macros concerned with data descriptors and symbols */ -/* */ -/****************************************************************************/ - -/****************************************************************************/ -/* */ -/* macros concerned with solving */ -/* */ -/****************************************************************************/ - -/****************************************************************************/ -/* */ -/* structures concerned with symbolic user data management */ -/* */ -/****************************************************************************/ - -/****************************************************************************/ -/* */ -/* function declarations */ -/* */ -/****************************************************************************/ - -/* scanning argument lists */ -INT ReadArgvDOUBLE (const char *name, DOUBLE *a, INT argc, char **argv); -INT ReadArgvOption (const char *name, INT argc, char **argv); - -END_UG_NAMESPACE - -#endif -- GitLab