CG
Version 25
Main Page
Namespaces
Classes
Files
File List
File Members
cg.v25
ins
src
ins/src/boundaryMacros.h
Go to the documentation of this file.
1
// ===================================================================================
2
// This macro extracts the boundary data arrays
3
//
4
// *wdh* 110312 THIS WAS COPIED FROM cg/sm/src -- FIX ME ---
5
// ===================================================================================
6
#beginMacro extractBoundaryDataArrays()
7
int
pdbc
[2*3*2*3];
8
#define dbc(s,a,side,axis) (pdbc[(s)+2*((a)+3*((side)+2*(axis)))])
9
int
pAddBoundaryForcing
[6];
10
#define addBoundaryForcing(side,axis) (pAddBoundaryForcing[(side)+2*(axis)])
11
real *
pbcf
[2][3];
12
// long int pbcfOffset[6];
13
// We need an 8 byte integer so we can pass to fortran: int64_t is in stdint.h
14
int64_t
pbcfOffset
[6];
15
#define bcfOffset(side,axis) pbcfOffset[(side)+2*(axis)]
16
for
(
int
axis
=0;
axis
<=2;
axis
++ )
17
{
18
for
(
int
side
=0;
side
<=1;
side
++ )
19
{
20
// *** for now make sure the boundary data array is allocated on all sides
21
if
(
false
&&
// We do NOT need to always allocate the boundaryDataArray for INS *wdh* 110313
22
( pBoundaryData[
side
][
axis
]==NULL || parameters.isAdaptiveGridProblem() ) &&
23
mg
.boundaryCondition(
side
,
axis
)>0 )
24
{
25
parameters.getBoundaryData(
side
,
axis
,
grid
,
mg
);
26
// RealArray & bd = *pBoundaryData[side][axis]; // this is now done in the above line *wdh* 090819
27
// bd=0.;
28
}
29
30
if
( pBoundaryData[
side
][
axis
]!=NULL )
31
{
32
addBoundaryForcing
(
side
,
axis
)=
true
;
33
RealArray & bd = *pBoundaryData[
side
][
axis
];
34
pbcf
[
side
][
axis
] = bd.getDataPointer();
35
36
// if( debug & 8 )
37
// ::display(bd,sPrintF(" ++++ Cgsm: Here is bd (side,axis)=(%i,%i) ++++",side,axis),"%4.2f ");
38
39
40
for
(
int
a
=0;
a
<=2;
a
++ )
41
{
42
dbc
(0,
a
,
side
,
axis
)=bd.getBase(
a
);
43
dbc
(1,
a
,
side
,
axis
)=bd.getBound(
a
);
44
}
45
}
46
else
47
{
48
addBoundaryForcing
(
side
,
axis
)=
false
;
49
pbcf
[
side
][
axis
] = fptr;
// should not be used in this case
50
for
(
int
a
=0;
a
<=2;
a
++ )
51
{
52
dbc
(0,
a
,
side
,
axis
)=0;
53
dbc
(1,
a
,
side
,
axis
)=0;
54
}
55
}
56
57
// for now we save the offset in a 4 byte int (double check that this is ok)
58
int64_t offset =
pbcf
[
side
][
axis
]-
pbcf
[0][0];
59
// if( offset > INT_MAX )
60
// {
61
// printF("ERROR: offset=%li INT_MAX=%li \n",offset,(long int)INT_MAX);
62
// }
63
// assert( offset < INT_MAX );
64
bcfOffset
(
side
,
axis
) = offset;
65
// bcfOffset(side,axis) = pbcf[side][axis]- pbcf[0][0];
66
67
// cout << " **** bcfOffset= " << bcfOffset(side,axis) << endl;
68
69
70
}
71
}
72
#endMacro
73
Generated on Fri Jan 4 2013 10:19:15 for CG by
1.8.3