cartesianMeshExtractorPointsAndAddressing.C 1.95 KB
Newer Older
Franjo's avatar
Franjo committed
1 2 3 4 5 6 7 8
/*---------------------------------------------------------------------------*\
  =========                 |
  \\      /  F ield         | cfMesh: A library for mesh generation
   \\    /   O peration     |
    \\  /    A nd           | Author: Franjo Juretic (franjo.juretic@c-fields.com)
     \\/     M anipulation  | Copyright (C) Creative Fields, Ltd.
-------------------------------------------------------------------------------
License
9
    This file is part of OpenFOAM.
Franjo's avatar
Franjo committed
10

11 12 13 14
    OpenFOAM is free software: you can redistribute it and/or modify it
    under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.
Franjo's avatar
Franjo committed
15

16
    OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
Franjo's avatar
Franjo committed
17 18 19 20 21
    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    for more details.

    You should have received a copy of the GNU General Public License
22
    along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
Franjo's avatar
Franjo committed
23 24 25 26 27 28 29 30

\*---------------------------------------------------------------------------*/

#include "cartesianMeshExtractor.H"
#include "meshOctree.H"

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

31
void Foam::Module::cartesianMeshExtractor::createPointsAndAddressing()
Franjo's avatar
Franjo committed
32
{
33
    Info<< "Creating octree vertices" << endl;
Franjo's avatar
Franjo committed
34

35
    Info<< "Octree nodes " << octreeCheck_.numberOfNodes() << endl;
Franjo's avatar
Franjo committed
36

37
    // set the size of the point field
Franjo's avatar
Franjo committed
38 39 40
    pointFieldPMG& points = mesh_.points();
    points.setSize(octreeCheck_.numberOfNodes());

41
    // store vertices into the pointField
Franjo's avatar
Franjo committed
42 43 44 45 46
    const pointField& octreePoints = octreeCheck_.octreePoints();

    forAll(points, pointI)
        points[pointI] = octreePoints[pointI];

47
    Info<< "Finished creating octree vertices" << endl;
Franjo's avatar
Franjo committed
48 49
}

50

Franjo's avatar
Franjo committed
51
// ************************************************************************* //