Skip to content
Snippets Groups Projects
cartesian2DMeshGenerator.H 4.05 KiB
Newer Older
  • Learn to ignore specific revisions
  • Franjo's avatar
    Franjo committed
    /*---------------------------------------------------------------------------*\
      =========                 |
      \\      /  F ield         | cfMesh: A library for mesh generation
       \\    /   O peration     |
    
        \\  /    A nd           | www.cfmesh.com
         \\/     M anipulation  |
    
    Franjo's avatar
    Franjo committed
    -------------------------------------------------------------------------------
    
        Copyright (C) 2014-2017 Creative Fields, Ltd.
    -------------------------------------------------------------------------------
    Author
         Franjo Juretic (franjo.juretic@c-fields.com)
    
    
    Franjo's avatar
    Franjo committed
    License
    
        This file is part of OpenFOAM.
    
    Franjo's avatar
    Franjo committed
    
    
        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
    
    
        OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
    
    Franjo's avatar
    Franjo committed
        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
    
        along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
    
    Franjo's avatar
    Franjo committed
    
    Class
    
        Foam::Module::cartesian2DMeshGenerator
    
    Franjo's avatar
    Franjo committed
    
    Description
        Creates a 2D cartesian mesh from the quadtree
    
    SourceFiles
        cartesian2DMeshGenerator.C
    
    \*---------------------------------------------------------------------------*/
    
    #ifndef cartesian2DMeshGenerator_H
    #define cartesian2DMeshGenerator_H
    
    #include "polyMeshGen.H"
    #include "IOdictionary.H"
    
    #include "workflowControls.H"
    
    Franjo's avatar
    Franjo committed
    
    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
    
    namespace Foam
    {
    // Forward declarations
    class Time;
    
    
    namespace Module
    {
    class meshOctree;
    class triSurf;
    
    
    Franjo's avatar
    Franjo committed
    /*---------------------------------------------------------------------------*\
    
                      Class cartesian2DMeshGenerator Declaration
    
    Franjo's avatar
    Franjo committed
    \*---------------------------------------------------------------------------*/
    
    class cartesian2DMeshGenerator
    {
        // Private data
    
    Franjo's avatar
    Franjo committed
            //- reference to Time
            const Time& db_;
    
            //- pointer to the surface
            const triSurf* surfacePtr_;
    
    
            //- pointer to the modified surface mesh
            const triSurf* modSurfacePtr_;
    
    
    Franjo's avatar
    Franjo committed
            //- IOdictionary containing information about cell sizes, etc..
            IOdictionary meshDict_;
    
            //- pointer to the octree
            meshOctree* octreePtr_;
    
            //- mesh
            polyMeshGen mesh_;
    
    
            //- workflow controller
            workflowControls controller_;
    
    
    Franjo's avatar
    Franjo committed
        // Private member functions
    
    Franjo's avatar
    Franjo committed
            //- create cartesian mesh
            void createCartesianMesh();
    
            //- prepare mesh surface
            void surfacePreparation();
    
            //- map mesh to the surface and untangle surface
            void mapMeshToSurface();
    
    
            //- capture edges and corners
            void extractPatches();
    
    
    Franjo's avatar
    Franjo committed
            //- capture edges and corners
            void mapEdgesAndCorners();
    
            //- optimise surface mesh
            void optimiseMeshSurface();
    
            //- add boundary layers
            void generateBoundaryLayers();
    
            //- refine boundary layers
            void refBoundaryLayers();
    
            //- replace boundaries
            void replaceBoundaries();
    
            //- renumber the mesh
            void renumberMesh();
    
            //- generate mesh
            void generateMesh();
    
            //- Disallow default bitwise copy construct
            cartesian2DMeshGenerator(const cartesian2DMeshGenerator&);
    
            //- Disallow default bitwise assignment
            void operator=(const cartesian2DMeshGenerator&);
    
    
    
    public:
    
    Franjo's avatar
    Franjo committed
    
    
        //- Construct from time
        cartesian2DMeshGenerator(const Time&);
    
    Franjo's avatar
    Franjo committed
    
    
        //- Destructor
        ~cartesian2DMeshGenerator();
    
    Franjo's avatar
    Franjo committed
    
    
        // Member Functions
    
            //- write the mesh
            void writeMesh() const;
    };
    
    
    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
    
    
    } // End namespace Module
    
    Franjo's avatar
    Franjo committed
    } // End namespace Foam
    
    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
    
    #endif
    
    // ************************************************************************* //