Esempio n. 1
0
LVector LTransform::operator*(const LVector rhs) const
{
    if (_orderIn != rhs.getOrder())
        FormatAndThrow<>()
                << "Order mismatch between LTransform [" << _orderIn
                << "] and LVector [" << rhs.getOrder()
                << "]";
    boost::shared_ptr<tmv::Vector<double> > out(new tmv::Vector<double>(sizeOut()));
    *out = (*_m) * rhs.rVector();
    return LVector(_orderOut, out);
}
Esempio n. 2
0
LTransform LTransform::operator*(const LTransform rhs) const
{
    if (_orderIn != rhs.getOrderOut())
        FormatAndThrow<>()
                << "Order mismatch between LTransform [" << _orderIn
                << "] and LTransform [" << rhs.getOrderOut()
                << "]";
    boost::shared_ptr<tmv::Matrix<double> > out(
        new tmv::Matrix<double>(sizeOut(),rhs.sizeIn()));
    *out = (*_m) * (*rhs._m);
    return LTransform(_orderOut, rhs._orderIn, out);
}
Esempio n. 3
0
// main routine
int main(int argc, char **argv)
{
  // Define force-deformation relationship for spring

  // dummy specimen
  UniaxialMaterial *theMaterial1 = new ElasticMaterial(1, 5.0);
  UniaxialMaterial *theMaterial2 = new Steel01(2, 5.0, 5.0, 0.1);

    
  // set ctrlData, daqData
  int numMat = 2;
  /*
  ExperimentalCP **cCP = new ExperimentalCP* [2];
  ArrayOfTaggedObjects *ctrlData = new ArrayOfTaggedObjects(1);
  cCP[0] = new ExperimentalCP(1, 1, OF_Dir_X, OF_Resp_Disp);
  cCP[1] = new ExperimentalCP(2, 1, OF_Dir_X, OF_Resp_Vel);
  for(int i=0; i<2; i++) 
    ctrlData->addComponent(cCP[i]);

  ExperimentalCP **dCP = new ExperimentalCP* [3];
  ArrayOfTaggedObjects *daqData = new ArrayOfTaggedObjects(1);
  dCP[0] = new ExperimentalCP(1, 1, OF_Dir_X, OF_Resp_Disp);
  dCP[1] = new ExperimentalCP(2, 1, OF_Dir_X, OF_Resp_Force);
  dCP[2] = new ExperimentalCP(3, 1, OF_Dir_X, OF_Resp_Vel);
  for(int i=0; i<3; i++) 
    daqData->addComponent(dCP[i]);
  */
  ID sizeTrial(OF_Resp_All), sizeOut(OF_Resp_All);
//  ID sizeTrial(5), sizeOut(5);
  sizeTrial[0] = numMat;
  sizeTrial[1] = numMat;
  sizeOut[0] = numMat;
  sizeOut[1] = numMat;
  sizeOut[3] = numMat;
  
  // Define ExperimentalControl
  ECSimUniaxialMaterials *theController 
    = new ECSimUniaxialMaterials(1, sizeTrial, sizeOut);
  //    = new ECSimUniaxialMaterials(1, *ctrlData, *daqData);
  theController->addDummySpecimen(theMaterial1);
  theController->addDummySpecimen(theMaterial2);

  theController->setup();

  Vector *disp, *vel, *force;
  Vector *Tdisp, *Tvel;
  disp = new Vector(numMat);
  vel = new Vector(numMat);
  force = new Vector(numMat);
  Tdisp = new Vector(numMat);
  Tvel = new Vector(numMat);

  ofstream OUTD("outD.dat");
  ofstream OUTF("outF.dat");
  int i,j;
  for(i=0; i<100; i++) {
    for(j=0; j<numMat; j++) {
      (*Tdisp)[j] = 3.0*sin(2.*3.141592*i/100);
    }

    theController->setTrialResponse(Tdisp, Tvel, (Vector*)0, (Vector*)0, (Vector*)0);
    theController->getDaqResponse(disp, vel, (Vector*)0, force, (Vector*)0);

    opserr << "Tdisp = " << *Tdisp;
    opserr << "Tvel = " << *Tvel << endln;
    opserr << "disp = " << *disp;
    opserr << "vel = " << *vel;
    opserr << "force = " << *force << endln;

    for(j=0; j<numMat; j++) {
      OUTD << ' ' << (*disp)[j];
      OUTF << ' ' << (*force)[j];
    }
    OUTD << endln; OUTF << endln;

    theController->commitState();
  }

  return 0;
}