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

Function OPS_NewElement

SRC/element/OPS_NewElement.cpp:32–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30#include <UniaxialMaterial.h>
31
32void *OPS_NewElement(void) {
33
34 //
35 // create 2 arrays; one each for integer and double command line arguments
36 //
37
38 int iData[1]; // integer args on command line of size 1, change to suit
39 double dData[1]; // double args on command line of size 1, change to suit
40
41 //
42 // read values from command line of script
43 //
44
45 int numArgs = OPS_GetNumRemainingInputArgs();
46 if (numArgs != 1) {
47 opserr << "WARNING incorrect # args, want: element NewElement $id" << endln;
48 return 0;
49 }
50
51 int numData = 1; // num integer args
52 if ((numData > 0) && (OPS_GetIntInput(&numData, &iData[0]) < 0)) {
53 opserr << "WARNING failed to read integers, command element NewElement" << endln;
54 return 0;
55 }
56
57 numData = 0; // reset to num double args
58 if ((numData > 0) && (OPS_GetDoubleInput(&numData, &dData[0]) < 0)) {
59 opserr << "WARNING failed to read doubles, command element NewElement" << endln;
60 return 0;
61 }
62
63 //
64 // get a pointer to a uniaxial material already defined
65 //
66
67 // int matTag = iData[??]
68 // UniaxialMaterial *theMat = OPS_getUnixialMaterial(matTag);
69
70 //
71 // return pointer to new element
72 //
73
74
75 return new NewElement(iData[0]);
76}

Callers

nothing calls this directly

Calls 3

OPS_GetIntInputFunction · 0.50
OPS_GetDoubleInputFunction · 0.50

Tested by

no test coverage detected