40 estimates:
"double**",
42 weights:
"const double*",
43 timeStepSize:
"double",
45 dt =
Float(
"timeStepSize")
47 [[0, NumberOfUnknowns + NumberOfAuxiliaryVariables], [0, NumberOfDoFs], [0, 1]],
51 [[0, NumberOfUnknowns], [0, NumberOfDoFs], [0, NumberOfEstimates]],
"estimates"
54 [[0, NumberOfUnknowns + NumberOfAuxiliaryVariables], [0, NumberOfDoFs], [0, 1]],
57 W = DiagonalMatrix(NumberOfEstimates,
"weights")
59 dot(W, K[0:NumberOfUnknowns, :, :], contribution)
60 out[0:NumberOfUnknowns, :, 0] = out[0:NumberOfUnknowns, :, 0] + dt * contribution
67def generate_linear_combination_kernel(namespace, output_directory):
70 Translate linearCombinationOfRungeKuttaEstimates() into C++
72 The kernel ends up in kernels/rungekutta_linear_combination.h in the
73 output directory. It is a function template over NumberOfDoFs,
74 NumberOfUnknowns, NumberOfAuxiliaryVariables and NumberOfEstimates within
75 namespace. It does not depend on any solver, so several solvers within
76 one project can share it: Each of them generates the very same file.
78 @param namespace: [str]
79 Namespace of the generated function template, usually the Peano
82 @param output_directory: str
83 Directory the kernels/ subdirectory is created in, usually the Peano
87 dslhype.translate_dslhype_function(
88 function=linearCombinationOfRungeKuttaEstimates,
89 function_namespace=namespace,
102 functor_parameters=[],
104 output_file_name=LINEAR_COMBINATION_KERNEL_FILE,
105 target=dslhype.Target.Serial,
107 output_directory=output_directory,
109 include_implementation_into_header(
110 os.path.join(output_directory,
"kernels"), LINEAR_COMBINATION_KERNEL_FILE
"void" linearCombinationOfRungeKuttaEstimates("double**" solution, "double**" estimates, "double**" output, "const double*" weights, "double" timeStepSize)
DSLHyPE kernel for the linear combinations of Runge-Kutta.