# Is there a procedure same as OnLatticeBoundaryCondition3D<T,DESCRIPTOR> for ScalarField in Palabos?

[b][size=large]Hi guys,
I’ve imposed boundary::freeslip to a MultiBlockLattice3D field as follows:[/size]

[i]MultiBlockLattice3D<T,DESCRIPTOR>* createLattice()
{
// Envelope of width 2 for the next-to-nearest-neighbor finite
// difference schemes.
plint envelopeWidth = 2;
SparseBlockStructure3D blockStructure (
createRegularDistribution3D(nx, ny, nz) );

``````MultiBlockLattice3D<T,DESCRIPTOR>* lattice =
new MultiBlockLattice3D<T,DESCRIPTOR> (
MultiBlockManagement3D (
blockStructure,
envelopeWidth ),
defaultMultiBlockPolicy3D().getBlockCommunicator(),
defaultMultiBlockPolicy3D().getCombinedStatistics(),
defaultMultiBlockPolicy3D().getMultiCellAccess<T,DESCRIPTOR>(),
new NoDynamics<T,DESCRIPTOR>() );
//lattice->periodicity().toggleAll(true);
lattice->periodicity().toggle(0,false);
lattice->periodicity().toggle(1,false);
lattice->periodicity().toggle(2,false);

OnLatticeBoundaryCondition3D<T,DESCRIPTOR> *bcL = createLocalBoundaryCondition3D<T,DESCRIPTOR>();
Box3D sideX1(0   , 0   , 0, ny-1, 0   , nz-1);
Box3D sideX2(nx-1, nx-1, 0, ny-1, 0   , nz-1);
Box3D sideZ1(0   , nx-1, 0, ny-1, 0   , 0   );
Box3D sideZ2(0   , nx-1, 0, ny-1, nz-1, nz-1);

bcL->setVelocityConditionOnBlockBoundaries (*lattice, sideX1, boundary::freeslip );
bcL->setVelocityConditionOnBlockBoundaries (*lattice, sideX2, boundary::freeslip );
bcL->setVelocityConditionOnBlockBoundaries (*lattice, sideZ1, boundary::freeslip );
bcL->setVelocityConditionOnBlockBoundaries (*lattice, sideZ2, boundary::freeslip );

return lattice;
``````

}[/i]

[size=large]I have a same MultiScalarField3D as well that I need to impose a same boundary::freeslip boundary condition:[/size]

[i]MultiScalarField3D* createScalarField()
{
// Envelope of width 2 for the next-to-nearest-neighbor finite
// difference schemes.
plint envelopeWidth = 2;
SparseBlockStructure3D blockStructure (
createRegularDistribution3D(nx, ny, nz) );

``````MultiScalarField3D<T>* field =
new MultiScalarField3D<T> (
MultiBlockManagement3D (
blockStructure,
envelopeWidth ),
defaultMultiBlockPolicy3D().getBlockCommunicator(),
defaultMultiBlockPolicy3D().getCombinedStatistics(),
defaultMultiBlockPolicy3D().getMultiScalarAccess<T>() );
//field->periodicity().toggleAll(true);
field->periodicity().toggle(0,false);
field->periodicity().toggle(1,false);
field->periodicity().toggle(2,false);

return field;
``````

}[/i]

[size=large]Is there a procedure same as OnLatticeBoundaryCondition3D<T,DESCRIPTOR> to impose boundary::freeslip boundary condition for ScalarField?

Bests.[/size][/b]