示例#1
0
int 
PetscSOE::addB(const Vector &v, const ID &id, double fact)
{
    // check for a quick return 
    if (fact == 0.0)  return 0;


    // check that m and id are of similar size
    int idSize = id.Size();        
    if (idSize != v.Size() ) {
	opserr << "PetscSOE::addB() - Vector and ID not of similar sizes\n";
	return -1;
    }    
    
    int n = id.Size();
    int row;
    double value;
    for (int i=0; i<n; i++) {
      row = id(i);
      if (row >= 0) {
	value = v(i) * fact;
	int ierr = VecSetValues(b,1,&row,&value,ADD_VALUES); CHKERRA(ierr); 
      }
    }

    return 0;
}
示例#2
0
int 
PetscSOE::addA(const Matrix &m, const ID &id, double fact)
{
  isFactored = 0;

    // check for a quick return 
    if (fact == 0.0)  return 0;

    
    // check that m and id are of similar size
    int idSize = id.Size();    
    if (idSize != m.noRows() && idSize != m.noCols()) {
	opserr << "PetscSOE::addA() - Matrix and ID not of similar sizes\n";
	return -1;
    }
    
    int n = id.Size();
    int row;
    int col;
    double value;
    for (int i=0; i<n; i++) {
      row = id(i);
      if (row >= 0) {
	for (int j=0; j<n; j++) {
	  col = id(j);
	  if (col >= 0) {
	    value = m(i,j)*fact;
	    int ierr = MatSetValues(A,1,&row,1,&col,&value,ADD_VALUES); CHKERRA(ierr); 
	  }
	}
      }
    }

    return 0;
}
示例#3
0
/**
 * Try to read data from file into newly allocated array and pass 
 * to ID
 * pre! old and new ID have the same data size (uncorrupted)
 * and same endianness
 */
int FileChannel::recvID(int dbTag, int commitTag, 
	       ID &theID,  ChannelAddress *theAddress) 
{

  int nleft,size,i;
  size = theID.Size();
  int *data = new int[size];
  void * gMsg = (void *)data;;
  nleft =  theID.Size() * sizeof(int);

  if( theFile ) {
  
	i =  fread( gMsg, nleft, 1, theFile);
 
	if ( i == 1 ) {
	  theID.setData( data, size );
	  return 0;
	}
	opserr << "FileChannel::recvID, error reading from open file\n";
  }
  else
	opserr << "FileChannel::recvID, error reading, NULL file handle\n";

  return -1;


}    
示例#4
0
文件: DriftRecorder.cpp 项目: lcpt/xc
XC::DriftRecorder::DriftRecorder(const ID &nI,const ID &nJ, int df,int dirn, Domain &theDom, DataOutputHandler &theDataOutputHandler, bool timeFlag)
  :HandlerRecorder(RECORDER_TAGS_DriftRecorder,theDom,theDataOutputHandler,timeFlag),
   ndI(nullptr), ndJ(nullptr), theNodes(0), dof(df), perpDirn(dirn),
   oneOverL(), data(), numNodes(0)
  {
    assert(nI.Size()==nJ.Size());
    set_ndIJ(nI,nJ);
  }
示例#5
0
文件: Matrix.cpp 项目: lge88/OpenSees
Matrix
Matrix::operator()(const ID &rows, const ID & cols) const
{
    int nRows, nCols;
    nRows = rows.Size();
    nCols = cols.Size();
    Matrix result(nRows,nCols);
    double *dataPtr = result.data;
    for (int i=0; i<nCols; i++)
	for (int j=0; j<nRows; j++)
	    *dataPtr++ = (*this)(rows(j),cols(i));

    return result;
}
int
IncrementalIntegrator::getLastResponse(Vector &result, const ID &id)
{
  
    if (theSOE == 0) {
	opserr << "WARNING IncrementalIntegrator::getLastResponse() -";
	opserr << "no LineaerSOE object associated with this object\n";	
	return -1;
    }

    int res = 0; 
    int size = theSOE->getNumEqn() -1;
    const Vector &X = theSOE->getX();
    for (int i=0; i<id.Size(); i++) {
	int loc = id(i);
	if (loc < 0 )
	  result(i) = 0.0;
	else if (loc <= size) {
	  result(i) = X(loc);	
	}
	else {
	    opserr << "WARNING IncrementalIntegrator::getLastResponse() -";
	    opserr << "location " << loc << "in ID outside bounds ";
	    opserr << size << "\n";	
	    res = -2;
	}
    }	    
    return res;
}
示例#7
0
void
Mesh::addEleNodes(const ID& tags)
{
    for (int i=0; i<tags.Size(); ++i) {
	elenodes.insert(tags(i));
    }
}
int 
DistributedSparseGenColLinSOE::addB(const Vector &v, const ID &id, double fact)
{
    // check for a quick return 
    if (fact == 0.0)  return 0;

    int idSize = id.Size();    
    // check that m and id are of similar size
    if (idSize != v.Size() ) {
	opserr << "SparseGenColLinSOE::addB() ";
	opserr << " - Vector and ID not of similar sizes\n";
	return -1;
    }    

    if (fact == 1.0) { // do not need to multiply if fact == 1.0
	for (int i=0; i<idSize; i++) {
	    int pos = id(i);
	    if (pos <size && pos >= 0)
		myB[pos] += v(i);
	}
    } else if (fact == -1.0) { // do not need to multiply if fact == -1.0
	for (int i=0; i<idSize; i++) {
	    int pos = id(i);
	    if (pos <size && pos >= 0)
		myB[pos] -= v(i);
	}
    } else {
	for (int i=0; i<idSize; i++) {
	    int pos = id(i);
	    if (pos <size && pos >= 0)
		myB[pos] += v(i) * fact;
	}
    }	
    return 0;
}
示例#9
0
int 
ItpackLinSOE::addA(const Matrix &m, const ID &id, double fact)
{
  // check for a quick return 
  if (fact == 0.0)  
    return 0;
  
  int idSize = id.Size();
  
  // check that m and id are of similar size
  if (idSize != m.noRows() && idSize != m.noCols()) {
    opserr << "ItpackLinSOE::addA() ";
    opserr << " - Matrix and ID not of similar sizes\n";
    return -1;
  }
  
  if (fact == 1.0) { // do not need to multiply 
    for (int i=0; i<idSize; i++) {
      int row = id(i);
      if (row < size && row >= 0) {
	int startRowLoc = rowStartA[row];
	int endRowLoc = rowStartA[row+1];
	for (int j=0; j<idSize; j++) {
	  int col = id(j);
	  if (col <size && col >= 0) {
	    // find place in A using colA
	    for (int k=startRowLoc; k<endRowLoc; k++)
	      if (colA[k] == col) {
		A[k] += m(i,j);
		k = endRowLoc;
	      }
	  }
	}  // for j		
      } 
    }  // for i
  }
  else {
    for (int i=0; i<idSize; i++) {
      int row = id(i);
      if (row < size && row >= 0) {
	int startRowLoc = rowStartA[row];
	int endRowLoc = rowStartA[row+1];
	for (int j=0; j<idSize; j++) {
	  int col = id(j);
	  if (col <size && col >= 0) {
	    // find place in A using colA
	    for (int k=startRowLoc; k<endRowLoc; k++)
	      if (colA[k] == col) {
		A[k] += fact * m(i,j);
		k = endRowLoc;
	      }
	  }
	}  // for j		
      } 
    }  // for i
  }
  
  return 0;
}
示例#10
0
MaxNodeDispRecorder::MaxNodeDispRecorder(int theDof, 
					 const ID &nodes, 
					 Domain &theDom)
