void Foam::expressionField::storeField(
    const T &data
)
{
    Dbug << "storeField()" << endl;
    if(field_.empty()) {
        Dbug << "storeField() - reset" << endl;
        field_.reset(
            new T(
                IOobject(
                    name_,
                    obr_.time().timeName(),
                    obr_,
                    IOobject::NO_READ,
                    autowrite_ ? IOobject::AUTO_WRITE : IOobject::NO_WRITE
                ),
                data
            )
        );
    } else {
        if(setDimensions_) {
            dynamic_cast<T &>(field_()).dimensions().reset(data.dimensions());
        }
        dynamic_cast<T &>(field_())==data;
    }

    if(setDimensions_) {
        dynamic_cast<T &>(field_()).dimensions().reset(dimensions_);
    }

    Dbug << "autoWrite: " << this->autowrite_ << " output Time: "
        << this->obr_.time().outputTime() << endl;
    if(
        this->autowrite_
        &&
        this->obr_.time().outputTime()
    ) {
        Dbug << "storeField() - writing" << endl;
        field_->write();
    }
    Dbug << "storeField() - end" << endl;
}
Beispiel #2
0
 char *keyfield(const char *name, int color, int length, int height, const char *initval, int initmode)
 {
     return field_(name, color, length, height, initval, initmode, FIELDKEY);
 }
Beispiel #3
0
 char *field(const char *name, int color, int length, int height, const char *initval, int initmode, bool password) // INTENSITY: Added password
 {
     return field_(name, color, length, height, initval, initmode, FIELDEDIT, password); // INTENSITY: Password
 }
    shiftMesh.movePoints(newPoints);

    ResultType newField(
        IOobject(
            field_->name()+"Shift",
            shiftMesh
        ),
        shiftMesh,
        field_->dimensions(),
        field_->internalField(),
        field_->boundaryField()
    );

    autoPtr<ResultType> mappedField(
        new ResultType(
            field_()
        )
    );
    ResultType &initField=mappedField();
#ifdef FOAM_NO_DIMENSIONEDINTERNAL_IN_GEOMETRIC
    const_cast<Field<Type>&>(initField.internalField().field())=defaultValue_;
#else
    initField.internalField()=defaultValue_;
#endif
    initField.correctBoundaryConditions();

    meshToMesh interpolation(
        shiftMesh,
        origMesh
#ifdef FOAM_NEW_MESH2MESH
        //        meshToMesh::imCellVolumeWeight,   // strange patterns