33 def __init__(self,patch,patch_overlap,guard,additional_includes, add_assertions = True):
34 super(ProjectPatchOntoFaces,self).
__init__(descend_invocation_order=1,parallel=
False)
36 if patch_overlap.dim[0] % 2 != 0:
37 print(
"Error: Patch associated to face has to have even number of cells. Otherwise, it is not a symmetric overlap." )
38 assert( patch_overlap.dim[0] % 2 == 0 )
39 if patch.dim[0] != patch.dim[1]:
40 print(
"Error: Can only handle square patches." )
41 assert( patch.dim[0] == patch.dim[1] )
42 if patch_overlap.dim[1] != patch.dim[0]:
43 print(
"Error: Patch of overlap and patch of cell have to match" )
44 assert( patch_overlap.dim[1] == patch.dim[0] )
46 assert isinstance(patch.no_of_unknowns,int)
47 assert isinstance(patch.dim[0],int)
48 assert isinstance(patch_overlap.dim[0],int)
50 self.
d[
"UNKNOWNS" ] = str(patch.no_of_unknowns)
51 self.
d[
"DOFS_PER_AXIS" ] = str(patch.dim[0])
52 self.
d[
"OVERLAP" ] = str(
int(patch_overlap.dim[0]/2))
53 self.
d[
"FACES_ACCESSOR" ] =
"fineGridFaces" + patch_overlap.name
54 self.
d[
"CELL_ACCESSOR" ] =
"fineGridCell" + patch.name
55 self.
d[
"GUARD" ] = guard
57 self.
d[
"ASSERTION_PREFIX" ] =
"false"
59 self.
d[
"ASSERTION_PREFIX" ] =
"true"