$treeview $search $mathjax
Palabos  Version 1.1
$projectbrief
$projectbrief
$searchbox

serializerIO_2D.h

Go to the documentation of this file.
00001 /* This file is part of the Palabos library.
00002  *
00003  * Copyright (C) 2011 FlowKit Sarl
00004  * Avenue de Chailly 23
00005  * 1012 Lausanne, Switzerland
00006  * E-mail contact: contact@flowkit.com
00007  *
00008  * The most recent release of Palabos can be downloaded at 
00009  * <http://www.palabos.org/>
00010  *
00011  * The library Palabos is free software: you can redistribute it and/or
00012  * modify it under the terms of the GNU Affero General Public License as
00013  * published by the Free Software Foundation, either version 3 of the
00014  * License, or (at your option) any later version.
00015  *
00016  * The library is distributed in the hope that it will be useful,
00017  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019  * GNU Affero General Public License for more details.
00020  *
00021  * You should have received a copy of the GNU Affero General Public License
00022  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
00023 */
00024 
00025 #ifndef SERIALIZER_IO_2D_H
00026 #define SERIALIZER_IO_2D_H
00027 
00028 #include "core/globalDefs.h"
00029 #include "core/block2D.h"
00030 #include "multiBlock/multiBlock2D.h"
00031 #include "multiBlock/multiDataField2D.h"
00032 #include "multiBlock/multiBlockLattice2D.h"
00033 #include "atomicBlock/dataField2D.h"
00034 #include "atomicBlock/blockLattice2D.h"
00035 #include "io/serializerIO.h"
00036 #include "io/parallelIO.h"
00037 
00038 namespace plb {
00039 
00041 
00048 void saveBinaryBlock(Block2D const& block, std::string fName, bool enforceUint=false);
00049 
00051 
00058 void loadBinaryBlock(Block2D& block, std::string fName, bool enforceUint=false);
00059 
00061 
00071 template<typename T>
00072 std::ostream& block2ostream(std::ostream& ostr, Block2D const& block);
00073 
00074 template<typename T>
00075 std::ostream& operator<<(std::ostream& ostr, MultiScalarField2D<T> const& block) {
00076     return block2ostream<T>(ostr, block);
00077 }
00078 
00079 template<typename T>
00080 std::ostream& operator<<(std::ostream& ostr, MultiNTensorField2D<T> const& block) {
00081     return block2ostream<T>(ostr, block);
00082 }
00083 
00084 template<typename T, int nDim>
00085 std::ostream& operator<<(std::ostream& ostr, MultiTensorField2D<T,nDim> const& block) {
00086     return block2ostream<T>(ostr, block);
00087 }
00088 
00089 template<typename T, template<typename U> class Descriptor>
00090 std::ostream& operator<<(std::ostream& ostr, MultiBlockLattice2D<T,Descriptor> const& block) {
00091     return block2ostream<T>(ostr, block);
00092 }
00093 
00094 
00095 
00096 template<typename T>
00097 std::ostream& operator<<(std::ostream& ostr, ScalarField2D<T> const& block) {
00098     return block2ostream<T>(ostr, block);
00099 }
00100 
00101 template<typename T>
00102 std::ostream& operator<<(std::ostream& ostr, NTensorField2D<T> const& block) {
00103     return block2ostream<T>(ostr, block);
00104 }
00105 
00106 template<typename T, int nDim>
00107 std::ostream& operator<<(std::ostream& ostr, TensorField2D<T,nDim> const& block) {
00108     return block2ostream<T>(ostr, block);
00109 }
00110 
00111 template<typename T, template<typename U> class Descriptor>
00112 std::ostream& operator<<(std::ostream& ostr, BlockLattice2D<T,Descriptor> const& block) {
00113     return block2ostream<T>(ostr, block);
00114 }
00115 
00116 
00118 
00126 template<typename T>
00127 std::istream& istream2block(std::istream& istr, Block2D& block);
00128 
00129 template<typename T>
00130 std::istream& operator>>(std::istream& istr, MultiScalarField2D<T>& block) {
00131     return istream2block<T>(istr, block);
00132 }
00133 
00134 template<typename T>
00135 std::istream& operator>>(std::istream& istr, MultiNTensorField2D<T>& block) {
00136     return istream2block<T>(istr, block);
00137 }
00138 
00139 template<typename T,int nDim>
00140 std::istream& operator>>(std::istream& istr, MultiTensorField2D<T,nDim>& block) {
00141     return istream2block<T>(istr, block);
00142 }
00143 
00144 template<typename T, template<typename U> class Descriptor>
00145 std::istream& operator>>(std::istream& istr, MultiBlockLattice2D<T,Descriptor>& block) {
00146     return istream2block<T>(istr, block);
00147 }
00148 
00149 
00150 template<typename T>
00151 std::istream& operator>>(std::istream& istr, ScalarField2D<T>& block) {
00152     return istream2block<T>(istr, block);
00153 }
00154 
00155 template<typename T>
00156 std::istream& operator>>(std::istream& istr, NTensorField2D<T>& block) {
00157     return istream2block<T>(istr, block);
00158 }
00159 
00160 template<typename T,int nDim>
00161 std::istream& operator>>(std::istream& istr, TensorField2D<T,nDim>& block) {
00162     return istream2block<T>(istr, block);
00163 }
00164 
00165 template<typename T, template<typename U> class Descriptor>
00166 std::istream& operator>>(std::istream& istr, BlockLattice2D<T,Descriptor>& block) {
00167     return istream2block<T>(istr, block);
00168 }
00169 
00170 } // namespace plb
00171 
00172 #endif  // SERIALIZER_IO_2D_H