:Recorder(RECORDER_TAGS_MaxNodeDispRecorder), theNodes(nodes), maxDisp(nodes.Size()), 
 dof(theDof), theDomain(&theDom)
{
    if (dof < 0) dof = 0;
}
示例#11
0
int 
MeshRegion::setElements(const ID &theEles)
{
  // destroy the old lists
  if (theNodes != 0)
    delete theNodes;
  if (theElements != 0)
    delete theElements;

  // create new element & node lists

  int numEle = theEles.Size();

  theElements = new ID(0, numEle); // don't copy yet .. make sure ele in domain
  theNodes = new ID(0, numEle); // initial guess at size of ID
  if (theElements == 0 || theNodes == 0) {
    opserr << "MeshRegion::setElements() - ran out of memory\n";
    return -1;
  }

  // now loop over the elements in ele ID passed in to create the node & ele list
  // NOTE - only add those elements to the list that are in the domain
  // NOTE - node added to region if any element has it as an external node
  int locEle = 0;
  int locNode = 0;


  Domain *theDomain = this->getDomain();
  if (theDomain == 0) {
    opserr << "MeshRegion::setElements() - no domain yet set\n";
    return -1;
  }

  Element *theEle;
  for (int i=0; i<numEle; i++) {
    int eleTag = theEles(i);
    theEle = theDomain->getElement(eleTag);
    if (theEle != 0) {

      if (theElements->getLocation(eleTag) < 0)
	  (*theElements)[locEle++] = eleTag;

      const ID &theEleNodes = theEle->getExternalNodes();

      for (int i=0; i<theEleNodes.Size(); i++) {
	int nodeTag = theEleNodes(i);
	// add the node tag if not already there
	if (theNodes->getLocation(nodeTag) < 0)
	  (*theNodes)[locNode++] = nodeTag;
      }
    }
  }

  return 0;
}
示例#12
0
int OPS_PFEMElement2D(Domain& theDomain, const ID& elenodes, ID& eletags)
{
    int numdata = OPS_GetNumRemainingInputArgs();
    if(numdata < 4) {
	opserr<<"WARNING: insufficient number of arguments\n";
	return 0;
    }

    // rho, mu, b1, b2, (thickness, kappa, lumped)
    numdata = OPS_GetNumRemainingInputArgs();
    if(numdata > 7) numdata = 7;
    double data[7] = {0,0,0,0,1.0,-1,1};
    if(OPS_GetDoubleInput(&numdata,data) < 0) return 0;

    // create elements
    ElementIter& theEles = theDomain.getElements();
    Element* theEle = theEles();
    int currTag = 0;
    if (theEle != 0) {
	currTag = theEle->getTag();
    }

    eletags.resize(elenodes.Size()/3);

    for (int i=0; i<eletags.Size(); i++) {
	theEle = new PFEMElement2D(--currTag,elenodes(3*i),elenodes(3*i+1),elenodes(3*i+2),
				   data[0],data[1],data[2],data[3],data[4],data[5],data[6]);
	if (theEle == 0) {
	    opserr<<"WARNING: run out of memory for creating element\n";
	    return -1;
	}
	if (theDomain.addElement(theEle) == false) {
	    opserr<<"WARNING: failed to add element to domain\n";
	    delete theEle;
	    return -1;
	}
	eletags(i) = currTag;
    }

    return 0;
}
示例#13
0
int FileChannel::sendID(int dbTag, int commitTag, const ID &theID,ChannelAddress *theAddress)
{
  int i;
  int  nleft = theID.Size()*sizeof(int);    
  int *data = new int[theID.Size()];
  void *gMsg = (void *)data;

  /* I don't want to break encapsulation by being friends */
  for (i = 0; i < theID.Size(); i++ ) {
	data[i] = theID(i);
  }
 
  i =  fwrite( gMsg, nleft, 1, theFile);

  if ( i != 1 ) {
	printf("Error in FileChannel::sendID, did not write\n");
	delete []data;
	return -1;
  }
  delete [] data;
  return 0;
}
示例#14
0
文件: Vector.cpp 项目: lge88/OpenSees
Vector 
Vector::operator()(const ID &rows) const
{
  // create a new Vector to be returned
  Vector result(rows.Size());

  // check if obtained VEctor of correct size
  if (result.Size() != rows.Size()) {
    opserr << "Vector::()(ID) - new Vector could not be constructed\n";
    return result;
  }

  // copy the appropraite contents from current to result     
  int pos;
  for (int i=0; i<rows.Size(); i++) {
    pos = rows(i);
    if (pos <0 || pos >= sz) {
      opserr << "Vector::()(ID) - invalid location " << pos << " outside range [0, " << sz-1 << "]\n";
    } else
      result(i) = (*this)(pos);
  }
  return result;
}
示例#15
0
文件: Matrix.cpp 项目: lge88/OpenSees
int
Matrix::Assemble(const Matrix &V, const ID &rows, const ID &cols, double fact) 
{
  int pos_Rows, pos_Cols;
  int res = 0;

  for (int i=0; i<cols.Size(); i++) {
    pos_Cols = cols(i);
    for (int j=0; j<rows.Size(); j++) {
      pos_Rows = rows(j);
      
      if ((pos_Cols >= 0) && (pos_Rows >= 0) && (pos_Rows < numRows) &&
	  (pos_Cols < numCols) && (i < V.numCols) && (j < V.numRows))
	(*this)(pos_Rows,pos_Cols) += V(j,i)*fact;
      else {
	opserr << "WARNING: Matrix::Assemble(const Matrix &V, const ID &l): ";
	opserr << " - position (" << pos_Rows << "," << pos_Cols << ") outside bounds \n";
	res = -1;
      }
    }
  }

  return res;
}
示例#16
0
int 
SkylineSPD::addB(const Vector &v, const ID &id, double fact)
{
    
    // check for a quick return 
    if (fact == 0.0)  return 0;

    // check that m and id are of similar size
    int idSize = id.Size();        
    if (idSize != v.Size() ) {
	opserr << "SkylineSPD::addB() -";
	opserr << " Vector and ID not of similar sizes\n";
	return -1;
    }    
    
    if (fact == 1.0) { // do not need to multiply if fact == 1.0
	for (int i=0; i<id.Size(); i++) {
	    int pos = id(i);
	    if (pos <size && pos >= 0)
		B[pos] += v(i);
	}
    } else if (fact == -1.0) { // do not need to multiply if fact == -1.0
	for (int i=0; i<id.Size(); i++) {
	    int pos = id(i);
	    if (pos <size && pos >= 0)
		B[pos] -= v(i);
	}
    } else {
	for (int i=0; i<id.Size(); i++) {
	    int pos = id(i);
	    if (pos <size && pos >= 0)
		B[pos] += v(i) * fact;
	}
    }	
    return 0;
}
示例#17
0
/* assemble the force vector B (A*X = B).
 */
int XC::SymSparseLinSOE::addB(const XC::Vector &in_v, const ID &in_id,const double &fact)
  {
    // check for a quick return 
    if(fact == 0.0)  return 0;

    int idSize = in_id.Size();    
    // check that m and id are of similar size
    if(idSize != in_v.Size() )
      {
	std::cerr << "XC::SymSparseLinSOE::addB() ";
	std::cerr << " - Vector and XC::ID not of similar sizes\n";
	return -1;
      }

     // construct v and id based on non-negative id values.
     int newPt = 0;
     std::vector<int> id(idSize);
     Vector v(idSize);

     for(int ii = 0; ii < idSize; ii++)
       {
         if(in_id(ii) >= 0 && in_id(ii) < size)
           {
	     id[newPt] = in_id(ii);
	     v[newPt] = in_v(ii);
	     newPt++;
           }
       }

     idSize = newPt;
     if(idSize == 0)
       return 0;

     ID newID(idSize);

     for(int i=0; i<idSize; i++)
       {
         newID[i]= id[i];
	 if(newID[i] >= 0)
	   newID[i] = invp[newID[i]];
       }

    SparseSOEBase::addB(v,newID,fact);

    return 0;
  }
示例#18
0
int 
FullGenLinSOE::addA(const Matrix &m, const ID &id, double fact)
{
    // check for a quick return 
    if (fact == 0.0)  return 0;

    int idSize = id.Size();
    
    // check that m and id are of similar size
    if (idSize != m.noRows() && idSize != m.noCols()) {
	opserr << "FullGenLinSOE::addA()	- Matrix and ID not of similar sizes\n";
	return -1;
    }
    
    if (fact == 1.0) { // do not need to multiply 
	for (int i=0; i<idSize; i++) {
	    int col = id(i);
	    if (col < size && col >= 0) {
		double *startColiPtr = A + col*size;
		for (int j=0; j<idSize; j++) {
		    int row = id(j);
		    if (row <size && row >= 0) {
			 double *APtr = startColiPtr + row;
			 *APtr += m(j,i);
		     }
		}  // for j
	    } 
	}  // for i
    } else {
	for (int i=0; i<idSize; i++) {
	    int col = id(i);
	    if (col < size && col >= 0) {
		double *startColiPtr = A + col*size;
		for (int j=0; j<idSize; j++) {
		    int row = id(j);
		    if (row <size && row >= 0) {
			 double *APtr = startColiPtr + row;
			 *APtr += m(j,i) * fact;
		     }
		}  // for j
	    } 
	}  // for i
    }    
    return 0;
}
示例#19
0
文件: BandArpackSOE.cpp 项目: lcpt/xc
//! @brief Assemblies in M the matrix being passed as parameter
//! multiplied by the fact parameter.
int XC::BandArpackSOE::addM(const Matrix &m, const ID &id, double fact)
  {
    bool retval= 0;
    //Added by LCPT.
    if(fact!=0.0)
      {
        const int idSize = id.Size();
        // check that m and id are of same size
        if(idSize != m.noRows() && idSize != m.noCols())
          {
            std::cerr << "BandArpackSOE::addM(); Matrix and ID not of similar sizes\n";
            retval= -1;
          }
        else
          {
            resize_mass_matrix_if_needed(size);      
            int col= 0, row= 0;
            if(fact==1.0)
              {
                for(int i=0; i<idSize; i++)
                  for(int j=0; j<idSize; j++)
                    {
                      col= id(i);
                      row = id(j);
                      massMatrix(row,col)+= m(i,j);
                    }
              }
            else
              {
                for(int i=0; i<idSize; i++)
                  for(int j=0; j<idSize; j++)
                    {
                      col= id(i);
                      row = id(j);
                      massMatrix(row,col)+= m(i,j)*fact;
                    }
              }
          }
      }
    //Added by LCPT ends.
    retval= this->addA(m, id, -shift);
    return retval;
  }
示例#20
0
int
ShadowSubdomain::addSP_Constraint(int axisDirn, double axisValue, 
				  const ID &fixityCodes, double tol)
{

#ifdef _G3DEBUG
	// do all the checking stuff
#endif

    msgData(0) = ShadowActorSubdomain_addSP_ConstraintAXIS;
    msgData(2) = axisDirn;
    msgData(3) = fixityCodes.Size();

    this->sendID(msgData);

    this->sendID(fixityCodes);
    static Vector data(2);
    data(0) = axisValue;
    data(1) = tol;
    this->sendVector(data);
    // this->Domain::domainChange();

    this->recvID(msgData);   

    // now if we have created any in the actor we have to add them here
    int endTag = msgData(1);
    int numSP = endTag;
    if (numSP != 0) {
      ID theID(numSP);
      this->recvID(theID);
      for (int i=0; i<numSP; i++) {
	SP_Constraint *theSP = theObjectBroker->getNewSP(theID(i));
	if (theSP != 0) {
	  this->recvObject(*theSP);
	  numSPs++;    
	  theShadowSPs->addComponent(theSP);	  
	}
      }
    }
    return endTag;
}
示例#21
0
文件: Vector.cpp 项目: lge88/OpenSees
int 
Vector::Assemble(const Vector &V, const ID &l, double fact )
{
  int result = 0;
  int pos;
  for (int i=0; i<l.Size(); i++) {
    pos = l(i);
    
    if (pos < 0)
      ;
    else if ((pos < sz) && (i < V.Size()))
      // assemble into vector
      theData[pos] += V.theData[i] *fact;
    else {
      result = -1;
      if (pos < sz)
	opserr << "Vector::Assemble() " << pos << " out of range [1, " << sz-1 << "]\n";
      else
	opserr << "Vector::Assemble() " << pos << " out of range [1, "<< V.Size()-1 << "]\n";
    }
  }
  return result;
}
示例#22
0
文件: BandArpackSOE.cpp 项目: lcpt/xc
//! @brief Assemblies in A the matrix being passed as parameter
//! multiplied by the fact parameter.
int XC::BandArpackSOE::addA(const Matrix &m, const ID &id, double fact)
  {
    // check for a quick return
    if(fact == 0.0)  return 0;

    // check that m and id are of same size
    int idSize = id.Size();
    if(idSize != m.noRows() && idSize != m.noCols())
      {
        std::cerr << "BandArpackSOE::addA(); Matrix and ID not of similar sizes\n";
        return -1;
      }

    const int ldA = 2*numSubD + numSuperD + 1;

    if(fact == 1.0)
      { // do not need to multiply
        for(int i=0; i<idSize; i++)
          {
            const int col= id(i);
            if(col < size && col >= 0)
              {
                double *coliiPtr= A.getDataPtr() + col*ldA + numSubD + numSuperD;
                for(int j=0; j<idSize; j++)
                  {
                    const int row = id(j);
                    if(row <size && row >= 0)
                      {
                        int diff = col - row;
                        if(diff > 0)
                          {
                            if(diff <= numSuperD)
                              {
                                double *APtr = coliiPtr - diff;
                                *APtr += m(j,i);
                              }
                          }
                        else
                          {
                            diff*= -1;
                            if(diff <= numSubD)
                              {
                                double *APtr = coliiPtr + diff;
                                *APtr += m(j,i);
                              }
                          }
                      }
                  }  // for j
              }
          }  // for i
      }
    else
      {
        for(int i=0;i<idSize;i++)
          {
            const int col = id(i);
            if(col < size && col >= 0)
              {
                double *coliiPtr = A.getDataPtr() + col*ldA + numSubD + numSuperD;
                for(int j=0; j<idSize; j++)
                  {
                    const int row = id(j);
                    if(row <size && row >= 0)
                      {
                        int diff = col - row;
                        if(diff > 0)
                          {
                            if(diff <= numSuperD)
                              {
                                double *APtr = coliiPtr - diff;
                                *APtr+= m(j,i)*fact;
                              }
                          }
                        else
                          {
                            diff*= -1;
                            if(diff <= numSubD)
                              {
                                double *APtr = coliiPtr + diff;
                                *APtr+= m(j,i)*fact;
                              }
                          }
                      }
                  }  // for j
              }
          }  // for i
      }
    return 0;
  }
示例#23
0
int
Mesh::newElements(const ID& elends)
{
    Domain* domain = OPS_GetDomain();
    if (domain == 0) {
        opserr << "WARNING: domain is not created\n";
        return -1;
    }

    // if no element, no new elements
    if (eleType == 0) return 0;
    if (elends.Size() < numelenodes) {
        return 0;
    }

    // function to call
    void* (*OPS_Func)(const ID& info) = 0;
    switch (eleType) {
    case ELE_TAG_ElasticBeam2d:
        OPS_Func = OPS_ElasticBeam2d;
        break;
    case ELE_TAG_ForceBeamColumn2d:
        OPS_Func = OPS_ForceBeamColumn2d;
        break;
    case ELE_TAG_DispBeamColumn2d:
        OPS_Func = OPS_DispBeamColumn2d;
        break;
    case ELE_TAG_PFEMElement2DBubble:
        OPS_Func = OPS_PFEMElement2DBubble;
        break;
    case ELE_TAG_PFEMElement3DBubble:
        OPS_Func = OPS_PFEMElement3DBubble;
        break;
    case ELE_TAG_PFEMElement2Dmini:
        OPS_Func = OPS_PFEMElement2Dmini;
        break;
    case ELE_TAG_PFEMElement2DCompressible:
        OPS_Func = OPS_PFEMElement2DCompressible;
        break;
    case ELE_TAG_Tri31:
        OPS_Func = OPS_Tri31;
        break;
    case ELE_TAG_FourNodeTetrahedron:
	OPS_Func = OPS_FourNodeTetrahedron;
	break;
    case ELE_TAG_ShellMITC4:
	OPS_Func = OPS_ShellMITC4;
	break;
    default:
        OPS_Func = OPS_ElasticBeam2d;
    }



    int eletag = this->nextEleTag();
    int nodetag = this->nextNodeTag();

    // create elements
    ID neweletags(elends.Size()/numelenodes);
    std::vector<Element*> neweles(neweletags.Size());

#pragma omp parallel for
    for (int i=0; i<neweletags.Size(); ++i) {

	// element tag
	neweletags(i) = eletag+i;

	// info
	ID info(numelenodes+4);
	info(0) = 2; // load data
	info(1) = this->getTag(); // mesh tag
        info(2) = neweletags(i); // ele tag
        for (int j=0; j<numelenodes; ++j) {
	    // get elenode
            info(3+j) = elends(numelenodes*i+j);
        }
	info(numelenodes+3) = nodetag+i;

	// create element
        neweles[i] = (Element*)OPS_Func(info);
    }

    // add elements to domain
    for (unsigned int i=0; i<neweles.size(); ++i) {
    	if (neweles[i] == 0) {
            opserr<<"WARING: run out of memory for creating element\n";
            return -1;
        }
        if (domain->addElement(neweles[i]) == false) {
            opserr<<"WARNING: failed to add element to domain\n";
            delete neweles[i];
            return -1;
        }
    }

    this->addEleTags(neweletags);

    return 0;
}
示例#24
0
int 
SymArpackSOE::addA(const Matrix &m, const ID &id, double fact)
{
    // check for a quick return
	if (fact == 0.0)  
	return 0;

    int idSize = id.Size();
    
    // check that m and id are of similar size
    if (idSize != m.noRows() && idSize != m.noCols()) {
	opserr << "SymArpackSOE::addA() ";
	opserr << " - Matrix and ID not of similar sizes\n";
	return -1;
    }
    
    int *newID = new int [idSize];
    int *isort = new int[idSize];
    if (newID == 0 || isort ==0) {
        opserr << "WARNING SymArpackSOE::addA() :";
        opserr << " ran out of memory for vectors (newID, isort)";
        return -1;
    }

    int i;    
    for (i=0; i<idSize; i++) {
        newID[i] = id(i);
	 if (newID[i] >= 0)
	       newID[i] = invp[newID[i]];
    }
       
   long int  i_eq, j_eq, iadd;
   int  j, nee, lnee;
   int  k, ipos, jpos;
   int  it, jt;
   int  iblk;
   int  jblk;
   OFFDBLK  *ptr;
   OFFDBLK  *saveblk;
   double  *fpt, *iloc, *loc;

   nee = idSize;
   lnee = nee;
   
   /* initialize isort */
   for(i = 0, k = 0; i < lnee ; i++ )
   {
       if( newID[i] >= 0 ) {
	    isort[k] = i;
	    k++;
       }
    }
      
   lnee = k;

   i = k - 1;
   do
   {
       k = 0 ;
       for (j = 0 ; j < i ; j++)
       {  
	   if ( newID[isort[j]] > newID[isort[j+1]]) {  
	       int temp = isort[j];
	       isort[j] = isort[j+1];
	       isort[j+1] = temp;

/*	       isort[j] ^= isort[j+1] ;
	       isort[j+1] ^= isort[j] ;
	       isort[j] ^= isort[j+1] ;
*/
	       k = j ;
	   }
      }
      i = k ;
   }  while ( k > 0) ;

      i = 0 ;
      ipos = isort[i] ;
      k = rowblks[newID[ipos]] ;
      saveblk  = begblk[k] ;

      for (i=0; i<lnee; i++)
      { 
	 ipos = isort[i] ;
         i_eq = newID[ipos] ;
	 iblk = rowblks[i_eq] ;
	 iloc = penv[i_eq +1] - i_eq ;
	 if (k < iblk)
	    while (saveblk->row != i_eq) 
	         saveblk = saveblk->bnext ;
	 
	 ptr = saveblk ;
	 for (j=0; j< i ; j++)
	 {   
	    jpos = isort[j] ;
	    j_eq = newID[jpos] ;

		if (ipos > jpos) {
			jt = ipos;
			it = jpos;
		} else {
			it = ipos;
			jt = jpos;
		}

	    if (j_eq >= xblk[iblk]) /* diagonal block */
	    {  loc = iloc + j_eq ;
	       *loc += m(it, jt) * fact;
            } else /* row segment */
	    {  while((j_eq >= (ptr->next)->beg) && ((ptr->next)->row == i_eq))
		  ptr = ptr->next ;
	       fpt = ptr->nz ;
	       fpt[j_eq - ptr->beg] += m(it,jt) * fact;
            }
         }
	 diag[i_eq] += m(ipos, ipos) * fact;
      }
   
    delete [] newID;
    delete [] isort;

    return 0;
}
示例#25
0
int 
SkylineSPD::addA(const Matrix &m, const ID &id, double fact)
{
    // check for a quick return 
    if (fact == 0.0)  return 0;
    
    // check that m and id are of similar size
    int idSize = id.Size();    
    if (idSize != m.noRows() && idSize != m.noCols()) {
	opserr << "SkylineSPD::addA()	- Matrix and ID not of similar sizes\n";
	return -1;
    }

    if (fact == 1.0) { // do not need to multiply 
	for (int i=0; i<idSize; i++) {
	    int col = id(i);
	    if (col < size && col >= 0) {
		double *coliiPtr = &A[iDiagLoc[col] -1]; // -1 as fortran indexing 
		int minColRow;
		if (col == 0)
		    minColRow = 0;
		else
		    minColRow = col - (iDiagLoc[col] - iDiagLoc[col-1]) +1;
		for (int j=0; j<idSize; j++) {
		    int row = id(j);
		    if (row <size && row >= 0 && 
			row <= col && row >= minColRow) { 

			// we only add upper and inside profile
			double *APtr = coliiPtr + (row-col);
			 *APtr += m(j,i);
		     }
		}  // for j
	    } 
	}  // for i
    } else {
	for (int i=0; i<idSize; i++) {
	    int col = id(i);
	    if (col < size && col >= 0) {
		double *coliiPtr = &A[iDiagLoc[col] -1]; // -1 as fortran indexing 		
		int minColRow;
		if (col == 0)
		    minColRow = 0;
		else
		    minColRow = col - (iDiagLoc[col] - iDiagLoc[col-1]) +1;
		for (int j=0; j<idSize; j++) {
		    int row = id(j);
		    if (row <size && row >= 0 && 
			row <= col && row >= minColRow) { 

			// we only add upper and inside profile
			double *APtr = coliiPtr + (row-col);
			 *APtr += m(j,i) * fact;
		     }
		}  // for j
	    } 
	}  // for i
    
    }
    return 0;
}
示例#26
0
int
TriMesh::mesh(double alpha, const ID& rtags2, const ID& rtags)
{
    // get all regions
    int numregions = rtags.Size()+rtags2.Size();
    int numpoints = 0;
    std::vector<MeshRegion*> regions(numregions);
    for(int i=0; i<rtags.Size(); i++) {
	MeshRegion* region = theDomain->getRegion(rtags(i));
	if(region == 0) {
	    opserr<<"WARNING: region "<<rtags(i)<<" is not defined\n";
	    return -1;
	}
	numpoints += region->getNodes().Size();
	regions[i] = region;
    }
    for(int i=0; i<rtags2.Size(); i++) {
	MeshRegion* region = theDomain->getRegion(rtags2(i));
	if(region == 0) {
	    opserr<<"WARNING: region "<<rtags2(i)<<" is not defined\n";
	    return -1;
	}
	numpoints += region->getNodes().Size();
	regions[i+rtags.Size()] = region;

	// remove elements
	const ID& eles = region->getExtraEles();
	for (int j=0; j<eles.Size(); j++) {
	    Element* ele = theDomain->removeElement(eles(j));
	    if (ele != 0) {
		delete ele;
	    }
	}

    }

    // get all points
    ID ptreg(0,numpoints), ptnode(0,numpoints);
    for(int i=0; i<numregions; i++) {
	const ID& nodes = regions[i]->getNodes();
	for(int j=0; j<nodes.Size(); j++) {
	    int index = ptreg.Size();
	    ptreg[index] = i;
	    ptnode[index] = nodes(j);
	}
    }

    // calling mesh generator
    TriangleMeshGenerator gen;
    for(int i=0; i<ptnode.Size(); i++) {
	// get node
	Node* theNode = theDomain->getNode(ptnode(i));
	if(theNode == 0) {
	    opserr<<"WARNING: node "<<ptnode(i)<<" is not defined\n";
	    return -1;
	}
	const Vector& crds = theNode->getCrds();
	const Vector& disp = theNode->getTrialDisp();
	if(crds.Size() < 2 || disp.Size() < 2) {
	    opserr<<"WARNING: ndm < 2 or ndf < 2\n";
	    return -1;
	}
	
	// add point
	gen.addPoint(crds(0)+disp(0), crds(1)+disp(1));
    }

    // meshing
    gen.remesh(alpha);

    // get elenodes
    std::vector<ID> regelenodes(rtags2.Size());
    for(int i=0; i<gen.getNumTriangles(); i++) {
	int p1,p2,p3;
	gen.getTriangle(i,p1,p2,p3);

	// if all connected to fixed regions
	int numfix = rtags.Size();
	if(ptreg(p1)<numfix && ptreg(p2)<numfix && ptreg(p3)<numfix) {
	    continue;
	}
	
	// which region it belongs to
	int reg = ptreg(p1);
	if(reg<numfix || (reg>ptreg(p2) && ptreg(p2)>=numfix)) reg = ptreg(p2);
	if(reg<numfix || (reg>ptreg(p3) && ptreg(p3)>=numfix)) reg = ptreg(p3);
	reg -= numfix;

	// elenodes
	int index = regelenodes[reg].Size();
	regelenodes[reg][index++] = ptnode(p1);
	regelenodes[reg][index++] = ptnode(p2);
	regelenodes[reg][index++] = ptnode(p3);
    }

    // all elenodes
    ID allelenodes;
    for(int i=0; i<(int)regelenodes.size(); i++) {
	int num = allelenodes.Size();
	int num1 = regelenodes[i].Size();
	allelenodes.resize(num+num1);
	for (int j=0; j<num1; j++) {
	    allelenodes(num+j) = regelenodes[i](j);
	}
    }

    // create elements
    std::string eletype = OPS_GetString();
    ID eletags;
    if (eletype=="PFEMElement2D") {
	if (OPS_PFEMElement2D(*theDomain,allelenodes,eletags) < 0) {
	    return -1;
	}
    } else if (eletype=="PFEMElement2DQuasi") {
	if (OPS_PFEMElement2DCompressible(*theDomain,allelenodes,eletags) < 0) {
	    return -1;
	}
    } else if (eletype=="PFEMElement2DBubble") {
	if (OPS_PFEMElement2DBubble(*theDomain,allelenodes,eletags) < 0) {
	    return -1;
	}

    }  else if (eletype=="tri31") {
	if (OPS_Tri31(*theDomain,allelenodes,eletags) < 0) {
	    return -1;
	}

    } else {
	opserr<<"WARNING: element "<<eletype.c_str()<<" can't be used for tri mesh at this time\n";
	return -1;
    }

    // add to region
    int num = 0;

    for(int i=rtags.Size(); i<numregions; i++) {
	int num1 = regelenodes[i-rtags.Size()].Size()/3;
	ID eletag(num1);
	for (int j=0; j<num1; j++) {
	    eletag(j) = eletags(num+j);
	}
	num += num1;
	regions[i]->setExtraEles(eletag);
    }
    return 0;
}
示例#27
0
int
TriMesh::mesh(int rtag, double size, const ID& nodes,const ID& bound)
{
    // check
    if(size <= 0) {
	opserr<<"WARNING: mesh size <= 0\n";
	return -1;
    }
    if(nodes.Size() < 3) {
	opserr<<"WARNING: input number of nodes < 3\n";
	return -1;
    }
    if(bound.Size() < nodes.Size()) {
	opserr<<"WARNING: the number of boundary ID < number of nodes\n";
	return -1;
    }
    
    // calling mesh generator
    TriangleMeshGenerator gen;
    for(int i=0; i<nodes.Size(); i++) {
	// get node
	Node* theNode = theDomain->getNode(nodes(i));
	if(theNode == 0) {
	    opserr<<"WARNING: node "<<nodes(i)<<" is not defined\n";
	    return -1;
	}
	const Vector& crds = theNode->getCrds();
	if(crds.Size() < 2) {
	    opserr<<"WARNING: ndm < 2\n";
	    return -1;
	}
	// add point
	gen.addPoint(crds(0), crds(1));

	// add segment
	int p1 = i;
	int p2;
	if(i==nodes.Size()-1) {
	    p2 = 0;
	} else {
	    p2 = i+1;
	}
	if(bound(i) == 0) {
	    gen.addSegment(p1,p2,-1);
	} else {
	    gen.addSegment(p1,p2,0);
	}
    }

    // meshing
    gen.mesh(size*size*0.5);

    // get node tag
    NodeIter& theNodes = theDomain->getNodes();
    Node* theNode = theNodes();
    int currtag = 0;
    if(theNode != 0) currtag = theNode->getTag();

    // get nodes
    ID regnodes(0,gen.getNumPoints());
    ID ptmark(gen.getNumPoints());
    ID ptnode(gen.getNumPoints());
    int index = 0;
    for(int i=0; i<nodes.Size(); i++) {
	int j = i-1;
	if(i==0) j = nodes.Size()-1;
	if(bound(i)!=0 && bound(j)!=0) {
	    regnodes[index++] = nodes(i);
	    ptmark(i) = 0;
	} else {
	    ptmark(i) = -1;
	}
	ptnode(i) = nodes(i);
    }
    for(int i=nodes.Size(); i<gen.getNumPoints(); i++) {
	// get point
	double x, y;
	int mark = 0;
	gen.getPoint(i,x,y,mark);

	// if on unwanted boundary
	if(mark == -1) {
	    ptmark(i) = -1;
	    continue;
	} else {
	    ptmark(i) = 0;
	}

	// create node
	Node* node = new Node(--currtag,ndf,x,y);
	if(node == 0) {
	    opserr<<"run out of memory for creating Node\n";
	    return -1;
	}
	if(theDomain->addNode(node) == false) {
	    opserr<<"Failed to add node to domain\n";
	    delete node;
	    return -1;
	}

	// add to region
	regnodes[index++] = currtag;
	ptnode(i) = currtag;
    }

    // get elenodes
    ID regelenodes(0,gen.getNumTriangles());
    index = 0;
    for(int i=0; i<gen.getNumTriangles(); i++) {
	int p1,p2,p3;
	gen.getTriangle(i,p1,p2,p3);
	if(ptmark(p1)==0 && ptmark(p2)==0 && ptmark(p3)==0) {
	    regelenodes[index++] = ptnode(p1);
	    regelenodes[index++] = ptnode(p2);
	    regelenodes[index++] = ptnode(p3);
	}
    }

    // get region
    MeshRegion* theRegion = theDomain->getRegion(rtag);
    if(theRegion == 0) {
	theRegion = new MeshRegion(rtag);
	if(theDomain->addRegion(*theRegion) < 0) {
	    opserr<<"WARNING: failed to add region\n";
	    return -1;
	}
    }

    // add to region
    theRegion->setNodes(regnodes);
    
    return 0;
}
示例#28
0
int
BinaryFileStream::setOrder(const ID &orderData)
{
  opserr << "BinaryFileStream::setOrder(const ID &orderData) - START\n";
  if (sendSelfCount < 0) {
    static ID numColumnID(1);
    int numColumn = orderData.Size();
    numColumnID(0) = numColumn;
    theChannels[0]->sendID(0, 0, numColumnID);
    opserr << "BinaryFileStream::setOrder(const ID &orderData) - SENT numColumnData : " << numColumnID;
    if (numColumn != 0)
      theChannels[0]->sendID(0, 0, orderData);
    opserr << "BinaryFileStream::setOrder(const ID &orderData) - SENT\n";
  }

  if (sendSelfCount > 0) {      

    sizeColumns = new ID(sendSelfCount+1);
    theColumns = new ID *[sendSelfCount+1];
    theData = new double *[sendSelfCount+1];
    theRemoteData = new Vector *[sendSelfCount+1];
    
    int numColumns = orderData.Size();
    (*sizeColumns)(0) = numColumns;
    if (numColumns != 0) {
      theColumns[0] = new ID(orderData);
      theData[0] = new double [numColumns];
    } else {
      theColumns[0] = 0;
      theData[0] = 0;
    }      
    theRemoteData[0] = 0;

    maxCount = 0;
    if (numColumns != 0)
      maxCount = orderData(numColumns-1);

    // now receive orderData from the other channels
    for (int i=0; i<sendSelfCount; i++) { 
      opserr << "BinaryFileStream::setOrder(const ID &orderData) - RECEIVING\n";
      static ID numColumnID(1);	  
      if (theChannels[i]->recvID(0, 0, numColumnID) < 0) {
	opserr << "BinaryFileStream::setOrder - failed to recv column size for process: " << i+1 << endln;
	return -1;
      }

      int numColumns = numColumnID(0);
      opserr << "BinaryFileStream::setOrder(const ID &orderData) - NumColumns: " << numColumns << endln;

      (*sizeColumns)(i+1) = numColumns;
      if (numColumns != 0) {
	theColumns[i+1] = new ID(numColumns);
	if (theChannels[i]->recvID(0, 0, *theColumns[i+1]) < 0) {
	  opserr << "BinaryFileStream::setOrder - failed to recv column data for process: " << i+1 << endln;
	  return -1;
	}
	
	if (numColumns != 0 && (*theColumns[i+1])[numColumns-1] > maxCount)
	  maxCount = (*theColumns[i+1])[numColumns-1];
	
	theData[i+1] = new double [numColumns];
	theRemoteData[i+1] = new Vector(theData[i+1], numColumns);
      } else {
	theColumns[i+1] = 0;
	theData[i+1] = 0;
	theRemoteData[i+1] = 0;
      }
    }

    opserr << "BinaryFileStream::setOrder(const ID &orderData) - STARTING MAPPING;\n";

    ID currentLoc(sendSelfCount+1);
    ID currentCount(sendSelfCount+1);
	
    if (mapping != 0)
      delete mapping;

    mapping = new Matrix(3, maxCount+1);

    Matrix &printMapping = *mapping;
	
    for (int i=0; i<=sendSelfCount; i++) {
      currentLoc(i) = 0;
      if (theColumns[i] != 0)
	currentCount(i) = (*theColumns[i])[0];
      else
	currentCount(i) = -1;
    }

    int count =0;
    while (count <= maxCount) {
      for (int i=0; i<=sendSelfCount; i++) {
	if (currentCount(i) == count) {
	  printMapping(0,count) = i;
	  
	  int maxLoc = theColumns[i]->Size();
	  int loc = currentLoc(i);
	  int columnCounter = 0;
	  
	  printMapping(1,count) = loc;
	  
	  while (loc < maxLoc && (*theColumns[i])(loc) == count) {
	    loc++;
	    columnCounter++;
	  }
	  
	  printMapping(2,count) = columnCounter;
	  
	  currentLoc(i) = loc;
	  
	  if (loc < maxLoc)
	    currentCount(i) = (*theColumns[i])(loc);		
	  else
	    currentCount(i) = -1; 		
	}
      }
      count++;
    }
    
    opserr << printMapping;
  }

  return 0;
}
示例#29
0
int
GiDStream::setOrder(const ID &orderData)
{
  if (fileOpen == 0)
    this->open();

  if (sendSelfCount == 0)
    return 0;

  if (xmlOrderProcessed == 0) {
    xmlColumns = new ID(orderData.Size());
    xmlOrderProcessed = 1;
  } else if (xmlOrderProcessed == 1) {
    //this->mergeXML();
    xmlOrderProcessed = 2;
  } 

  if (sendSelfCount < 0) {
    static ID numColumnID(1);
    int numColumn = orderData.Size();
    numColumnID(0) = numColumn;
    theChannels[0]->sendID(0, 0, numColumnID);

    theColumns = new ID *[1];
    theColumns[0] = new ID(orderData);
      
    if (numColumn != 0)
      theChannels[0]->sendID(0, 0, orderData);
  }

  if (sendSelfCount > 0) {      

    sizeColumns = new ID(sendSelfCount+1);
    theColumns = new ID *[sendSelfCount+1];
    theData = new double *[sendSelfCount+1];
    theRemoteData = new Vector *[sendSelfCount+1];
    
    int numColumns = orderData.Size();
    (*sizeColumns)(0) = numColumns;
    if (numColumns != 0) {
      theColumns[0] = new ID(orderData);
      theData[0] = new double [numColumns];
    } else {
      theColumns[0] = 0;
      theData[0] = 0;
    }      
    theRemoteData[0] = 0;

    maxCount = 0;
    if (numColumns != 0)
      maxCount = orderData(numColumns-1);

    // now receive orderData from the other channels
    for (int i=0; i<sendSelfCount; i++) { 
      static ID numColumnID(1);	  
      if (theChannels[i]->recvID(0, 0, numColumnID) < 0) {
	opserr << "GiDStream::setOrder - failed to recv column size for process: " << i+1 << endln;
	return -1;
      }

      numColumns = numColumnID(0);

      (*sizeColumns)(i+1) = numColumns;
      if (numColumns != 0) {
	theColumns[i+1] = new ID(numColumns);
	if (theChannels[i]->recvID(0, 0, *theColumns[i+1]) < 0) {
	  opserr << "GiDStream::setOrder - failed to recv column data for process: " << i+1 << endln;
	  return -1;
	}

	if (numColumns != 0 && (*theColumns[i+1])[numColumns-1] > maxCount)
	  maxCount = (*theColumns[i+1])[numColumns-1];
	
	theData[i+1] = new double [numColumns];
	theRemoteData[i+1] = new Vector(theData[i+1], numColumns);
      } else {
	theColumns[i+1] = 0;
	theData[i+1] = 0;
	theRemoteData[i+1] = 0;
      }
    }

    ID currentLoc(sendSelfCount+1);
    ID currentCount(sendSelfCount+1);
	
    if (mapping != 0)
      delete mapping;

    mapping = new Matrix(3, maxCount+1);

    Matrix &printMapping = *mapping;
	
    for (int i=0; i<=sendSelfCount; i++) {
      currentLoc(i) = 0;
      if (theColumns[i] != 0)
	currentCount(i) = (*theColumns[i])[0];
      else
	currentCount(i) = -1;
    }

    int count =0;
    while (count <= maxCount) {
      for (int i=0; i<=sendSelfCount; i++) {
	if (currentCount(i) == count) {
	  printMapping(0,count) = i;
	  
	  int maxLoc = theColumns[i]->Size();
	  int loc = currentLoc(i);
	  int columnCounter = 0;
	  
	  printMapping(1,count) = loc;
	  
	  while (loc < maxLoc && (*theColumns[i])(loc) == count) {
	    loc++;
	    columnCounter++;
	  }
	  
	  printMapping(2,count) = columnCounter;
	  
	  currentLoc(i) = loc;
	  
	  if (loc < maxLoc)
	    currentCount(i) = (*theColumns[i])(loc);		
	  else
	    currentCount(i) = -1; 		
	}
      }
      count++;
    }
  }

  if (theChannels != 0) {
    static ID lastMsg(1);
    if (sendSelfCount > 0) {
      for (int i=0; i<sendSelfCount; i++) 
	theChannels[i]->sendID(0, 0, lastMsg);
    } else
	theChannels[0]->recvID(0, 0, lastMsg);
  }

  return 0;
}
示例#30
0
EnvelopeNodeRecorder::EnvelopeNodeRecorder(const ID &dofs, 
					   const ID *nodes, 
					   const char *dataToStore,
					   Domain &theDom,
					   OPS_Stream &theOutputHandler,
					   double dT, 
					   bool echoTime,
					   TimeSeries *theSeries)
