FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

procLduMatrix.C

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software: you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by
00013     the Free Software Foundation, either version 3 of the License, or
00014     (at your option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
00023 
00024 \*---------------------------------------------------------------------------*/
00025 
00026 #include "procLduMatrix.H"
00027 #include "procLduInterface.H"
00028 #include <OpenFOAM/lduMatrix.H>
00029 
00030 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
00031 
00032 Foam::procLduMatrix::procLduMatrix
00033 (
00034     const lduMatrix& ldum,
00035     const FieldField<Field, scalar>& interfaceCoeffs,
00036     const lduInterfaceFieldPtrsList& interfaces
00037 )
00038 :
00039     upperAddr_(ldum.lduAddr().upperAddr()),
00040     lowerAddr_(ldum.lduAddr().lowerAddr()),
00041     diag_(ldum.diag()),
00042     upper_(ldum.upper()),
00043     lower_(ldum.lower())
00044 {
00045     label nInterfaces = 0;
00046 
00047     forAll(interfaces, i)
00048     {
00049         if (interfaces.set(i))
00050         {
00051             nInterfaces++;
00052         }
00053     }
00054 
00055     interfaces_.setSize(nInterfaces);
00056 
00057     nInterfaces = 0;
00058 
00059     forAll(interfaces, i)
00060     {
00061         if (interfaces.set(i))
00062         {
00063             interfaces_.set
00064             (
00065                 nInterfaces++,
00066                 new procLduInterface
00067                 (
00068                     interfaces[i],
00069                     interfaceCoeffs[i]
00070                 )
00071             );
00072         }
00073     }
00074 
00075 }
00076 
00077 
00078 Foam::procLduMatrix::procLduMatrix(Istream& is)
00079 :
00080     upperAddr_(is),
00081     lowerAddr_(is),
00082     diag_(is),
00083     upper_(is),
00084     lower_(is),
00085     interfaces_(is)
00086 {}
00087 
00088 
00089 // * * * * * * * * * * * * * * * IOstream Operators  * * * * * * * * * * * * //
00090 
00091 Foam::Ostream& Foam::operator<<(Ostream& os, const procLduMatrix& cldum)
00092 {
00093     os  << cldum.upperAddr_
00094         << cldum.lowerAddr_
00095         << cldum.diag_
00096         << cldum.upper_
00097         << cldum.lower_
00098         << cldum.interfaces_;
00099     
00100     return os;
00101 }
00102 
00103 
00104 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines