Foam::pointField Foam::binaryOperationSearchableSurface::coordinates() const
{
    if(debug) {
        Info << "Foam::binaryOperationSearchableSurface::coordinates " << name() << endl;
    }

    pointField aCoords(a().coordinates());
    pointField bCoords(b().coordinates());

    pointField result(aCoords.size()+bCoords.size());

    forAll(aCoords,i) {
        result[i]=aCoords[i];
    }
    forAll(bCoords,i) {
        result[i+aCoords.size()]=bCoords[i];
    }
    if(debug) {
        Info << "A: " << aCoords.size() << " B: " << bCoords.size()
            << " -> " << result.size() << "(" << this->size() << ")" << endl;
    }
    // if(result.size()!=this->size()) {
    //     WarningIn("binaryOperationSearchableSurface::coordinates()")
    //         << "Number of coordinates " << result.size() << " does not match "
    //             << " the promised size: " << this->size() << endl
    //             << "Coordinates: " << result << endl
    //             << "Regions: " << regions() << endl;
    //         //                << exit(FatalError);

    // }
    return result;
}
コード例 #2
0
Foam::tmp<Foam::pointField>
#else
Foam::pointField
#endif
Foam::binaryOperationSearchableSurface::coordinates() const
{
    if(debug) {
        Info << "Foam::binaryOperationSearchableSurface::coordinates " << name() << endl;
    }

    pointField aCoords(a().coordinates());
    pointField bCoords(b().coordinates());

    pointField result(aCoords.size()+bCoords.size());

    forAll(aCoords,i) {
        result[i]=aCoords[i];
    }
    forAll(bCoords,i) {
        result[i+aCoords.size()]=bCoords[i];
    }
    if(debug) {
        Info << "A: " << aCoords.size() << " B: " << bCoords.size()
            << " -> " << result.size() << "(" << this->size() << ")" << endl;
    }
    // if(result.size()!=this->size()) {
    //     WarningIn("binaryOperationSearchableSurface::coordinates()")
    //         << "Number of coordinates " << result.size() << " does not match "
    //             << " the promised size: " << this->size() << endl
    //             << "Coordinates: " << result << endl
    //             << "Regions: " << regions() << endl;
    //         //                << exit(FatalError);

    // }

#ifdef FOAM_SEARCHABLE_SURF_USES_TMP
    return tmp<pointField>(new pointField(result));
#else
    return result;
#endif
}