예제 #1
0
파일: FD1Solver.cpp 프로젝트: Yukee/flume
void FD1Solver::compute_localSpeed()
{
  SField lowerSpeed;
  SField upperSpeed;

  for(int dir=0;dir<m_n;dir++)
    {
      upperSpeed = m_eq->get_max_eigenvalue(upper_right_intermediate_un_values[dir], dir);
      lowerSpeed = m_eq->get_max_eigenvalue(lower_right_intermediate_un_values[dir], dir);
      right_localSpeed[dir] = upperSpeed.max_field(lowerSpeed);

      upperSpeed = m_eq->get_max_eigenvalue(upper_left_intermediate_un_values[dir], dir);
      lowerSpeed = m_eq->get_max_eigenvalue(lower_left_intermediate_un_values[dir], dir);
      left_localSpeed[dir] = upperSpeed.max_field(lowerSpeed);
    }
}
FieldContainerPtr NFIOName::readFC(const std::string &/*typeName*/)
{
    FDEBUG(("NFIOName::readFC\n"));

    NamePtr name = Name::create();

    UInt8 fcPtrType;
    _in->getValue(fcPtrType);

    UInt16 version;
    _in->getValue(version);

    if(version == 100)
    {
        std::string fieldName;
        std::string fieldType;
        UInt32 size = 0;

        // skip internal bool field
        _in->getValue(fieldName);
        _in->getValue(fieldType);
        _in->getValue(size);
        _in->skip(size);

        // read name field
        _in->getValue(fieldName);
        _in->getValue(fieldType);
        _in->getValue(size);

        SField<std::string> str;
        str.copyFromBin(*_in);

        name->editFieldPtr()->getValue().assign(str.getValue().c_str());

        readEndMarker();
    }
    else
    {
        readFCFields(name);
    }

    return name;
}
예제 #3
0
void runTest1(bool write,BinaryDataHandler &pMem,const T &value)
{
    SField<T,1> sfield;
    MField<T,1> mfield;
    if(write)
    {
        sfield.setValue(value);
        sfield.copyToBin(pMem);
        mfield.clear();
        mfield.push_back(value);
        mfield.push_back(value);
        mfield.copyToBin(pMem);
        SLOG << SField<T,1>::SFieldTraits::getSName() << " size " 
             << sfield.getBinSize() << std::endl;
        SLOG << MField<T,1>::MFieldTraits::getMName() << " size " 
             << mfield.size() << " " << mfield.getBinSize() << std::endl;
    }
    else
    {
        sfield.copyFromBin(pMem);
        if(sfield.getValue() == value)
            SLOG << SField<T,1>::SFieldTraits::getSName() << " " 
                 << "OK" << std::endl;
        else
            SLOG << SField<T,1>::SFieldTraits::getSName() << " " 
                 << "ERROR " << std::endl;
        mfield.copyFromBin(pMem);
        if(mfield[0] == value &&
           mfield[1] == value)
            SLOG << SField<T,1>::SFieldTraits::getMName() << " "
                 << "OK" << std::endl;
        else
            SLOG << SField<T,1>::SFieldTraits::getMName() << " " 
                 << "ERROR" << std::endl;
    }
}