/*---------------------------------------------------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     |
    \\  /    A nd           | Copyright (C) 1991-2015 OpenCFD Ltd.
     \\/     M anipulation  |
-------------------------------------------------------------------------------
License
    This file uses OpenFOAM and is provided as free software without any warranty

    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 2 of the License, or (at your
    option) any later version.

    OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
    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, write to the Free Software Foundation,
    Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

Class
    totalVelocityFvPatchVectorField

Description

BC for the velocity under total conditions

SourceFiles
    totalVelocityFvPatchVectorField.C

Authors
    Luca Mangani   HSLU email: luca.mangani@hslu.ch
    Marwan Darwish AUB  email: darwish@aub.edu.lb
    Fadl Moukalled AUB  email: moukalled@aub.edu.lb

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

#ifndef totalVelocityFvPatchVectorField_H
#define totalVelocityFvPatchVectorField_H

#include "fixedValueFvPatchFields.H"

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

namespace Foam
{

/*---------------------------------------------------------------------------*\
                           Class totalVelocity2FvPatch Declaration
\*---------------------------------------------------------------------------*/

class totalVelocityFvPatchVectorField
:
    public fixedValueFvPatchVectorField
{
    				
    vectorField inletDir_;

public:

    //- Runtime type information
    TypeName("totalVelocity");


    // Constructors

        //- Construct from patch and internal field
        totalVelocityFvPatchVectorField
        (
            const fvPatch&,
            const DimensionedField<vector,volMesh>&
        );

        //- Construct from patch, internal field and dictionary
        totalVelocityFvPatchVectorField
        (
            const fvPatch&,
            const DimensionedField<vector,volMesh>&,
            const dictionary&
        );

        //- Construct by mapping given totalVelocityFvPatchVectorField 
        //  onto a new patch
        totalVelocityFvPatchVectorField
        (
            const totalVelocityFvPatchVectorField&,
            const fvPatch&,
            const DimensionedField<vector,volMesh>&,
            const fvPatchFieldMapper&
        );

        //- Construct as copy
        totalVelocityFvPatchVectorField
        (
            const totalVelocityFvPatchVectorField&
        );

        //- Construct and return a clone
        virtual tmp<fvPatchVectorField> clone() const
        {
            return tmp<fvPatchVectorField>
            (
                new totalVelocityFvPatchVectorField(*this)
            );
        }

        //- Construct as copy setting internal field reference
        totalVelocityFvPatchVectorField
        (
            const totalVelocityFvPatchVectorField&,
            const DimensionedField<vector,volMesh>&
        );

        //- Construct and return a clone setting internal field reference
        virtual tmp<fvPatchVectorField> clone
        (
            const DimensionedField<vector,volMesh>& iF
        ) const
        {
            return tmp<fvPatchVectorField>
            (
                new totalVelocityFvPatchVectorField(*this, iF)
            );
        }


    // Member functions

        // Mapping functions

            //- Map (and resize as needed) from self given a mapping object
            virtual void autoMap
            (
                const fvPatchFieldMapper&
            );

            //- Reverse map the given fvPatchField onto this fvPatchField
            virtual void rmap
            (
                const fvPatchVectorField&,
                const labelList&
            );


        // Evaluation functions

            //- Update the coefficients associated with the patch field
            virtual void updateCoeffs();
           //- Update the coefficients associated with the patch field
            virtual void evaluate();

        //- Write
        virtual void write(Ostream&) const;

        //- Access to inlet direction

        //- Access to inlet direction
        virtual const vectorField& inletDir() const
        {
            return inletDir_;
        } 

};


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

} // End namespace Foam

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

#endif

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