MCPcopy Create free account
hub / github.com/OpenSees/OpenSees / TclAddMeshRegion

Function TclAddMeshRegion

SRC/domain/region/TclRegionCommands.cpp:45–354  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43#include <Damping.h>
44
45int
46TclAddMeshRegion(ClientData clientData, Tcl_Interp *interp, int argc,
47 TCL_Char **argv, Domain &theDomain)
48{
49 int loc = 1;
50 int tag;
51 double alphaM = 0.0;
52 double betaK = 0.0;
53 double betaK0 = 0.0;
54 double betaKc = 0.0;
55 Damping *theDamping = 0;
56
57 ID *theNodes = 0;
58 ID *theElements = 0;
59 int numNodes = 0;
60 int numElements = 0;
61
62 bool eleOnly = false;
63 bool nodeOnly = false;
64
65 // first get tag for region
66 if (argc < 2) {
67 opserr << "WARNING region tag? - no tag specified\n";
68 return TCL_ERROR;
69 }
70
71 if (Tcl_GetInt(interp, argv[loc], &tag) != TCL_OK) {
72 opserr << "WARNING region tag? .. - invalid tag " << argv[loc] << endln;
73 return TCL_ERROR;
74 }
75
76 loc++;
77
78 // now continue until end of command
79 while (loc < argc) {
80
81 if (strcmp(argv[loc],"-ele") == 0 || strcmp(argv[loc], "-eleOnly") == 0) {
82
83 if (strcmp(argv[loc], "-eleOnly") == 0)
84 eleOnly = true;
85
86 // ensure no segmentation fault if user messes up
87 if (argc < loc+2) {
88 opserr << "WARNING region tag? .. -ele tag1? .. - no ele tags specified\n";
89 return TCL_ERROR;
90 }
91
92 //
93 // read in a list of ele until end of command or other flag
94 //
95 loc++;
96
97 if (theElements == 0)
98 theElements = new ID(0, 64);
99 int eleTag;
100
101 while (loc < argc && Tcl_GetInt(interp, argv[loc++], &eleTag) == TCL_OK) {
102 (*theElements)[numElements++] = eleTag;

Callers 1

addRegionFunction · 0.85

Calls 12

OPS_getDampingFunction · 0.85
getNodesMethod · 0.80
setElementsOnlyMethod · 0.80
setNodesOnlyMethod · 0.80
getRegionMethod · 0.45
SizeMethod · 0.45
getElementsMethod · 0.45
addRegionMethod · 0.45
setElementsMethod · 0.45
setNodesMethod · 0.45
setDampingMethod · 0.45

Tested by

no test coverage detected