Esempio n. 1
0
void
AnalysisDataDisplacementModule::frameFinished(const AnalysisDataFrameHeader & /*header*/)
{
    if (_impl->nstored <= 1)
    {
        return;
    }

    int step, i;

    if (_impl->nstored == 2)
    {
        if (_impl->histm)
        {
            _impl->histm->init(histogramFromBins(0, _impl->max_store / _impl->nmax,
                                                 _impl->dt).integerBins());
        }
        notifyDataStart();
    }
    AnalysisDataFrameHeader header(_impl->nstored - 2, _impl->t, 0);
    notifyFrameStart(header);

    for (i = _impl->ci - _impl->nmax, step = 1;
         step < _impl->nstored && i != _impl->ci;
         i -= _impl->nmax, ++step)
    {
        if (i < 0)
        {
            i += _impl->max_store;
        }
        _impl->currValues_.clear();
        _impl->currValues_.push_back(AnalysisDataValue(step * _impl->dt));
        int k = 1;
        for (int j = 0; j < _impl->nmax; j += _impl->ndim, ++k)
        {
            real dist2 = 0.0;

            for (int d = 0; d < _impl->ndim; ++d)
            {
                real displ = _impl->oldval[_impl->ci + j + d]
                    - _impl->oldval[i + j + d];
                dist2 += displ * displ;
            }
            _impl->currValues_.push_back(AnalysisDataValue(dist2));
        }
        notifyPointsAdd(AnalysisDataPointSetRef(header, _impl->currValues_));
    }

    notifyFrameFinish(header);
}
Esempio n. 2
0
void
AnalysisDataDisplacementModule::frameFinished()
{
    if (_impl->nstored <= 1)
    {
        return;
    }

    int step, i;
    int rc;

    if (_impl->nstored == 2)
    {
        if (_impl->histm)
        {
            _impl->histm->initNBins(0, _impl->dt,
                                    _impl->max_store / _impl->nmax, true);
        }
        notifyDataStart();
    }
    notifyFrameStart(_impl->t, 0);

    for (i = _impl->ci - _impl->nmax, step = 1;
         step < _impl->nstored && i != _impl->ci;
         i -= _impl->nmax, ++step)
    {
        if (i < 0)
        {
            i += _impl->max_store;
        }
        _impl->currd[0] = step * _impl->dt;
        int k = 1;
        for (int j = 0; j < _impl->nmax; j += _impl->ndim, ++k)
        {
            real dist2 = 0.0;

            for (int d = 0; d < _impl->ndim; ++d)
            {
                dist2 += sqr(_impl->oldval[_impl->ci + j + d]
                             - _impl->oldval[i + j + d]);
            }
            _impl->currd[k] = dist2;
        }
        notifyPointsAdd(0, k, _impl->currd, NULL, NULL);
    }

    notifyFrameFinish();
}
Esempio n. 3
0
void
AbstractAnalysisDataStored::startDataStore()
{
    // We first notify any attached modules, because they also might request
    // some storage.
    notifyDataStart();

    int ncol = columnCount();

    // If any storage has been requested, preallocate it.
    if (_impl->_nalloc > 0)
    {
        _impl->_store.resize(_impl->_nalloc);
        for (int i = 0; i < _impl->_nalloc; ++i)
        {
            _impl->_store[i] = new AnalysisDataFrame();
            _impl->_store[i]->allocate(ncol);
        }
        _impl->_nextind = 0;
    }
}
Esempio n. 4
0
void
AnalysisDataFrameAverageModule::dataStarted(AbstractAnalysisData *data)
{
    notifyDataStart();
    impl_->storage_.startDataStorage(this);
}