00001 #ifndef _MY_VectorBC_ 00002 #define _MY_VectorBC_ 00003 #include "globals.h" 00004 #include "vecincaccess.h" 00005 #include "orthomesh.h" 00006 00007 00008 struct VecIncBCData 00009 { 00010 double *p; 00011 Index nearCell; 00012 00013 VecIncBCData() 00014 :p(NULL),nearCell((Index) -1){} 00015 00016 VecIncBCData(double *p,Index nearCell) 00017 :p(p),nearCell(nearCell) 00018 {} 00019 00020 00021 00022 }; 00023 00028 class VecIncBC : private VecIncAccess<VecIncBCData> 00029 { 00030 private: 00031 Index _vectors_size; 00032 std::vector<double> m_v; 00033 VecIncAccess<VecIncBCData>::iterator it; 00034 protected: 00035 void reinit(Index nBC,Index vectors_size); 00036 void add_bc(Index faceIndex,Index nearCell,const VecDouble &bc); 00037 unsigned get_bcvector_size(){return _vectors_size;} 00038 00039 public: 00040 typedef VecIncAccess<VecIncBCData>::data_iterator data_iterator; 00041 00042 VecIncAccess<VecIncBCData>::begin_data; 00043 VecIncAccess<VecIncBCData>::end_data; 00044 VecIncAccess<VecIncBCData>::size; 00045 00046 VecIncBC():it(begin()){_vectors_size=0;} 00047 void rewind(); 00048 unsigned bc_dim(){return _vectors_size;} 00049 bool get_ref_bc(Index index,VecDoubleRef &vSw); 00050 double* get_bc_ptr(Index index); 00051 bool has_bc(Index index); 00052 bool copy_bc(Index index, VecDouble &vSw); 00053 void set_bc_from_function(OrthoMesh &mesh,Function3D &f); 00054 ~VecIncBC(){} 00055 friend std::ostream& operator<< (std::ostream& out,VecIncBC &vbc); 00056 }; 00057 00058 #endif