CG  Version 25
InterfaceTransfer.h
Go to the documentation of this file.
1 #ifndef INTERFACE_TRANSFER_H
2 #define INTERFACE_TRANSFER_H
3 
4 // -------------------------------------------------------------------------------------
5 // Class InterfaceTransfer : used to transfer information across an interface between
6 // two composite grids.
7 // -------------------------------------------------------------------------------------
8 
9 #include "Overture.h"
10 
11 // forward declarations:
13 class DomainSolver;
14 class Parameters;
15 class InterpolatePointsOnAGrid;
16 
17 
19 {
20 public:
21 
22 
25 
26 // Initialize the interface transfer at an interface
27 // (defines 2 transfer functions, from one side to the other and vice versa)
28 int
29 initialize( InterfaceDescriptor & interfaceDescriptor,
30  std::vector<DomainSolver*> domainSolver,
31  std::vector<int> & gfIndex,
32  Parameters & parameters );
33 
34 
35 // Set the interface transfer interpolation width
36 int
37 setInterpolationWidth( int width, int interfaceSide=-1 );
38 
39 // Set the default interface transfer interpolation widths. These values will apply when
40 // new InterfaceTransfer objects are built.
41 static int
42 setDefaultInterpolationWidth( int width, int interfaceSide=-1 );
43 
44 // Transfer the data from one side to the other
45 int
46 transferData( int domainSource, int domainTarget,
47  RealArray **sourceDataArray, Range & Cs,
48  RealArray **targetDataArray, Range & Ct,
49  InterfaceDescriptor & interfaceDescriptor,
50  std::vector<DomainSolver*> domainSolver,
51  std::vector<int> & gfIndex,
52  Parameters & parameters );
53 
54 
55 protected:
56 
58 InterpolatePointsOnAGrid *interpolatePointsOnAGrid; // for interpolating points on the interface
59 IntegerArray *indirectionArray; // holds indicies (i1,i2,i3,grid) of points on a interface
60 int interpolationWidth[2]; // interpolation width (one for each transfer direction)
61 static int defaultInterpolationWidth[2]; // default interpolation width (one for each transfer direction)
62 
63 int
64 internalInterpolate( RealArray **sourceDataArray, Range & Cs,
65  RealArray **targetDataArray, Range & Ct,
66  CompositeGrid & cg, int interfaceSide );
67 
68 
69 };
70 
71 
72 #endif