Commit d93bbd2b authored by Martin Bauer's avatar Martin Bauer
Browse files

Optional compiled-in boundaries

parent aeff901c
......@@ -107,7 +107,7 @@ int main( int argc, char **argv )
{
timeLoop.add() << BeforeFunction(directComm ? F(twoFieldCommDirect) : F(twoFieldComm), "communication" )
<< Sweep( pystencils::GenLbKernel(pdfFieldId, omega), "LB stream & collide1" );
timeLoop.add() << BeforeFunction(directComm ? F(twoFieldCommDirect) : F(twoFieldComm), "communication" )
timeLoop.add() << BeforeFunction(directComm ? F(twoFieldCommDirect) : F(twoFieldComm), "communication" )
<< Sweep( pystencils::GenLbKernel(pdfFieldId, omega), "LB stream & collide2" );
} else if ( timeStepMode == "twoFieldKernelOnly") {
......@@ -122,7 +122,7 @@ int main( int argc, char **argv )
timeLoop.add() << Sweep( pystencils::GenLbKernelAAEven(pdfFieldId, omega), "AA Even" );
timeLoop.add() << Sweep( pystencils::GenLbKernelAAOdd(pdfFieldId, omega), "AA Odd");
} else {
WALBERLA_ABORT("Invalid value for timeStepMode ");
WALBERLA_ABORT("Invalid value for timeStepMode");
}
......
import sympy as sp
import pystencils as ps
from lbmpy.creationfunctions import create_lb_update_rule
from lbmpy.creationfunctions import create_lb_update_rule, create_lb_collision_rule
from pystencils_walberla import CodeGeneration, generate_pack_info_from_kernel, generate_sweep, generate_mpidtype_info_from_kernel
from lbmpy.macroscopic_value_kernels import macroscopic_values_getter, macroscopic_values_setter
from lbmpy.fieldaccess import AAEvenTimeStepAccessor, AAOddTimeStepAccessor
......@@ -117,16 +117,38 @@ with CodeGeneration() as ctx:
'split': opts['two_field_split'],
'cse_global': opts['two_field_cse_global'],
'cse_pdfs': opts['two_field_cse_pdfs']}, **options)
update_rule_aa_even = create_lb_update_rule(kernel_type=AAEvenTimeStepAccessor(),
optimization={'symbolic_field': pdfs,
'split': opts['aa_even_split'],
'cse_global': opts['aa_even_cse_global'],
'cse_pdfs': opts['aa_even_cse_pdfs']}, **options)
update_rule_aa_odd = create_lb_update_rule(kernel_type=AAOddTimeStepAccessor(),
optimization={'symbolic_field': pdfs,
'split': opts['aa_odd_split'],
'cse_global': opts['aa_odd_cse_global'],
'cse_pdfs': opts['aa_odd_cse_pdfs']}, **options)
include_boundaries = True
if include_boundaries:
from lbmpy.boundaries import NoSlip, UBB
from lbmpy.boundaries.boundaries_in_kernel import update_rule_with_push_boundaries
from collections import OrderedDict
boundaries = OrderedDict((
((1, 0, 0), NoSlip()),
((-1, 0, 0), NoSlip()),
((0, 1, 0), NoSlip()),
((0, -1, 0), NoSlip()),
((0, 0, 1), UBB([0.05, 0, 0])),
((0, 0, -1), NoSlip()),
))
cr_even = create_lb_collision_rule(stencil="D3Q19", compressible=False, optimization={'cse_global': opts['aa_even_cse_global'],
'cse_pdfs': opts['aa_even_cse_pdfs']})
cr_odd = create_lb_collision_rule(stencil="D3Q19", compressible=False, optimization={'cse_global': opts['aa_odd_cse_global'],
'cse_pdfs': opts['aa_odd_cse_pdfs']})
update_rule_aa_even = update_rule_with_push_boundaries(cr_even, pdfs, boundaries, AAEvenTimeStepAccessor, AAOddTimeStepAccessor.read)
update_rule_aa_odd = update_rule_with_push_boundaries(cr_odd, pdfs, boundaries, AAOddTimeStepAccessor, AAEvenTimeStepAccessor.read)
else:
update_rule_aa_even = create_lb_update_rule(kernel_type=AAEvenTimeStepAccessor(),
optimization={'symbolic_field': pdfs,
'split': opts['aa_even_split'],
'cse_global': opts['aa_even_cse_global'],
'cse_pdfs': opts['aa_even_cse_pdfs']}, **options)
update_rule_aa_odd = create_lb_update_rule(kernel_type=AAOddTimeStepAccessor(),
optimization={'symbolic_field': pdfs,
'split': opts['aa_odd_split'],
'cse_global': opts['aa_odd_cse_global'],
'cse_pdfs': opts['aa_odd_cse_pdfs']}, **options)
vec = { 'assume_aligned': True, 'assume_inner_stride_one': True}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment