Example #1
0
void KConfigBase::writeEntry(const char *pKey, const QStringList &list, char sep, bool bPersistent, bool bGlobal, bool bNLS, bool bExpand)
{
    if(list.isEmpty())
    {
        writeEntry(pKey, QString::fromLatin1(""), bPersistent);
        return;
    }
    QString str_list;
    str_list.reserve(4096);
    QStringList::ConstIterator it = list.begin();
    for(; it != list.end(); ++it)
    {
        QString value = *it;
        uint i;
        uint strLength(value.length());
        for(i = 0; i < strLength; i++)
        {
            if(value[i] == sep || value[i] == '\\')
                str_list += '\\';
            str_list += value[i];
        }
        str_list += sep;
    }
    if(str_list.at(str_list.length() - 1) == sep)
        str_list.truncate(str_list.length() - 1);
    writeEntry(pKey, str_list, bPersistent, bGlobal, bNLS, bExpand);
}
void Foam::tractionDisplacementFvPatchVectorField::write(Ostream& os) const
{
    fvPatchVectorField::write(os);
    writeEntry(os, "traction", traction_);
    writeEntry(os, "pressure", pressure_);
    writeEntry(os, "value", *this);
}
Example #3
0
void KConfigBase::writeEntry(const char *pKey, const QStrList &list, char sep, bool bPersistent, bool bGlobal, bool bNLS)
{
    if(list.isEmpty())
    {
        writeEntry(pKey, QString::fromLatin1(""), bPersistent);
        return;
    }
    QString str_list;
    QStrListIterator it(list);
    for(; it.current(); ++it)
    {
        uint i;
        QString value;
        // !!! Sergey A. Sukiyazov <*****@*****.**> !!!
        // A QStrList may contain values in 8bit locale cpecified
        // encoding or in UTF8 encoding.
        value = KStringHandler::from8Bit(it.current());
        uint strLengh(value.length());
        for(i = 0; i < strLengh; i++)
        {
            if(value[i] == sep || value[i] == '\\')
                str_list += '\\';
            str_list += value[i];
        }
        str_list += sep;
    }
    if(str_list.at(str_list.length() - 1) == sep)
        str_list.truncate(str_list.length() - 1);
    writeEntry(pKey, str_list, bPersistent, bGlobal, bNLS);
}
Example #4
0
void Foam::wallBoilingModels::partitioningModels::
linear::write(Ostream& os) const
{
    partitioningModel::write(os);
    writeEntry(os, "alphaLiquid1", alphaLiquid1_);
    writeEntry(os, "alphaLiquid0", alphaLiquid0_);
}
void Foam::SRFVelocityFvPatchVectorField::write(Ostream& os) const
{
    fvPatchVectorField::write(os);
    writeEntry(os, "relative", relative_);
    writeEntry(os, "inletValue", inletValue_);
    writeEntry(os, "value", *this);
}
Example #6
0
void Foam::fv::option::writeData(Ostream& os) const
{
    writeEntry(os, "type", type());
    writeEntry(os, "active", active_);
    os << nl;
    os << indent << word(type() + "Coeffs");
    coeffs_.write(os);
}
void Foam::JohnsonJacksonParticleSlipFvPatchVectorField::write
(
    Ostream& os
) const
{
    fvPatchVectorField::write(os);
    writeEntry(os, "specularityCoefficient", specularityCoefficient_);
    writeEntry(os, "value", *this);
}
void Foam::porousBafflePressureFvPatchField::write(Ostream& os) const
{
    fixedJumpFvPatchField<scalar>::write(os);
    writeEntryIfDifferent<word>(os, "phi", "phi", phiName_);
    writeEntryIfDifferent<word>(os, "rho", "rho", rhoName_);
    writeEntry(os, "D", D_);
    writeEntry(os, "I", I_);
    writeEntry(os, "length", length_);
}
void Foam::epsilonWallFunctionFvPatchScalarField::writeLocalEntries
(
    Ostream& os
) const
{
    writeEntry(os, "Cmu", Cmu_);
    writeEntry(os, "kappa", kappa_);
    writeEntry(os, "E", E_);
}
void alphatJayatillekeWallFunctionFvPatchScalarField::write(Ostream& os) const
{
    fvPatchField<scalar>::write(os);
    writeEntry(os, "Prt", Prt_);
    writeEntry(os, "Cmu", Cmu_);
    writeEntry(os, "kappa", kappa_);
    writeEntry(os, "E", E_);
    writeEntry(os, "value", *this);
}
void Foam::totalFlowRateAdvectiveDiffusiveFvPatchScalarField::
write(Ostream& os) const
{
    fvPatchField<scalar>::write(os);
    writeEntry(os, "phi", phiName_);
    writeEntry(os, "rho", rhoName_);
    writeEntry(os, "massFluxFraction", massFluxFraction_);
    writeEntry(os, "value", *this);
}
void Foam::temperatureDependentAlphaContactAngleFvPatchScalarField::write
(
    Ostream& os
) const
{
    alphaContactAngleFvPatchScalarField::write(os);
    writeEntryIfDifferent<word>(os, "T", "T", TName_);
    writeEntry(os, theta0_());
    writeEntry(os, "value", *this);
}
void Foam::JohnsonJacksonParticleThetaFvPatchScalarField::write
(
    Ostream& os
) const
{
    fvPatchScalarField::write(os);
    writeEntry(os, "restitutionCoefficient", restitutionCoefficient_);
    writeEntry(os, "specularityCoefficient", specularityCoefficient_);
    writeEntry(os, "value", *this);
}
void Foam::inletOutletTotalTemperatureFvPatchScalarField::write(Ostream& os)
const
{
    fvPatchScalarField::write(os);
    writeEntryIfDifferent<word>(os, "U", "U", UName_);
    writeEntryIfDifferent<word>(os, "phi", "phi", this->phiName_);
    writeEntryIfDifferent<word>(os, "psi", "psi", psiName_);
    writeEntry(os, "gamma", gamma_);
    writeEntry(os, "T0", T0_);
    writeEntry(os, "value", *this);
}
void Foam::variableHeightFlowRateFvPatchScalarField::write(Ostream& os) const
{
    fvPatchScalarField::write(os);
    if (phiName_ != "phi")
    {
        writeEntry(os, "phi", phiName_);
    }
    writeEntry(os, "lowerBound", lowerBound_);
    writeEntry(os, "upperBound", upperBound_);
    writeEntry(os, "value", *this);
}
void Foam::inclinedFilmNusseltHeightFvPatchScalarField::write
(
    Ostream& os
) const
{
    fixedValueFvPatchScalarField::write(os);
    writeEntry(os, GammaMean_());
    writeEntry(os, a_());
    writeEntry(os, omega_());
    writeEntry(os, "value", *this);
}
Example #17
0
QgsProject::QgsProject()
    : imp_( new QgsProject::Imp )
{
  // Set some default project properties
  // XXX THESE SHOULD BE MOVED TO STATUSBAR RELATED SOURCE
  writeEntry( "PositionPrecision", "/Automatic", true );
  writeEntry( "PositionPrecision", "/DecimalPlaces", 2 );
  // XXX writeEntry() makes the project dirty, but it doesn't make sense
  // for a new project to be dirty, so let's clean it up
  dirty( false );
} // QgsProject ctor
void Foam::phaseHydrostaticPressureFvPatchScalarField::write(Ostream& os) const
{
    fvPatchScalarField::write(os);
    if (phaseFraction_ != "alpha")
    {
        writeEntry(os, "phaseFraction", phaseFraction_);
    }
    writeEntry(os, "rho", rho_);
    writeEntry(os, "pRefValue", pRefValue_);
    writeEntry(os, "pRefPoint", pRefPoint_);
    writeEntry(os, "value", *this);
}
Example #19
0
void JSONObject::writeOrder(std::ostream& str, const std::vector<std::string>& order, WriteVisitor& visitor)
{
    str << "{" << std::endl;
    JSONObjectBase::level++;
    for (unsigned int i = 0; i < order.size(); i++) {
        writeEntry(str, order[i], _maps, visitor);
    }

    while(!_maps.empty()) {
        std::string key = _maps.begin()->first;
        writeEntry(str, key, _maps, visitor);
    }

    JSONObjectBase::level--;
    str << std::endl << JSONObjectBase::indent() << "}";
}
void inviscidWallPFvPatchScalarField::write(Ostream& os) const
{
    fixedGradientFvPatchScalarField::write(os);
    os.writeKeyword("fluxFraction")
        << fluxFraction_ << token::END_STATEMENT << nl;
    writeEntry("value", os);
}
void fixedTractionFvPatchVectorField::write(Ostream& os) const
{
    fvPatchVectorField::write(os);
    traction_.writeEntry("traction", os);
    pressure_.writeEntry("pressure", os);
    writeEntry("value", os);
}
void Foam::interstitialInletVelocityFvPatchVectorField::write(Ostream& os) const
{
    fvPatchField<vector>::write(os);
    os.writeEntryIfDifferent<word>("alpha", "alpha", alphaName_);
    inletVelocity_.writeEntry("inletVelocity", os);
    writeEntry("value", os);
}
void Foam::SRFVelocityFvPatchVectorField::write(Ostream& os) const
{
    fvPatchVectorField::write(os);
    os.writeKeyword("relative") << relative_ << token::END_STATEMENT << nl;
    inletValue_.writeEntry("inletValue", os);
    writeEntry("value", os);
}
void Foam::fluxCorrectedVelocityFvPatchVectorField::write(Ostream& os) const
{
    fvPatchVectorField::write(os);
    writeEntryIfDifferent<word>(os, "phi", "phi", phiName_);
    writeEntryIfDifferent<word>(os, "rho", "rho", rhoName_);
    writeEntry("value", os);
}
void sixDoFRigidBodyDisplacementPointPatchVectorField::write(Ostream& os) const
{
    pointPatchField<vector>::write(os);

    os.writeKeyword("rhoName") << rhoName_ << token::END_STATEMENT << nl;

    if (rhoName_ == "rhoInf")
    {
        os.writeKeyword("rhoInf") << rhoInf_ << token::END_STATEMENT << nl;
    }

    if (lookupGravity_ == 0 || lookupGravity_ == -2)
    {
        os.writeKeyword("g") << g_ << token::END_STATEMENT << nl;
    }

    os.writeKeyword("relaxationFactor")
        << relaxationFactor_ << token::END_STATEMENT << nl;

    motion_.write(os);

    initialPoints_.writeEntry("initialPoints", os);

    writeEntry("value", os);
}
void alphatWallFunctionFvPatchScalarField::write(Ostream& os) const
{
    fvPatchField<scalar>::write(os);
    writeEntryIfDifferent<word>(os, "mut", "mut", mutName_);
    os.writeKeyword("Prt") << Prt_ << token::END_STATEMENT << nl;
    writeEntry("value", os);
}
// Write
void tractionDisplacementFvPatchVectorField::write(Ostream& os) const
{
    fvPatchVectorField::write(os);
    traction_.writeEntry("traction", os);
    pressure_.writeEntry("pressure", os);
    writeEntry("value", os);
}
Example #28
0
void KConfigGroup::writeEntry(const QString &key, const char *value, WriteConfigFlags pFlags)
{
    Q_ASSERT_X(isValid(), "KConfigGroup::writeEntry", "accessing an invalid group");
    Q_ASSERT_X(!d->bConst, "KConfigGroup::writeEntry", "writing to a read-only group");

    writeEntry(key.toUtf8().constData(), QVariant(QString::fromLatin1(value)), pFlags);
}
Example #29
0
void KConfigGroup::writeEntry( const char* key, const QString& value, WriteConfigFlags flags )
{
    Q_ASSERT_X(isValid(), "KConfigGroup::writeEntry", "accessing an invalid group");
    Q_ASSERT_X(!d->bConst, "KConfigGroup::writeEntry", "writing to a read-only group");

    writeEntry(key, value.toUtf8(), flags);
}
void nutkAtmRoughWallFunctionFvPatchScalarField::write(Ostream& os) const
{
    fvPatchField<scalar>::write(os);
    writeLocalEntries(os);
    z0_.writeEntry("z0", os);
    writeEntry("value", os);
}