Skip to content
Snippets Groups Projects
Commit 48999882 authored by Martin Bauer's avatar Martin Bauer
Browse files

PEP8 naming

parent 4dab0828
No related branches found
No related tags found
No related merge requests found
...@@ -2,7 +2,7 @@ import sympy as sp ...@@ -2,7 +2,7 @@ import sympy as sp
from pystencils import Field, Assignment from pystencils import Field, Assignment
from pystencils.astnodes import SympyAssignment from pystencils.astnodes import SympyAssignment
from pystencils.sympyextensions import get_symmetric_part from pystencils.sympyextensions import get_symmetric_part
from pystencils.data_types import createType from pystencils.data_types import create_type
from lbmpy.simplificationfactory import createSimplificationStrategy from lbmpy.simplificationfactory import createSimplificationStrategy
from lbmpy.boundaries.boundaryhandling import BoundaryOffsetInfo, LbmWeightInfo from lbmpy.boundaries.boundaryhandling import BoundaryOffsetInfo, LbmWeightInfo
...@@ -100,7 +100,7 @@ class UBB(Boundary): ...@@ -100,7 +100,7 @@ class UBB(Boundary):
@property @property
def additionalData(self): def additionalData(self):
if callable(self._velocity): if callable(self._velocity):
return [('vel_%d' % (i,), createType("double")) for i in range(self.dim)] return [('vel_%d' % (i,), create_type("double")) for i in range(self.dim)]
else: else:
return [] return []
......
...@@ -91,13 +91,13 @@ class LbmWeightInfo(CustomCppCode): ...@@ -91,13 +91,13 @@ class LbmWeightInfo(CustomCppCode):
def __init__(self, lbMethod): def __init__(self, lbMethod):
weights = [str(w.evalf()) for w in lbMethod.weights] weights = [str(w.evalf()) for w in lbMethod.weights]
code = "const double %s [] = { %s };\n" % (LbmWeightInfo.WEIGHTS_SYMBOL.name, ",".join(weights)) code = "const double %s [] = { %s };\n" % (LbmWeightInfo.WEIGHTS_SYMBOL.name, ",".join(weights))
super(LbmWeightInfo, self).__init__(code, symbolsRead=set(), super(LbmWeightInfo, self).__init__(code, symbols_read=set(),
symbolsDefined=set([LbmWeightInfo.WEIGHTS_SYMBOL])) symbols_defined=set([LbmWeightInfo.WEIGHTS_SYMBOL]))
def createLatticeBoltzmannBoundaryKernel(pdfField, indexField, lbMethod, boundaryFunctor, target='cpu', openMP=True): def createLatticeBoltzmannBoundaryKernel(pdfField, indexField, lbMethod, boundaryFunctor, target='cpu', openMP=True):
elements = [BoundaryOffsetInfo(lbMethod.stencil), LbmWeightInfo(lbMethod)] elements = [BoundaryOffsetInfo(lbMethod.stencil), LbmWeightInfo(lbMethod)]
indexArrDtype = indexField.dtype.numpyDtype indexArrDtype = indexField.dtype.numpy_dtype
dirSymbol = TypedSymbol("dir", indexArrDtype.fields['dir'][0]) dirSymbol = TypedSymbol("dir", indexArrDtype.fields['dir'][0])
elements += [Assignment(dirSymbol, indexField[0]('dir'))] elements += [Assignment(dirSymbol, indexField[0]('dir'))]
elements += boundaryFunctor(pdfField=pdfField, directionSymbol=dirSymbol, lbMethod=lbMethod, indexField=indexField) elements += boundaryFunctor(pdfField=pdfField, directionSymbol=dirSymbol, lbMethod=lbMethod, indexField=indexField)
......
...@@ -153,7 +153,7 @@ import sympy as sp ...@@ -153,7 +153,7 @@ import sympy as sp
from copy import copy from copy import copy
from pystencils.cache import diskcacheNoFallback from pystencils.cache import diskcacheNoFallback
from pystencils.data_types import collateTypes from pystencils.data_types import collate_types
from pystencils.assignment_collection.assignment_collection import AssignmentCollection from pystencils.assignment_collection.assignment_collection import AssignmentCollection
from pystencils.field import getLayoutOfArray, Field from pystencils.field import getLayoutOfArray, Field
from pystencils import createKernel, Assignment from pystencils import createKernel, Assignment
...@@ -193,7 +193,7 @@ def createLatticeBoltzmannAst(updateRule=None, optimizationParams={}, **kwargs): ...@@ -193,7 +193,7 @@ def createLatticeBoltzmannAst(updateRule=None, optimizationParams={}, **kwargs):
updateRule = createLatticeBoltzmannUpdateRule(**params) updateRule = createLatticeBoltzmannUpdateRule(**params)
fieldTypes = set(fa.field.dtype for fa in updateRule.defined_symbols if isinstance(fa, Field.Access)) fieldTypes = set(fa.field.dtype for fa in updateRule.defined_symbols if isinstance(fa, Field.Access))
res = createKernel(updateRule, target=optParams['target'], dataType=collateTypes(fieldTypes), res = createKernel(updateRule, target=optParams['target'], dataType=collate_types(fieldTypes),
cpuOpenMP=optParams['openMP'], cpuVectorizeInfo=optParams['vectorization'], cpuOpenMP=optParams['openMP'], cpuVectorizeInfo=optParams['vectorization'],
gpuIndexing=optParams['gpuIndexing'], gpuIndexingParams=optParams['gpuIndexingParams'], gpuIndexing=optParams['gpuIndexing'], gpuIndexingParams=optParams['gpuIndexingParams'],
ghostLayers=1) ghostLayers=1)
......
...@@ -94,7 +94,7 @@ class PeriodicTwoFieldsAccessor(PdfFieldAccessor): ...@@ -94,7 +94,7 @@ class PeriodicTwoFieldsAccessor(PdfFieldAccessor):
lowerLimit = self._ghostLayers lowerLimit = self._ghostLayers
upperLimit = field.spatialShape[coordId] - 1 - self._ghostLayers upperLimit = field.spatialShape[coordId] - 1 - self._ghostLayers
limitDiff = upperLimit - lowerLimit limitDiff = upperLimit - lowerLimit
loopCounter = LoopOverCoordinate.getLoopCounterSymbol(coordId) loopCounter = LoopOverCoordinate.get_loop_counter_symbol(coordId)
if dirElement == 0: if dirElement == 0:
periodicPullDirection.append(0) periodicPullDirection.append(0)
elif dirElement == 1: elif dirElement == 1:
......
...@@ -2,7 +2,7 @@ import sympy as sp ...@@ -2,7 +2,7 @@ import sympy as sp
import numpy as np import numpy as np
from lbmpy.scenarios import * from lbmpy.scenarios import *
from lbmpy.creationfunctions import * from lbmpy.creationfunctions import *
from pystencils import makeSlice, showCode from pystencils import makeSlice, show_code
from lbmpy.boundaries import * from lbmpy.boundaries import *
from lbmpy.postprocessing import * from lbmpy.postprocessing import *
from lbmpy.lbstep import LatticeBoltzmannStep from lbmpy.lbstep import LatticeBoltzmannStep
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment