Exemple #1
0
FFTFileGrid::FFTFileGrid(FFTFileGrid  * fftGrid, bool expTrans) :
FFTGrid()
{
  float value;
  int   i,j,k;
  genFileName();

  cubetype_       = fftGrid->cubetype_;
  theta_          = fftGrid->theta_;
  nx_             = fftGrid->nx_;
  ny_             = fftGrid->ny_;
  nz_             = fftGrid->nz_;
  nxp_            = fftGrid->nxp_;
  nyp_            = fftGrid->nyp_;
  nzp_            = fftGrid->nzp_;

  cnxp_           = nxp_/2+1;
  rnxp_           = 2*(cnxp_);

  csize_          = cnxp_*nyp_*nzp_;
  rsize_          = rnxp_*nyp_*nzp_;
  counterForGet_  = 0;
  counterForSet_  = 0;
  istransformed_  = fftGrid->istransformed_;
  fNameIn_        = "";
  accMode_        = NONE;

  setAccessMode(WRITE);
  fftGrid->setAccessMode(READ);

  if(istransformed_ == false){
    createRealGrid();
    for(k=0;k<nzp_;k++) {
      for(j=0;j<nyp_;j++) {
        for(i=0;i<rnxp_;i++) {
          value=fftGrid->getNextReal();
          if (expTrans)
            setNextReal(exp(value));
          else
            setNextReal(value);
        }
      }
    }
  }
  else{
    createComplexGrid();
    for(int k=0;k<nzp_;k++) {
      for(int j=0;j<nyp_;j++) {
        for(int i=0;i<cnxp_;i++) {
          fftw_complex value = fftGrid->getNextComplex();
          setNextComplex(value);
        }
      }
    }
  }
  endAccess();
  fftGrid->endAccess();
}
Exemple #2
0
 ConnectorParameter::ConnectorParameter(const ConnectorDescription* const connector, const UpdateBehavior behavior)
   : Parameter(connector->id(), connector->variant()),
     m_connector(connector)
 {
     setTitle(connector->title());
     setVisualization(connector->visualization());
     setUpdateBehavior(behavior);
     
     switch (connector->originalType())
     {
     case Description::INPUT:
         setAccessMode(ACTIVATED_WRITE);
         break;
     case Description::OUTPUT:
         setAccessMode(INITIALIZED_READ);
         break;
     default:
         throw InternalError("A connector parameter can only be created from inputs or outputs");
     }
 }
Exemple #3
0
float
FFTFileGrid::getFirstRealValue(){
  assert(accMode_ == NONE || accMode_ == RANDOMACCESS);

  float value;

  if(accMode_ != RANDOMACCESS) {
    setAccessMode(READ);
    value =  getNextReal();
    endAccess();
  }
  else
    value = static_cast<float>(rvalue_[0]);

  return value;
}