OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
FieldDataSource.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 /***************************************************************************
3  *
4  * The IPPL Framework
5  *
6  *
7  * Visit http://people.web.psi.ch/adelmann/ for more details
8  *
9  ***************************************************************************/
10 
11 #ifndef FIELD_DATA_SOURCE_H
12 #define FIELD_DATA_SOURCE_H
13 
14 /***********************************************************************
15  *
16  * class FieldDataSource
17  *
18  * FieldDataSource is a specific version of DataSourceObject which takes
19  * the data for a given Field and formats it properly for use by other
20  * agencies. This initial version collects all the data onto a parent node
21  * and then formats it for the desired agency. This is done by calling a
22  * virtual method 'insert_data' for each LField worth of data collected onto
23  * the master node. Future versions will properly redistribute the data
24  * based on the needs of the recipient.
25  *
26  * Subclasses must provide versions of the DataSourceObject virtual functions,
27  * as well as the insert_data virtual function.
28  *
29  * This is a rewrite of some sections of FieldView.
30  *
31  ***********************************************************************/
32 
33 // include files
35 
36 
37 // forward declarations
38 template<class T, unsigned Dim, class Mesh, class Centering> class Field;
39 template<class T, unsigned Dim> class CompressedBrickIterator;
40 template<unsigned Dim> class NDIndex;
41 
42 
43 template<class T, unsigned Dim, class M, class C>
45 
46 public:
47  // constructor: the name, the connection, the transfer method,
48  // the field to connect, and the parent node
49  FieldDataSource(const char *, DataConnect *, int, Field<T,Dim,M,C>&);
50 
51  // destructor
52  virtual ~FieldDataSource();
53 
54 protected:
55  // the field to connect
57 
58  // the function which performs the work to gather data onto one node
59  void gather_data();
60 
61  // copy the data out of the given LField iterator (which is occupying the
62  // given domain) and into the library-specific structure
63  virtual void insert_data(const NDIndex<Dim>&,
65 };
66 
68 
69 #endif // FIELD_DATA_SOURCE_H
70 
71 /***************************************************************************
72  * $RCSfile: FieldDataSource.h,v $ $Author: adelmann $
73  * $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:25 $
74  * IPPL_VERSION_ID: $Id: FieldDataSource.h,v 1.1.1.1 2003/01/23 07:40:25 adelmann Exp $
75  ***************************************************************************/
FieldDataSource(const char *, DataConnect *, int, Field< T, Dim, M, C > &)
Field< T, Dim, M, C > & MyField
virtual void insert_data(const NDIndex< Dim > &, CompressedBrickIterator< T, Dim >)=0
virtual ~FieldDataSource()