# udfGetPbcData()

Return solution data for pairs of nodes for the periodic boundary condition.

## Syntax

data = udfGetPbcData( udfHd, dataName ) ;

## Type

AcuSolve User-Defined Problem Boundary Condition

## Parameters

- udfHd
- The opaque handle (pointer) which was passed to the user function.
- dataName (integer)
- Symbolic name of the requested data.
- UDF_PBC_VELOCITY
- Velocity.
- UDF_PBC_ACCELERATION
- Acceleration.
- UDF_PBC_PRESSURE
- Pressure.
- UDF_PBC_TEMPERATURE
- Temperature.
- UDF_PBC_SPECIES
- Species.
- UDF_PBC_EDDY_VISCOSITY
- Turbulence eddy viscosity.
- UDF_PBC_KINETIC_ENERGY
- Turbulence kinetic energy.
- UDF_PBC_EDDY_FREQUENCY
- Turbulence eddy frequency.
- UDF_PBC_MESH_DISPLACEMENT
- Mesh displacement.
- UDF_PBC_MESH_VELOCITY
- Mesh velocity.

## Return Value

- data (Real*)
- Pointer to two or three dimensional real array of the requested data. The dimensions of the
array depend on dataName as follows. nItems is the number of
node-pairs. If the third dimension is one, then the array may be treated as two
dimensional. The last non-trivial dimension is two for each of the two nodes in a
node-pair.
dataName First Dimension Second Dimension Third Dimension UDF_PBC_VELOCITY nItems 3 2 UDF_PBC_ACCLERATION nItems 3 2 UDF_PBC_PRESSURE nItems 2 1 UDF_PBC_TEMPERATURE nItems 2 1 UDF_PBC_SPECIES nItems udfGetNumSpecs() 2 UDF_PBC_EDDY_VISCOSITY nItems 2 1 UDF_PBC_KINETIC_ENERGY nItems 2 1 UDF_PBC_EDDY_FREQUENCY nItems 2 1 UDF_PBC_MESH_DISPLACEMENT nItems 3 2 UDF_PBC_MESH_VELOCITY nItems 3 2

## Description

This routine returns the requested solution data for the node-pairs. For
example,

```
Real* data ;
Real u_1, v_1, w_1, u_2, v_2, w_2 ;
Real spec_1, spec_2 ;
Integer pair, nSpecs, specId ;
...
data = udfGetPbcData( udfHd, UDF_PBC_VELOCITY ) ;
for ( pair = 0 ; pair < nItems ; pair++ ) {
/* velocity at first node */
u_1 = data[0*nItems+pair] ;
v_1 = data[1*nItems+pair] ;
w_1 = data[2*nItems+pair] ;
/* velocity at second node */
u_2 = data[3*nItems+pair] ;
v_2 = data[4*nItems+pair] ;
w_2 = data[5*nItems+pair] ;
...
}
...
data = udfGetPbcData( udfHd, UDF_PBC_SPECIES ) ;
nSpecs = udfGetNumSpecs( udfHd ) ;
for ( specId = 0 ; specId < nSpecs ; specId++ ) {
for ( pair = 0 ; pair < nItems ; pair++ ) {
/* species at first node */
spec_1 = data[specId*nItems+pair] ;
/* species at second node */
spec_2 = data[(nSpecs+specId)*nItems+pair] ;
...
}
}
```

## Errors

- This routine expects a valid udfHd.
- This routine may only be called within a Periodic Boundary Condition user function.
- dataName must be one of the values given above.
- The problem must contain the equation associated with the requested data.