:Recorder(RECORDER_TAGS_EnvelopeNodeRecorder),
 theDofs(0), theNodalTags(0), theNodes(0),
 currentData(0), data(0), 
 theDomain(&theDom), theHandler(&theOutputHandler),
 deltaT(dT), nextTimeStampToRecord(0.0), 
 first(true), initializationDone(false), numValidNodes(0), echoTimeFlag(echoTime), 
 addColumnInfo(0),theTimeSeries(theSeries)
{
  // verify dof are valid 
  int numDOF = dofs.Size();
  theDofs = new ID(0, numDOF);

  int count = 0;
  int i;
  for (i=0; i<numDOF; i++) {
    int dof = dofs(i);
    if (dof >= 0) {
      (*theDofs)[count] = dof;
      count++;
    } else {
      opserr << "EnvelopeNodeRecorder::EnvelopeNodeRecorder - invalid dof  " << dof;
      opserr << " will be ignored\n";
    }
  }


  // 
  // create memory to hold nodal ID's (neeed parallel)
  //

  if (nodes != 0) {
    int numNode = nodes->Size();
    if (numNode != 0) {
      theNodalTags = new ID(*nodes);
      if (theNodalTags == 0 || theNodalTags->Size() != nodes->Size()) {
	opserr << "NodeRecorder::NodeRecorder - out of memory\n";
      }
    }
  } 

  //
  // set the data flag used as a switch to get the response in a record
  //

  if (dataToStore == 0 || (strcmp(dataToStore, "disp") == 0)) {
    dataFlag = 0;
  } else if ((strcmp(dataToStore, "vel") == 0)) {
    dataFlag = 1;
  } else if ((strcmp(dataToStore, "accel") == 0)) {
    dataFlag = 2;
  } else if ((strcmp(dataToStore, "incrDisp") == 0)) {
    dataFlag = 3;
  } else if ((strcmp(dataToStore, "incrDeltaDisp") == 0)) {
    dataFlag = 4;
  } else if ((strcmp(dataToStore, "unbalance") == 0)) {
    dataFlag = 5;
  } else if ((strcmp(dataToStore, "unbalanceInclInertia") == 0) ||
	     (strcmp(dataToStore, "unbalanceIncInertia") == 0) ||
	     (strcmp(dataToStore, "unbalanceIncludingInertia") == 0))  {
    dataFlag = 6;
  } else if ((strcmp(dataToStore, "reaction") == 0)) {
    dataFlag = 7;
  } else if (((strcmp(dataToStore, "reactionIncInertia") == 0))
	     || ((strcmp(dataToStore, "reactionInclInertia") == 0))
	     || ((strcmp(dataToStore, "reactionIncludingInertia") == 0))) {
    dataFlag = 8;
  } else if (((strcmp(dataToStore, "rayleighForces") == 0))
	     || ((strcmp(dataToStore, "rayleighDampingForces") == 0))) {
    dataFlag = 9;
  } else if ((strncmp(dataToStore, "eigen",5) == 0)) {
    int mode = atoi(&(dataToStore[5]));
    if (mode > 0)
      dataFlag = 10 + mode;
    else
      dataFlag = 10;
  } else if ((strncmp(dataToStore, "sensitivity",11) == 0)) {
    int grad = atoi(&(dataToStore[11]));
    if (grad > 0)
      dataFlag = 1000 + grad;
    else
      dataFlag = 10;
  } else if ((strncmp(dataToStore, "velSensitivity",14) == 0)) {
    int grad = atoi(&(dataToStore[14]));
    if (grad > 0)
      dataFlag = 2000 + grad;
    else
      dataFlag = 10;
  } else if ((strncmp(dataToStore, "accSensitivity",14) == 0)) {
    int grad = atoi(&(dataToStore[14]));
    if (grad > 0)
      dataFlag = 3000 + grad;
    else
      dataFlag = 10;

  } else {
    dataFlag = 10;
    opserr << "EnvelopeNodeRecorder::NodeRecorder - dataToStore " << dataToStore;
    opserr << "not recognized (disp, vel, accel, incrDisp, incrDeltaDisp)\n";
  }
}