Skip to content

Commit

Permalink
Merge pull request OpenSees#1492 from DuncanMcGeehan/FIX/PVD_and_JSON…
Browse files Browse the repository at this point in the history
…_print

[FIX] PVD eleResponse behavior, JSON print flag
  • Loading branch information
mhscott authored Aug 28, 2024
2 parents b039785 + cba1325 commit 032a6a7
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 19 deletions.
29 changes: 20 additions & 9 deletions SRC/material/nD/J2PlateFibre.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -887,16 +887,27 @@ J2PlateFibre::recvSelf (int commitTag, Channel &theChannel,
}

void
J2PlateFibre::Print (OPS_Stream &s, int flag)
J2PlateFibre::Print(OPS_Stream &s, int flag)
{
s << "J2 Plate Fibre Material Model" << endln;
s << "\tE: " << E << endln;
s << "\tnu: " << nu << endln;
s << "\tsigmaY: " << sigmaY << endln;
s << "\tHiso: " << Hiso << endln;
s << "\tHkin: " << Hkin << endln;

return;
if (flag == OPS_PRINT_PRINTMODEL_MATERIAL) {
s << "J2 Plate Fibre Material Model" << endln;
s << "\tE: " << E << endln;
s << "\tnu: " << nu << endln;
s << "\tsigmaY: " << sigmaY << endln;
s << "\tHiso: " << Hiso << endln;
s << "\tHkin: " << Hkin << endln;
}

if (flag == OPS_PRINT_PRINTMODEL_JSON) {
s << "\t\t\t{";
s << "\"name\": \"" << this->getTag() << "\", ";
s << "\"type\": \"J2PlateFibre\", ";
s << "\"E\": " << E << ", ";
s << "\"nu\": " << nu << ", ";
s << "\"fy\": " << sigmaY << ", ";
s << "\"Hiso\": " << Hiso << ", ";
s << "\"Hkin\": " << Hkin << "}";
}
}

int
Expand Down
30 changes: 24 additions & 6 deletions SRC/material/section/MembranePlateFiberSection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -512,14 +512,32 @@ const Matrix& MembranePlateFiberSection::getSectionTangent( )
//print out data
void MembranePlateFiberSection::Print( OPS_Stream &s, int flag )
{
s << "MembranePlateFiberSection: \n " ;
s << " Thickness h = " << h << endln ;
if (flag == OPS_PRINT_PRINTMODEL_JSON) {
s << "\t\t\t{";
s << "\"name\": \"" << this->getTag() << "\", ";
s << "\"type\": \"PlateFiber\", ";
s << "\"thickness\": \"" << h << "\", ";
s << "\"fibers\": [\n";
for (int i = 0; i < numFibers; i++) {
s << "\t\t\t\t{\"centroid\": " << (i+0.5) * h / numFibers << ", ";
s << "\"material\": \"" << theFibers[i]->getTag() << "\"";
if (i < numFibers - 1)
s << "},\n";
else
s << "}\n";
}
s << "\t\t\t]}";
}
else {
s << "MembranePlateFiberSection: \n ";
s << " Thickness h = " << h << endln;

for (int i = 0; i < numFibers; i++) {
theFibers[i]->Print( s, flag ) ;
}
for (int i = 0; i < numFibers; i++) {
theFibers[i]->Print(s, flag);
}

return ;
return;
}
}

int
Expand Down
7 changes: 3 additions & 4 deletions SRC/recorder/PVDRecorder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,9 @@ void* OPS_PVDRecorder()
}
PVDRecorder::EleData edata;
numdata = OPS_GetNumRemainingInputArgs();
edata.resize(numdata);
for(int i=0; i<numdata; i++) {
edata[i] = OPS_GetString();
}
edata.resize(1);
edata[0] = OPS_GetString();
// opserr << "WARNING - EDATA[i]="<< edata[0].c_str() << "\n";
eledata.push_back(edata);
} else if(strcmp(type, "-dT") == 0) {
numdata = OPS_GetNumRemainingInputArgs();
Expand Down

0 comments on commit 032a6a7

Please sign in to comment.