10 WithVirtualFunctions = 0
13 AcceleratorWithExplicitCopy = 3
18 PatchWiseAoSoAHeap = 31
24 TaskGraphAoSoAHeap = 61
29 Template = jinja2.Template(
"""
31 {% if EIGENVALUES_IMPLEMENTATION!="<user-defined>" and STATELESS_PDE_TERMS %}
33 * Depending on the implementation, this variant might be slow as it
34 * lacks an inline define. Also, if you don't want to use ipo aggressively,
35 * it might be clever to put the implementation into the header.
39 * At the moment, SYCL seems to struggle with ipo, even if a function is
40 * never called. So I embed the (empty) implementation directly into the
43 #if defined(GPUOffloadingOMP)
44 #pragma omp declare target
46 static GPUCallableMethod void maxEigenvalue(
47 const double * __restrict__ Q, // Q[{{NUMBER_OF_UNKNOWNS}}+{{NUMBER_OF_AUXILIARY_VARIABLES}}],
48 const tarch::la::Vector<Dimensions,double>& faceCentre,
49 const tarch::la::Vector<Dimensions,double>& gridCellH,
53 double* __restrict__ maxEigenvalue,
56 //#if defined(GPUOffloadingSYCL)
61 #if defined(GPUOffloadingOMP)
62 #pragma omp end declare target
67 {% if EIGENVALUES_IMPLEMENTATION!="<none>" %}
69 * Determine max eigenvalue over Jacobian in a given point with solution values
70 * (states) Q. All parameters are in.
72 * @return Max eigenvalue. Result has to be positive, so we are actually speaking
73 * about the maximum absolute eigenvalue.
75 virtual void maxEigenvalue(
76 const double * __restrict__ Q, // Q[{{NUMBER_OF_UNKNOWNS}}+{{NUMBER_OF_AUXILIARY_VARIABLES}}],
77 const tarch::la::Vector<Dimensions,double>& faceCentre,
78 const tarch::la::Vector<Dimensions,double>& gridCellH,
82 double* __restrict__ maxEigenvalue
83 ) {% if EIGENVALUES_IMPLEMENTATION=="<user-defined>" %}= 0{% else %} final{% endif %};
87 {% if FLUX_IMPLEMENTATION!="<user-defined>" and STATELESS_PDE_TERMS %}
89 * Depending on the implementation, this variant might be slow as it
90 * lacks an inline define. Also, if you don't want to use ipo aggressively,
91 * it might be clever to put the implementation into the header.
95 * At the moment, SYCL seems to struggle with ipo, even if a function is
96 * never called. So I embed the (empty) implementation directly into the
99 #if defined(GPUOffloadingOMP)
100 #pragma omp declare target
102 static GPUCallableMethod void flux(
103 const double * __restrict__ Q, // Q[{{NUMBER_OF_UNKNOWNS}}+{{NUMBER_OF_AUXILIARY_VARIABLES}}],
104 const tarch::la::Vector<Dimensions,double>& faceCentre,
105 const tarch::la::Vector<Dimensions,double>& gridCellH,
109 double * __restrict__ F, // F[{{NUMBER_OF_UNKNOWNS}}]
112 //#if defined(GPUOffloadingSYCL)
117 #if defined(GPUOffloadingOMP)
118 #pragma omp end declare target
122 {% if FLUX_IMPLEMENTATION!="<none>" %}
124 const double * __restrict__ Q, // Q[{{NUMBER_OF_UNKNOWNS}}+{{NUMBER_OF_AUXILIARY_VARIABLES}}],
125 const tarch::la::Vector<Dimensions,double>& faceCentre,
126 const tarch::la::Vector<Dimensions,double>& gridCellH,
130 double * __restrict__ F // F[{{NUMBER_OF_UNKNOWNS}}]
131 ) {% if FLUX_IMPLEMENTATION=="<user-defined>" %}=0{% else %} final {% endif %};
135 {% if NCP_IMPLEMENTATION!="<user-defined>" and STATELESS_PDE_TERMS %}
137 * Depending on the implementation, this variant might be slow as it
138 * lacks an inline define. Also, if you don't want to use ipo aggressively,
139 * it might be clever to put the implementation into the header.
143 * At the moment, SYCL seems to struggle with ipo, even if a function is
144 * never called. So I embed the (empty) implementation directly into the
147 #if defined(GPUOffloadingOMP)
148 #pragma omp declare target
150 static GPUCallableMethod void nonconservativeProduct(
151 const double * __restrict__ Q, // Q[{{NUMBER_OF_UNKNOWNS}}+{{NUMBER_OF_AUXILIARY_VARIABLES}}],
152 const double * __restrict__ deltaQ, // deltaQ[{{NUMBER_OF_UNKNOWNS}}+{{NUMBER_OF_AUXILIARY_VARIABLES}}]
153 const tarch::la::Vector<Dimensions,double>& faceCentre,
154 const tarch::la::Vector<Dimensions,double>& gridCellH,
158 double * __restrict__ BTimesDeltaQ, // BTimesDeltaQ[{{NUMBER_OF_UNKNOWNS}}]
161 //#if defined(GPUOffloadingSYCL)
166 #if defined(GPUOffloadingOMP)
167 #pragma omp end declare target
171 {% if NCP_IMPLEMENTATION!="<none>" %}
172 virtual void nonconservativeProduct(
173 const double * __restrict__ Q, // Q[{{NUMBER_OF_UNKNOWNS}}+{{NUMBER_OF_AUXILIARY_VARIABLES}}],
174 const double * __restrict__ deltaQ, // deltaQ[{{NUMBER_OF_UNKNOWNS}}+{{NUMBER_OF_AUXILIARY_VARIABLES}}]
175 const tarch::la::Vector<Dimensions,double>& faceCentre,
176 const tarch::la::Vector<Dimensions,double>& gridCellH,
180 double * __restrict__ BTimesDeltaQ // BTimesDeltaQ[{{NUMBER_OF_UNKNOWNS}}]
181 ) {% if NCP_IMPLEMENTATION=="<user-defined>" %}=0{% endif %};
185 {% if SOURCE_TERM_IMPLEMENTATION!="<user-defined>" and STATELESS_PDE_TERMS %}
187 * Depending on the implementation, this variant might be slow as it
188 * lacks an inline define. Also, if you don't want to use ipo aggressively,
189 * it might be clever to put the implementation into the header.
193 * At the moment, SYCL seems to struggle with ipo, even if a function is
194 * never called. So I embed the (empty) implementation directly into the
197 #if defined(GPUOffloadingOMP)
198 #pragma omp declare target
200 static GPUCallableMethod void sourceTerm(
201 const double * __restrict__ Q,
202 const tarch::la::Vector<Dimensions,double>& gridCellCentre,
203 const tarch::la::Vector<Dimensions,double>& gridCellH,
206 double * __restrict__ S,
209 //#if defined(GPUOffloadingSYCL)
214 #if defined(GPUOffloadingOMP)
215 #pragma omp end declare target
219 {% if SOURCE_TERM_IMPLEMENTATION!="<none>" %}
220 virtual void sourceTerm(
221 const double * __restrict__ Q,
222 const tarch::la::Vector<Dimensions,double>& gridCellCentre,
223 const tarch::la::Vector<Dimensions,double>& gridCellH,
226 double * __restrict__ S
227 ) {% if SOURCE_TERM_IMPLEMENTATION=="<user-defined>" %}= 0{% else %} final {% endif %};
230""", undefined=jinja2.DebugUndefined)
233 d[
"FLUX_IMPLEMENTATION"] = flux_implementation
234 d[
"NCP_IMPLEMENTATION"] = ncp_implementation
235 d[
"EIGENVALUES_IMPLEMENTATION"] = eigenvalues_implementation
236 d[
"SOURCE_TERM_IMPLEMENTATION"] = source_term_implementation
237 d[
"STATELESS_PDE_TERMS"] = pde_terms_without_state
238 return Template.render(**d)
242 Template = jinja2.Template(
"""
243{% if EIGENVALUES_IMPLEMENTATION!="<user-defined>" and EIGENVALUES_IMPLEMENTATION!="<none>" %}
244void {{FULL_QUALIFIED_NAMESPACE}}::{{CLASSNAME}}::maxEigenvalue(
245 const double * __restrict__ Q, // Q[{{NUMBER_OF_UNKNOWNS}}+{{NUMBER_OF_AUXILIARY_VARIABLES}}],
246 const tarch::la::Vector<Dimensions,double>& faceCentre,
247 const tarch::la::Vector<Dimensions,double>& gridCellH,
251 double* __restrict__ maxEigenvalue
253 {{EIGENVALUES_IMPLEMENTATION}}
258{% if FLUX_IMPLEMENTATION!="<none>" and FLUX_IMPLEMENTATION!="<user-defined>" %}
259void {{FULL_QUALIFIED_NAMESPACE}}::{{CLASSNAME}}::flux(
260 const double * __restrict__ Q, // Q[{{NUMBER_OF_UNKNOWNS}}+{{NUMBER_OF_AUXILIARY_VARIABLES}}],
261 const tarch::la::Vector<Dimensions,double>& faceCentre,
262 const tarch::la::Vector<Dimensions,double>& gridCellH,
266 double * __restrict__ F // F[{{NUMBER_OF_UNKNOWNS}}]
268 {{FLUX_IMPLEMENTATION}}
273{% if NCP_IMPLEMENTATION!="<none>" and NCP_IMPLEMENTATION!="<user-defined>" %}
274void {{FULL_QUALIFIED_NAMESPACE}}::{{CLASSNAME}}::nonconservativeProduct(
275 const double * __restrict__ Q, // Q[{{NUMBER_OF_UNKNOWNS}}+{{NUMBER_OF_AUXILIARY_VARIABLES}}],
276 const double * __restrict__ deltaQ, // deltaQ[{{NUMBER_OF_UNKNOWNS}}+{{NUMBER_OF_AUXILIARY_VARIABLES}}]
277 const tarch::la::Vector<Dimensions,double>& faceCentre,
278 const tarch::la::Vector<Dimensions,double>& gridCellH,
282 double * __restrict__ BTimesDeltaQ // BTimesDeltaQ[{{NUMBER_OF_UNKNOWNS}}]
284 {{NCP_IMPLEMENTATION}}
289{% if SOURCE_TERM_IMPLEMENTATION!="<user-defined>" and SOURCE_TERM_IMPLEMENTATION!="<none>" %}
290//#if !defined(GPUOffloadingSYCL)
291void {{FULL_QUALIFIED_NAMESPACE}}::{{CLASSNAME}}::sourceTerm(
292 const double * __restrict__ Q,
293 const tarch::la::Vector<Dimensions,double>& gridCellCentre,
294 const tarch::la::Vector<Dimensions,double>& gridCellH,
297 double * __restrict__ S
299 {% if SOURCE_TERM_IMPLEMENTATION!="<empty>" %}
300 {{SOURCE_TERM_IMPLEMENTATION}}
302 std::fill_n(S,{{NUMBER_OF_UNKNOWNS}},0.0);
310{% if EIGENVALUES_IMPLEMENTATION!="<user-defined>" and STATELESS_PDE_TERMS %}
311#if defined(GPUOffloadingOMP)
312#pragma omp declare target
314//#if !defined(GPUOffloadingSYCL)
315GPUCallableMethod void {{FULL_QUALIFIED_NAMESPACE}}::{{CLASSNAME}}::maxEigenvalue(
316 const double * __restrict__ Q, // Q[{{NUMBER_OF_UNKNOWNS}}+{{NUMBER_OF_AUXILIARY_VARIABLES}}],
317 const tarch::la::Vector<Dimensions,double>& faceCentre,
318 const tarch::la::Vector<Dimensions,double>& gridCellH,
322 double* __restrict__ maxEigenvalue,
325 {{EIGENVALUES_IMPLEMENTATION}};
328#if defined(GPUOffloadingOMP)
329#pragma omp end declare target
334{% if FLUX_IMPLEMENTATION!="<user-defined>" and STATELESS_PDE_TERMS %}
335#if defined(GPUOffloadingOMP)
336#pragma omp declare target
338//#if !defined(GPUOffloadingSYCL)
339GPUCallableMethod void {{FULL_QUALIFIED_NAMESPACE}}::{{CLASSNAME}}::flux(
340 const double * __restrict__ Q, // Q[{{NUMBER_OF_UNKNOWNS}}+{{NUMBER_OF_AUXILIARY_VARIABLES}}],
341 const tarch::la::Vector<Dimensions,double>& faceCentre,
342 const tarch::la::Vector<Dimensions,double>& gridCellH,
346 double * __restrict__ F, // F[{{NUMBER_OF_UNKNOWNS}}]
349 {% if FLUX_IMPLEMENTATION=="<none>" %}
352 {{FLUX_IMPLEMENTATION}}
356#if defined(GPUOffloadingOMP)
357#pragma omp end declare target
362{% if NCP_IMPLEMENTATION!="<user-defined>" and STATELESS_PDE_TERMS %}
363#if defined(GPUOffloadingOMP)
364#pragma omp declare target
366//#if !defined(GPUOffloadingSYCL)
367GPUCallableMethod void {{FULL_QUALIFIED_NAMESPACE}}::{{CLASSNAME}}::nonconservativeProduct(
368 const double * __restrict__ Q, // Q[{{NUMBER_OF_UNKNOWNS}}+{{NUMBER_OF_AUXILIARY_VARIABLES}}],
369 const double * __restrict__ deltaQ, // deltaQ[{{NUMBER_OF_UNKNOWNS}}+{{NUMBER_OF_AUXILIARY_VARIABLES}}]
370 const tarch::la::Vector<Dimensions,double>& faceCentre,
371 const tarch::la::Vector<Dimensions,double>& gridCellH,
375 double * __restrict__ BTimesDeltaQ, // BTimesDeltaQ[{{NUMBER_OF_UNKNOWNS}}]
378 {% if NCP_IMPLEMENTATION=="<none>" %}
381 {{NCP_IMPLEMENTATION}}
385#if defined(GPUOffloadingOMP)
386#pragma omp end declare target
391{% if SOURCE_TERM_IMPLEMENTATION!="<user-defined>" and STATELESS_PDE_TERMS %}
392#if defined(GPUOffloadingOMP)
393#pragma omp declare target
395//#if !defined(GPUOffloadingSYCL)
396GPUCallableMethod void {{FULL_QUALIFIED_NAMESPACE}}::{{CLASSNAME}}::sourceTerm(
397 const double * __restrict__ Q,
398 const tarch::la::Vector<Dimensions,double>& gridCellCentre,
399 const tarch::la::Vector<Dimensions,double>& gridCellH,
402 double * __restrict__ S,
405 {% if SOURCE_TERM_IMPLEMENTATION=="<none>" %}
408 {{SOURCE_TERM_IMPLEMENTATION}}
412#if defined(GPUOffloadingOMP)
413#pragma omp end declare target
416""", undefined=jinja2.DebugUndefined)
419 d[
"FLUX_IMPLEMENTATION"] = flux_implementation
420 d[
"NCP_IMPLEMENTATION"] = ncp_implementation
421 d[
"EIGENVALUES_IMPLEMENTATION"] = eigenvalues_implementation
422 d[
"SOURCE_TERM_IMPLEMENTATION"] = source_term_implementation
423 d[
"STATELESS_PDE_TERMS"] = pde_terms_without_state
424 return Template.render(**d)
427def create_solver_declarations(flux_implementation, ncp_implementation, eigenvalues_implementation, source_term_implementation, pde_terms_without_state):
428 Template = jinja2.Template(
"""
430 {% if SOURCE_TERM_IMPLEMENTATION=="<user-defined>" %}
431 virtual void sourceTerm(
432 const double * __restrict__ Q,
433 const tarch::la::Vector<Dimensions,double>& gridCellCentre,
434 const tarch::la::Vector<Dimensions,double>& gridCellH,
437 double * __restrict__ S
441 {% if EIGENVALUES_IMPLEMENTATION=="<user-defined>" %}
443 * Determine max eigenvalue over Jacobian in a given point with solution values
444 * (states) Q. All parameters are in.
446 * @return Max eigenvalue. Result has to be positive, so we are actually speaking
447 * about the maximum absolute eigenvalue.
449 virtual void maxEigenvalue(
450 const double * __restrict__ Q, // Q[{{NUMBER_OF_UNKNOWNS}}+{{NUMBER_OF_AUXILIARY_VARIABLES}}],
451 const tarch::la::Vector<Dimensions,double>& faceCentre,
452 const tarch::la::Vector<Dimensions,double>& gridCellH,
456 double* __restrict__ maxEigenvalue
461 {% if FLUX_IMPLEMENTATION=="<user-defined>" %}
463 const double * __restrict__ Q, // Q[{{NUMBER_OF_UNKNOWNS}}+{{NUMBER_OF_AUXILIARY_VARIABLES}}],
464 const tarch::la::Vector<Dimensions,double>& faceCentre,
465 const tarch::la::Vector<Dimensions,double>& gridCellH,
469 double * __restrict__ F // F[{{NUMBER_OF_UNKNOWNS}}]
474 {% if NCP_IMPLEMENTATION=="<user-defined>" %}
475 virtual void nonconservativeProduct(
476 const double * __restrict__ Q, // Q[{{NUMBER_OF_UNKNOWNS}}+{{NUMBER_OF_AUXILIARY_VARIABLES}}],
477 const double * __restrict__ deltaQ, // deltaQ[{{NUMBER_OF_UNKNOWNS}}+{{NUMBER_OF_AUXILIARY_VARIABLES}}]
478 const tarch::la::Vector<Dimensions,double>& faceCentre,
479 const tarch::la::Vector<Dimensions,double>& gridCellH,
483 double * __restrict__ BTimesDeltaQ // BTimesDeltaQ[{{NUMBER_OF_UNKNOWNS}}]
488 {% if STATELESS_PDE_TERMS and SOURCE_TERM_IMPLEMENTATION=="<user-defined>" %}
490 * To obtain the best performance, I recommend to man inline command to
491 * this signature and to copy the implementation into the header. So it would
494 * static inline void sourceTerm( ... ) {
498 * The GPU offloading requires static functions. As we cannot overload the
499 * original (virtual) function with a static alternative, we do the
500 * TBB trick and overload by adding an additional enum. It has no semantics
501 * but helps the compiler to distinguish the different function variants.
503 #if defined(GPUOffloadingOMP)
504 #pragma omp declare target
506 static GPUCallableMethod void sourceTerm(
507 const double * __restrict__ Q,
508 const tarch::la::Vector<Dimensions,double>& gridCellCentre,
509 const tarch::la::Vector<Dimensions,double>& gridCellH,
512 double * __restrict__ S,
515 #if defined(GPUOffloadingOMP)
516 #pragma omp end declare target
521 {% if EIGENVALUES_IMPLEMENTATION=="<user-defined>" and STATELESS_PDE_TERMS %}
523 * To obtain the best performance, I recommend to man inline command to
524 * this signature and to copy the implementation into the header. So it would
527 * static inline double maxEigenvalue( ... ) {
531 * The GPU offloading requires static functions. As we cannot overload the
532 * original (virtual) function with a static alternative, we do the
533 * TBB trick and overload by adding an additional enum. It has no semantics
534 * but helps the compiler to distinguish the different function variants.
536 #if defined(GPUOffloadingOMP)
537 #pragma omp declare target
539 static GPUCallableMethod void maxEigenvalue(
540 const double * __restrict__ Q, // Q[{{NUMBER_OF_UNKNOWNS}}+{{NUMBER_OF_AUXILIARY_VARIABLES}}],
541 const tarch::la::Vector<Dimensions,double>& faceCentre,
542 const tarch::la::Vector<Dimensions,double>& gridCellH,
545 double* __restrict__ maxEigenvalue
548 #if defined(GPUOffloadingOMP)
549 #pragma omp end declare target
554 {% if STATELESS_PDE_TERMS and FLUX_IMPLEMENTATION=="<user-defined>" %}
556 * To obtain the best performance, I recommend to man inline command to
557 * this signature and to copy the implementation into the header. So it would
560 * static inline void flux( ... ) {
564 * The GPU offloading requires static functions. As we cannot overload the
565 * original (virtual) function with a static alternative, we do the
566 * TBB trick and overload by adding an additional enum. It has no semantics
567 * but helps the compiler to distinguish the different function variants.
569 #if defined(GPUOffloadingOMP)
570 #pragma omp declare target
572 static GPUCallableMethod void flux(
573 const double * __restrict__ Q, // Q[{{NUMBER_OF_UNKNOWNS}}+{{NUMBER_OF_AUXILIARY_VARIABLES}}],
574 const tarch::la::Vector<Dimensions,double>& faceCentre,
575 const tarch::la::Vector<Dimensions,double>& gridCellH,
579 double * __restrict__ F, // F[{{NUMBER_OF_UNKNOWNS}}]
582 #if defined(GPUOffloadingOMP)
583 #pragma omp end declare target
588 {% if STATELESS_PDE_TERMS and NCP_IMPLEMENTATION=="<user-defined>" %}
590 * To obtain the best performance, I recommend to man inline command to
591 * this signature and to copy the implementation into the header. So it would
594 * static inline void nonconservativeProduct( ... ) {
598 * The GPU offloading requires static functions. As we cannot overload the
599 * original (virtual) function with a static alternative, we do the
600 * TBB trick and overload by adding an additional enum. It has no semantics
601 * but helps the compiler to distinguish the different function variants.
603 #if defined(GPUOffloadingOMP)
604 #pragma omp declare target
606 static GPUCallableMethod void nonconservativeProduct(
607 const double * __restrict__ Q,
608 const double * __restrict__ deltaQ,
609 const tarch::la::Vector<Dimensions,double>& faceCentre,
610 const tarch::la::Vector<Dimensions,double>& gridCellH,
614 double * __restrict__ BTimesDeltaQ,
617 #if defined(GPUOffloadingOMP)
618 #pragma omp end declare target
621""", undefined=jinja2.DebugUndefined)
623 d[
"FLUX_IMPLEMENTATION"] = flux_implementation
624 d[
"NCP_IMPLEMENTATION"] = ncp_implementation
625 d[
"EIGENVALUES_IMPLEMENTATION"] = eigenvalues_implementation
626 d[
"SOURCE_TERM_IMPLEMENTATION"] = source_term_implementation
627 d[
"STATELESS_PDE_TERMS"] = pde_terms_without_state
628 return Template.render(**d)
631def create_solver_definitions(flux_implementation, ncp_implementation, eigenvalues_implementation, source_term_implementation, pde_terms_without_state):
632 Template = jinja2.Template(
"""
633{% if EIGENVALUES_IMPLEMENTATION=="<user-defined>" %}
634void {{FULL_QUALIFIED_NAMESPACE}}::{{CLASSNAME}}::maxEigenvalue(
635 const double * __restrict__ Q, // Q[{{NUMBER_OF_UNKNOWNS}}+{{NUMBER_OF_AUXILIARY_VARIABLES}}],
636 const tarch::la::Vector<Dimensions,double>& faceCentre,
637 const tarch::la::Vector<Dimensions,double>& gridCellH,
641 double* __restrict__ maxEigenvalue
643 logTraceInWith4Arguments( "maxEigenvalue(...)", faceCentre, gridCellH, t, normal );
645 logTraceOut( "maxEigenvalue(...)" );
650{% if FLUX_IMPLEMENTATION=="<user-defined>" %}
651void {{FULL_QUALIFIED_NAMESPACE}}::{{CLASSNAME}}::flux(
652 const double * __restrict__ Q, // Q[{{NUMBER_OF_UNKNOWNS}}+{{NUMBER_OF_AUXILIARY_VARIABLES}}],
653 const tarch::la::Vector<Dimensions,double>& faceCentre,
654 const tarch::la::Vector<Dimensions,double>& gridCellH,
658 double * __restrict__ F // F[{{NUMBER_OF_UNKNOWNS}}]
660 logTraceInWith4Arguments( "flux(...)", faceCentre, gridCellH, t, normal );
662 logTraceOut( "flux(...)" );
667{% if NCP_IMPLEMENTATION=="<user-defined>" %}
668void {{FULL_QUALIFIED_NAMESPACE}}::{{CLASSNAME}}::nonconservativeProduct(
669 const double * __restrict__ Q, // Q[{{NUMBER_OF_UNKNOWNS}}+{{NUMBER_OF_AUXILIARY_VARIABLES}}],
670 const double * __restrict__ deltaQ, // deltaQ[{{NUMBER_OF_UNKNOWNS}}+{{NUMBER_OF_AUXILIARY_VARIABLES}}]
671 const tarch::la::Vector<Dimensions,double>& faceCentre,
672 const tarch::la::Vector<Dimensions,double>& gridCellH,
676 double * __restrict__ BTimesDeltaQ // BTimesDeltaQQ[{{NUMBER_OF_UNKNOWNS}}]
678 logTraceInWith4Arguments( "nonconservativeProduct(...)", faceCentre, gridCellH, t, normal );
680 logTraceOut( "nonconservativeProduct(...)" );
685{% if SOURCE_TERM_IMPLEMENTATION=="<user-defined>" %}
686void {{FULL_QUALIFIED_NAMESPACE}}::{{CLASSNAME}}::sourceTerm(
687 const double * __restrict__ Q, // Q[{{NUMBER_OF_UNKNOWNS}}+{{NUMBER_OF_AUXILIARY_VARIABLES}}]
688 const tarch::la::Vector<Dimensions,double>& gridCellX,
689 const tarch::la::Vector<Dimensions,double>& gridCellH,
692 double * __restrict__ S // S[{{NUMBER_OF_UNKNOWNS}}]
694 logTraceInWith4Arguments( "sourceTerm(...)", gridCellX, gridCellH, t, dt );
696 // @todo implement and ensure that all entries of S are properly set
697 for (int i=0; i<NumberOfUnknowns; i++) {
701 logTraceOut( "sourceTerm(...)" );
709{% if EIGENVALUES_IMPLEMENTATION=="<user-defined>" and STATELESS_PDE_TERMS %}
710 #if defined(GPUOffloadingOMP)
711 #pragma omp declare target
713GPUCallableMethod void {{FULL_QUALIFIED_NAMESPACE}}::{{CLASSNAME}}::maxEigenvalue(
714 const double * __restrict__ Q, // Q[{{NUMBER_OF_UNKNOWNS}}+{{NUMBER_OF_AUXILIARY_VARIABLES}}],
715 const tarch::la::Vector<Dimensions,double>& faceCentre,
716 const tarch::la::Vector<Dimensions,double>& gridCellH,
719 double* __restrict__ maxEigenvalue,
724 #if defined(GPUOffloadingOMP)
725 #pragma omp end declare target
730{% if FLUX_IMPLEMENTATION=="<user-defined>" and STATELESS_PDE_TERMS %}
731 #if defined(GPUOffloadingOMP)
732 #pragma omp declare target
734GPUCallableMethod void {{FULL_QUALIFIED_NAMESPACE}}::{{CLASSNAME}}::flux(
735 const double * __restrict__ Q, // Q[{{NUMBER_OF_UNKNOWNS}}+{{NUMBER_OF_AUXILIARY_VARIABLES}}],
736 const tarch::la::Vector<Dimensions,double>& faceCentre,
737 const tarch::la::Vector<Dimensions,double>& gridCellH,
741 double * __restrict__ F,
746 #if defined(GPUOffloadingOMP)
747 #pragma omp end declare target
752{% if NCP_IMPLEMENTATION=="<user-defined>" and STATELESS_PDE_TERMS %}
753 #if defined(GPUOffloadingOMP)
754 #pragma omp declare target
756GPUCallableMethod void {{FULL_QUALIFIED_NAMESPACE}}::{{CLASSNAME}}::nonconservativeProduct(
757 const double * __restrict__ Q, // Q[{{NUMBER_OF_UNKNOWNS}}+{{NUMBER_OF_AUXILIARY_VARIABLES}}],
758 const double * __restrict__ deltaQ, // deltaQ[{{NUMBER_OF_UNKNOWNS}}+{{NUMBER_OF_AUXILIARY_VARIABLES}}]
759 const tarch::la::Vector<Dimensions,double>& faceCentre,
760 const tarch::la::Vector<Dimensions,double>& gridCellH,
764 double * __restrict__ BTimesDeltaQ,
769 #if defined(GPUOffloadingOMP)
770 #pragma omp end declare target
776{% if SOURCE_TERM_IMPLEMENTATION=="<user-defined>" and STATELESS_PDE_TERMS %}
777 #if defined(GPUOffloadingOMP)
778 #pragma omp declare target
780GPUCallableMethod void {{FULL_QUALIFIED_NAMESPACE}}::{{CLASSNAME}}::sourceTerm(
781 const double * __restrict__ Q,
782 const tarch::la::Vector<Dimensions,double>& gridCellCentre,
783 const tarch::la::Vector<Dimensions,double>& gridCellH,
786 double * __restrict__ S,
791 #if defined(GPUOffloadingOMP)
792 #pragma omp end declare target
797""", undefined=jinja2.DebugUndefined)
799 d[
"FLUX_IMPLEMENTATION"] = flux_implementation
800 d[
"NCP_IMPLEMENTATION"] = ncp_implementation
801 d[
"EIGENVALUES_IMPLEMENTATION"] = eigenvalues_implementation
802 d[
"SOURCE_TERM_IMPLEMENTATION"] = source_term_implementation
803 d[
"STATELESS_PDE_TERMS"] = pde_terms_without_state
804 return Template.render(**d)
create_abstract_solver_declarations(flux_implementation, ncp_implementation, eigenvalues_implementation, source_term_implementation, pde_terms_without_state)
create_solver_declarations(flux_implementation, ncp_implementation, eigenvalues_implementation, source_term_implementation, pde_terms_without_state)
create_abstract_solver_definitions(flux_implementation, ncp_implementation, eigenvalues_implementation, source_term_implementation, pde_terms_without_state)
create_solver_definitions(flux_implementation, ncp_implementation, eigenvalues_implementation, source_term_implementation, pde_terms_without_state)