void
FourNodeQuadWithSensitivity::Print(OPS_Stream &s, int flag)
{
  if (flag == 2) {

    s << "#FourNodeQuadWithSensitivity\n";

    int i;
    const int numNodes = 4;
    const int nstress = 3 ;

    for (i=0; i<numNodes; i++) {
      const Vector &nodeCrd = theNodes[i]->getCrds();
      const Vector &nodeDisp = theNodes[i]->getDisp();
      s << "#NODE " << nodeCrd(0) << " " << nodeCrd(1) << " " << endln;
     }

    // spit out the section location & invoke print on the scetion
    const int numMaterials = 4;

    static Vector avgStress(nstress);
    static Vector avgStrain(nstress);
    avgStress.Zero();
    avgStrain.Zero();
    for (i=0; i<numMaterials; i++) {
      avgStress += theMaterial[i]->getStress();
      avgStrain += theMaterial[i]->getStrain();
    }
    avgStress /= numMaterials;
    avgStrain /= numMaterials;

    s << "#AVERAGE_STRESS ";
    for (i=0; i<nstress; i++)
      s << avgStress(i) << " " ;
    s << endln;

    s << "#AVERAGE_STRAIN ";
    for (i=0; i<nstress; i++)
      s << avgStrain(i) << " " ;
    s << endln;

  } else {
	s << "\nFourNodeQuadWithSensitivity, element id:  " << this->getTag() << endln;
	s << "\tConnected external nodes:  " << connectedExternalNodes;
	s << "\tthickness:  " << thickness << endln;
//	s << "\tmass density:  " << rho << endln;
	s << "\tsurface pressure:  " << pressure << endln;
	s << "\tbody forces:  " << b[0] << " " << b[1] << endln;


	theMaterial[0]->Print(s,flag);
	s << "\tStress (xx yy xy)" << endln;
	for (int i = 0; i < 4; i++)
		s << "\t\tGauss point " << i+1 << ": " << theMaterial[i]->getStress();
  }
}
Ejemplo n.º 2
0
//! @brief Prints element information.
void XC::FourNodeQuad::Print(std::ostream &s, int flag)
  {
    if(flag == 2)
      {
        s << "#FourNodeQuad\n";

        //const int numNodes = 4;
        const int nstress = 3 ;

        for(int i=0; i<numNodes(); i++)
          {
            const XC::Vector &nodeCrd = theNodes[i]->getCrds();
            //const XC::Vector &nodeDisp = theNodes[i]->getDisp();
            s << "#NODE " << nodeCrd(0) << " " << nodeCrd(1) << " " << std::endl;
          }

        // spit out the section location & invoke print on the scetion

        static const Vector &avgStress= physicalProperties.getCommittedAvgStress();
        static const Vector &avgStrain= physicalProperties.getCommittedAvgStrain();

        s << "#AVERAGE_STRESS ";
        for(int i=0; i<nstress; i++)
          s << avgStress(i) << " " ;
        s << std::endl;

        s << "#AVERAGE_STRAIN ";
        for(int i=0;i<nstress; i++)
          s << avgStrain(i) << " " ;
        s << std::endl;
      }
    else
      {
        s << "\nFourNodeQuad, element id:  " << this->getTag() << std::endl;
        s << "\tConnected external nodes:  " << theNodes;
        s << "\tphysicalProperties.getThickness():  " << physicalProperties.getThickness() << std::endl;
        s << "\tmass density:  " << physicalProperties.getRho() << std::endl;
        s << "\tsurface pressure:  " << pressure << std::endl;
        s << "\tbody forces:  " << bf << std::endl;
        physicalProperties.Print(s,flag);
        s << "\tStress (xx yy xy)" << std::endl;
        for(size_t i = 0; i < physicalProperties.size(); i++)
          s << "\t\tGauss point " << i+1 << ": " << physicalProperties[i]->getStress();
      }
  }
Ejemplo n.º 3
0
void
Tri31::Print(OPS_Stream &s, int flag)                                                                 
{
    if (flag == OPS_PRINT_CURRENTSTATE) {
        s << "\nTri31, element id:  " << this->getTag() << endln;
        s << "\tConnected external nodes:  " << connectedExternalNodes;
        s << "\tthickness:  " << thickness << endln;
        s << "\tsurface pressure:  " << pressure << endln;
        s << "\tmass density:  " << rho << endln;
        s << "\tbody forces:  " << b[0] << " " << b[1] << endln;
        theMaterial[0]->Print(s, flag);
        s << "\tStress (xx yy xy)" << endln;
        for (int i = 0; i<numgp; i++) s << "\t\tGauss point " << i + 1 << ": " << theMaterial[i]->getStress();
    }

    if (flag == 2) {

        s << "#Tri31\n";

        int i;
        const int numNodes = numnodes;
        const int nstress = numgp;

        for (i = 0; i < numNodes; i++) {
            const Vector &nodeCrd = theNodes[i]->getCrds();
            const Vector &nodeDisp = theNodes[i]->getDisp();
            s << "#NODE " << nodeCrd(0) << " " << nodeCrd(1) << " " << endln;
        }

        // spit out the section location & invoke print on the scetion
        const int numMaterials = numgp;

        static Vector avgStress(nstress);
        static Vector avgStrain(nstress);
        avgStress.Zero();
        avgStrain.Zero();
        for (i = 0; i < numMaterials; i++) {
            avgStress += theMaterial[i]->getStress();
            avgStrain += theMaterial[i]->getStrain();
        }
        avgStress /= numMaterials;
        avgStrain /= numMaterials;

        s << "#AVERAGE_STRESS ";
        for (i = 0; i < nstress; i++) s << avgStress(i) << " ";
        s << endln;

        s << "#AVERAGE_STRAIN ";
        for (i = 0; i < nstress; i++) s << avgStrain(i) << " ";
        s << endln;
    }

    if (flag == OPS_PRINT_PRINTMODEL_JSON) {
        s << "\t\t\t{";
        s << "\"name\": " << this->getTag() << ", ";
        s << "\"type\": \"Tri31\", ";
        s << "\"nodes\": [" << connectedExternalNodes(0) << ", ";
        s << connectedExternalNodes(1) << ", ";
        s << connectedExternalNodes(2) << "], ";
        s << "\"thickness\": " << thickness << ", ";
        s << "\"surfacePressure\": " << pressure << ", ";
        s << "\"masspervolume\": " << rho << ", ";
        s << "\"bodyForces\": [" << b[0] << ", " << b[1] << "], ";
        s << "\"material\": \"" << theMaterial[0]->getTag() << "\"}";
    }
}