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

Function OPS_Pattern

SRC/interpreter/OpenSeesPatternCommands.cpp:84–138  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82
83
84int OPS_Pattern()
85{
86 theActiveMultiSupportPattern = 0;
87 theActiveUniformPattern = 0;
88 theActiveLoadPattern = 0;
89
90 // num args
91 if(OPS_GetNumRemainingInputArgs() < 1) {
92 opserr<<"WARNING insufficient args: pattern type ...\n";
93 return -1;
94 }
95
96 // create pattern
97 const char* type = OPS_GetString();
98 LoadPattern* pattern = 0;
99 if (strcmp(type, "Plain") == 0) {
100
101 theActiveLoadPattern = (LoadPattern*)OPS_LoadPattern();
102 pattern = theActiveLoadPattern;
103
104 } else if (strcmp(type, "UniformExcitation") == 0) {
105
106 theActiveUniformPattern = (UniformExcitation*)OPS_UniformExcitationPattern();
107 pattern = theActiveUniformPattern;
108
109 } else if (strcmp(type, "MultipleSupport") == 0) {
110
111 theActiveMultiSupportPattern = (MultiSupportPattern*)OPS_MultiSupportPattern();
112 pattern = theActiveMultiSupportPattern;
113
114 } else {
115 opserr<<"WARNING unknown pattern type"<<type<<"\n";
116 return -1;
117 }
118
119 if (pattern == 0) {
120 opserr<<"WARNING failed to create pattern\n";
121 return -1;
122 }
123
124 // add to domain
125 Domain* theDomain = OPS_GetDomain();
126 if (theDomain == 0) {
127 opserr<<"WARNING no domain is created\n";
128 return -1;
129 }
130 if (theDomain->addLoadPattern(pattern) == false) {
131 opserr<<"WARNING failed to add pattern to domain\n";
132 delete pattern;
133 pattern = 0;
134 return -1;
135 }
136
137 return 0;
138}
139
140int OPS_NodalLoad()
141{

Callers 2

Tcl_ops_patternFunction · 0.85
Py_ops_patternFunction · 0.85

Calls 7

OPS_LoadPatternFunction · 0.85
OPS_MultiSupportPatternFunction · 0.85
OPS_GetStringFunction · 0.70
OPS_GetDomainFunction · 0.70
addLoadPatternMethod · 0.45

Tested by

no test coverage detected