Пример #1
0
void faForceEquation<vector>::operator()(faMatrix<vector> &eq)
{
    clearVariables();

    DynamicList<label> cellIDs;

    if(!getMask(cellIDs,eq.psi().name())) {
        return;
    }

    Field<vector> values(cellIDs.size());

    parse(valueExpression_);
    const areaVectorField &calculated=getVector();

    forAll(cellIDs,i) {
        values[i]=calculated[cellIDs[i]];
    }

    eq.setValues(cellIDs,values);
}
Пример #2
0
void faForceEquation<T>::operator()(faMatrix<T> &eq)
{
    typedef GeometricField<T,faPatchField,areaMesh> resultField;

    clearVariables();

    DynamicList<label> cellIDs;

    if(!getMask(cellIDs,eq.psi().name())) {
        return;
    }

    Field<T> values(cellIDs.size());

    parse(valueExpression_);
    const resultField &calculated=getResult<resultField>();

    forAll(cellIDs,i) {
        values[i]=calculated[cellIDs[i]];
    }

    eq.setValues(cellIDs,values);
}