From 5a054bcaa013187f46f079c7a6168a1f303d592a Mon Sep 17 00:00:00 2001 From: DuncanMcGeehan <43180955+DuncanMcGeehan@users.noreply.github.com> Date: Mon, 26 Aug 2024 17:38:06 -0400 Subject: [PATCH 1/3] [FIX] Add JSON flag to J2PlateFibre Print. --- SRC/material/nD/J2PlateFibre.cpp | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/SRC/material/nD/J2PlateFibre.cpp b/SRC/material/nD/J2PlateFibre.cpp index 82dc47a07a..2ec822a968 100644 --- a/SRC/material/nD/J2PlateFibre.cpp +++ b/SRC/material/nD/J2PlateFibre.cpp @@ -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 From 98dd9c8e763a66a3c9a4f0974d5c3f189a3ae5dc Mon Sep 17 00:00:00 2001 From: DuncanMcGeehan <43180955+DuncanMcGeehan@users.noreply.github.com> Date: Mon, 26 Aug 2024 17:40:43 -0400 Subject: [PATCH 2/3] [FIX] Add JSON flag to MembranePlateFiberSection Print. --- .../section/MembranePlateFiberSection.cpp | 30 +++++++++++++++---- 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/SRC/material/section/MembranePlateFiberSection.cpp b/SRC/material/section/MembranePlateFiberSection.cpp index c00eceb7c3..a2d5e388e0 100644 --- a/SRC/material/section/MembranePlateFiberSection.cpp +++ b/SRC/material/section/MembranePlateFiberSection.cpp @@ -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 From cba1325a7f5a10e62de91195a92d0d5cf9db6227 Mon Sep 17 00:00:00 2001 From: DuncanMcGeehan <43180955+DuncanMcGeehan@users.noreply.github.com> Date: Mon, 26 Aug 2024 17:48:18 -0400 Subject: [PATCH 3/3] [FIX] Update PVD recorder to handle one element request per "eleResponse" input This change allows the user to request multiple element outputs from a single PVD recorder. Each time the 'eleResponse' keyword is identified it is treated independently of previous requests. The previous implementation resulted in all requests following the keyword to be concatenated and only the first request to actually be output in the PVD recorder with an incorrect name. --- SRC/recorder/PVDRecorder.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/SRC/recorder/PVDRecorder.cpp b/SRC/recorder/PVDRecorder.cpp index b6cee4212d..d7e35202a6 100644 --- a/SRC/recorder/PVDRecorder.cpp +++ b/SRC/recorder/PVDRecorder.cpp @@ -111,10 +111,9 @@ void* OPS_PVDRecorder() } PVDRecorder::EleData edata; numdata = OPS_GetNumRemainingInputArgs(); - edata.resize(numdata); - for(int i=0; i