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

Function TclCommand_addMeshRegion

SRC/runtime/commands/domain/region.cpp:30–335  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28#include <ID.h>
29
30int
31TclCommand_addMeshRegion(ClientData clientData, Tcl_Interp *interp, Tcl_Size argc,
32 TCL_Char ** const argv)
33{
34 Domain& theDomain = *static_cast<Domain*>(clientData);
35
36 int loc = 1;
37 int tag;
38 double alphaM = 0.0;
39 double betaK = 0.0;
40 double betaK0 = 0.0;
41 double betaKc = 0.0;
42
43 ID *theNodes = nullptr;
44 ID *theElements = nullptr;
45 int numNodes = 0;
46 int numElements = 0;
47
48 bool eleOnly = false;
49 bool nodeOnly = false;
50
51 // first get tag for region
52 if (argc < 2) {
53 opserr << "WARNING region tag? - no tag specified\n";
54 return TCL_ERROR;
55 }
56
57 if (Tcl_GetInt(interp, argv[loc], &tag) != TCL_OK) {
58 opserr << "WARNING region tag? .. - invalid tag " << argv[loc] << "\n";
59 return TCL_ERROR;
60 }
61
62 loc++;
63
64 // now continue until end of command
65 while (loc < argc) {
66
67 if (strcmp(argv[loc], "-ele") == 0 ||
68 strcmp(argv[loc], "-eleOnly") == 0) {
69
70 if (strcmp(argv[loc], "-eleOnly") == 0)
71 eleOnly = true;
72
73 // ensure no segmentation fault if user messes up
74 if (argc < loc + 2) {
75 opserr
76 << "WARNING region tag? .. -ele tag1? .. - no ele tags specified\n";
77 return TCL_ERROR;
78 }
79
80 //
81 // read in a list of ele until end of command or other flag
82 //
83 loc++;
84
85 if (theElements == nullptr)
86 theElements = new ID(0, 64);
87

Callers

nothing calls this directly

Calls 10

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

Tested by

no test coverage detected