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

Method record

SRC/recorder/DamageRecorder.cpp:186–238  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

184
185
186int
187DamageRecorder::record(int commitTag, double timeStamp)
188{
189 int result = 0;
190 // where 1.0e-5 is the maximum reliable ratio between analysis time step and deltaT
191 // and provides tolerance for floating point precision (see floating-point-tolerance-for-recorder-time-step.md)
192 if (deltaT == 0.0 || timeStamp - nextTimeStampToRecord >= -deltaT * relDeltaTTol) {
193
194 if (deltaT != 0.0)
195 nextTimeStampToRecord = timeStamp + deltaT;
196
197 // print out the pseudo time if requested
198 int counter = 0;
199 if (echoTimeFlag == true) {
200 (*data)(counter++) = timeStamp;
201 }
202
203 Vector DamageInformation(3);
204 // get the responses and write to file if file or opserr specified
205 // for each element do a getResponse() & print the result
206 for (int i=0; i< numSec; i++) {
207 DamageInformation.Zero();
208 for ( int j=0 ; j<2 ; j++) {
209 if ( theResponses[i+numSec*j] == 0) {
210 DamageInformation(j) = 0.0;
211 } else {
212 if ( theResponses[i+numSec*j]->getResponse() < 0) {
213 DamageInformation(j) = 0.0;
214 } else {
215 // ask the element for the response
216 Information &eleinfo = theResponses[i+numSec*j]->getInformation();
217 const Vector &infovector = eleinfo.getData();
218 DamageInformation(j) = infovector(dofID);
219 }
220 }
221 }
222 DamageInformation(2) = 0.0;
223 theDamageModels[i]->setTrial(DamageInformation);
224 theDamageModels[i]->commitState();
225 double Damageindex = theDamageModels[i]->getDamage();
226
227 // print results to file or stderr depending on whether
228 // a file was opened
229
230 (*data)(counter++) = Damageindex;
231 }
232 }
233
234 theOutput->write(*data);
235
236 // successful completion - return 0
237 return result;
238}
239
240
241int

Callers

nothing calls this directly

Calls 7

ZeroMethod · 0.45
getResponseMethod · 0.45
getDataMethod · 0.45
setTrialMethod · 0.45
commitStateMethod · 0.45
getDamageMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected