diff --git a/python/dune/codegen/pdelab/driver/gridoperator.py b/python/dune/codegen/pdelab/driver/gridoperator.py index abc878f0715dbcb4a0501d56247c4f03c98f20df..bdf8b2f6245acb63b2a67c518ab98fef597672af 100644 --- a/python/dune/codegen/pdelab/driver/gridoperator.py +++ b/python/dune/codegen/pdelab/driver/gridoperator.py @@ -77,8 +77,7 @@ def typedef_localoperator(name, form_ident): filename = get_form_option("filename", form_ident) include_file(filename, filetag="driver") lopname = localoperator_basename(form_ident) - range_type = type_range() - return "using {} = {}<{}, {}, {}>;".format(name, lopname, ugfs, vgfs, range_type) + return "using {} = {}<{}, {}>;".format(name, lopname, ugfs, vgfs) def type_localoperator(form_ident): diff --git a/python/dune/codegen/pdelab/geometry.py b/python/dune/codegen/pdelab/geometry.py index b9d5b0d03e9c137c30fa49bfefee18d835e7f003..da5c7b395f151cb6e3f25c734243a6732c2a95fc 100644 --- a/python/dune/codegen/pdelab/geometry.py +++ b/python/dune/codegen/pdelab/geometry.py @@ -269,9 +269,9 @@ class EquidistantGeometryMixin(AxiparallelGeometryMixin): @preamble(kernel="operator") def _define_jacobian_determinant_eval(self, name): - from dune.codegen.pdelab.localoperator import name_ansatz_gfs_constructor_param, lop_template_range_field + from dune.codegen.pdelab.localoperator import name_ansatz_gfs_constructor_param gfs = name_ansatz_gfs_constructor_param() - rft = lop_template_range_field() + rft = type_floatingpoint() return "{} = {}.gridView().template begin<0>()->geometry().integrationElement(Dune::FieldVector<{}, {}>());".format(name, gfs, rft, world_dimension()) def define_jacobian_inverse_transposed(self, name, restriction): @@ -289,9 +289,9 @@ class EquidistantGeometryMixin(AxiparallelGeometryMixin): @preamble(kernel="operator") def _define_jacobian_inverse_transposed_eval(self, name): - from dune.codegen.pdelab.localoperator import name_ansatz_gfs_constructor_param, lop_template_range_field + from dune.codegen.pdelab.localoperator import name_ansatz_gfs_constructor_param gfs = name_ansatz_gfs_constructor_param() - rft = lop_template_range_field() + rft = type_floatingpoint() return "{} = {}.gridView().template begin<0>()->geometry().jacobianInverseTransposed(Dune::FieldVector<{}, {}>());".format(name, gfs, rft, world_dimension()) diff --git a/python/dune/codegen/pdelab/localoperator.py b/python/dune/codegen/pdelab/localoperator.py index 0ca6bfb45ed80271af92800980df7405200dca8b..152eadd5968ea9adc9673da118f6a25c03761906 100644 --- a/python/dune/codegen/pdelab/localoperator.py +++ b/python/dune/codegen/pdelab/localoperator.py @@ -38,6 +38,7 @@ from dune.codegen.cgen.clazz import (AccessModifier, BaseClass, ClassMember, ) +from dune.codegen.loopy.target import type_floatingpoint from dune.codegen.ufl.modified_terminals import Restriction import dune.codegen.loopy.mangler @@ -73,11 +74,6 @@ def name_test_gfs_constructor_param(): return "gfsv" -@template_parameter(classtag="operator") -def lop_template_range_field(): - return "RF" - - @class_member(classtag="operator") def lop_domain_field(name): # TODO: Rethink for not Galerkin Method @@ -857,7 +853,6 @@ def local_operator_default_settings(operator, form): localoperator_basename(operator) lop_template_ansatz_gfs() lop_template_test_gfs() - lop_template_range_field() # Make sure there is always the same constructor arguments, even if some of them are # not strictly needed. Also ensure the order. @@ -871,7 +866,7 @@ def local_operator_default_settings(operator, form): base_class('Dune::PDELab::LocalOperatorDefaultFlags', classtag="operator") from dune.codegen.pdelab.driver import is_stationary if not is_stationary(): - rf = lop_template_range_field() + rf = type_floatingpoint() base_class('Dune::PDELab::InstationaryLocalOperatorDefaultMethods<{}>' .format(rf), classtag="operator") diff --git a/python/dune/codegen/pdelab/quadrature.py b/python/dune/codegen/pdelab/quadrature.py index ae6a7e2db7212b254e3857bc86813ea420ed0251..ccfb9f9c1a42888923eb07b753a013705190df01 100644 --- a/python/dune/codegen/pdelab/quadrature.py +++ b/python/dune/codegen/pdelab/quadrature.py @@ -12,7 +12,8 @@ from dune.codegen.generation import (class_member, temporary_variable, valuearg, ) -from dune.codegen.pdelab.localoperator import lop_template_range_field, name_ansatz_gfs_constructor_param +from dune.codegen.loopy.target import type_floatingpoint +from dune.codegen.pdelab.localoperator import name_ansatz_gfs_constructor_param from dune.codegen.options import get_form_option from pymbolic.primitives import Variable, Subscript @@ -51,7 +52,7 @@ class GenericQuadratureMixin(QuadratureMixinBase): @class_member(classtag="operator") def define_quadrature_weights(self, name): - rf = lop_template_range_field() + rf = type_floatingpoint() from dune.codegen.pdelab.geometry import local_dimension dim = local_dimension() self.eval_quadrature_weights(name) @@ -89,7 +90,7 @@ class GenericQuadratureMixin(QuadratureMixinBase): @class_member(classtag="operator") def define_quadrature_points(self, name): - rf = lop_template_range_field() + rf = type_floatingpoint() from dune.codegen.pdelab.geometry import local_dimension dim = local_dimension() self.eval_quadrature_points(name) diff --git a/python/dune/codegen/sumfact/geometry.py b/python/dune/codegen/sumfact/geometry.py index 8ac8aaa4faa1a4849c3b88fb54f87b0f87ca7b2b..573d6ff932f068321701ea764cd43c3e87ba48eb 100644 --- a/python/dune/codegen/sumfact/geometry.py +++ b/python/dune/codegen/sumfact/geometry.py @@ -16,6 +16,7 @@ from dune.codegen.generation import (class_member, valuearg, ) from dune.codegen.loopy.flatten import flatten_index +from dune.codegen.loopy.target import type_floatingpoint from dune.codegen.options import get_option from dune.codegen.pdelab.geometry import (enforce_boundary_restriction, local_dimension, @@ -28,7 +29,6 @@ from dune.codegen.pdelab.geometry import (enforce_boundary_restriction, ) from dune.codegen.pdelab.localoperator import (name_ansatz_gfs_constructor_param, lop_template_ansatz_gfs, - lop_template_range_field, ) from dune.codegen.pdelab.restriction import restricted_name from dune.codegen.sumfact.accumulation import basis_sf_kernels, sumfact_iname @@ -283,7 +283,7 @@ class SumfactEqudistantGeometryMixin(EquidistantGeometryMixin, SumfactAxiParalle @kernel_cached(kernel="operator") def _define_facet_jacobian_determinant_eval(self, name): gfs = name_ansatz_gfs_constructor_param() - rft = lop_template_range_field() + rft = type_floatingpoint() code = ["{", " auto e = *({}.gridView().template begin<0>());".format(gfs), " int dir=0;", @@ -483,8 +483,7 @@ def define_corner(name, low): @class_member(classtag="operator") def define_mesh_width(name): - from dune.codegen.pdelab.localoperator import lop_template_range_field - rft = lop_template_range_field() + rft = type_floatingpoint() define_mesh_width_eval(name) return "Dune::FieldVector<{}, {}> {};".format(rft, world_dimension(), name) diff --git a/python/dune/codegen/sumfact/tabulation.py b/python/dune/codegen/sumfact/tabulation.py index e2e4a771ec9918f960e5ea88821aa7acb885a0c2..0170c59463eed570fcce679636899e0d633d32fe 100644 --- a/python/dune/codegen/sumfact/tabulation.py +++ b/python/dune/codegen/sumfact/tabulation.py @@ -18,12 +18,10 @@ from dune.codegen.generation import (class_member, transform, valuearg ) -from dune.codegen.loopy.target import dtype_floatingpoint +from dune.codegen.loopy.target import dtype_floatingpoint, type_floatingpoint from dune.codegen.loopy.vcl import ExplicitVCLCast, get_vcl_type_size from dune.codegen.options import get_option -from dune.codegen.pdelab.localoperator import (name_domain_field, - lop_template_range_field, - ) +from dune.codegen.pdelab.localoperator import name_domain_field from dune.codegen.pdelab.quadrature import quadrature_order from dune.codegen.tools import maybe_wrap_subscript, ceildiv from loopy import CallMangleInfo @@ -345,7 +343,7 @@ def name_oned_quadrature_points(bound): @class_member(classtag="operator") def typedef_polynomials(name, degree): - range_field = lop_template_range_field() + range_field = type_floatingpoint() domain_field = name_domain_field() include_file("dune/pdelab/finiteelementmap/qkdg.hh", filetag="operatorfile") @@ -380,7 +378,7 @@ def name_polynomials(degree): def sort_quadrature_points_weights(qp, qw, bound): - range_field = lop_template_range_field() + range_field = type_floatingpoint() domain_field = name_domain_field() include_file("dune/codegen/sumfact/onedquadrature.hh", filetag="operatorfile") return frozenset({instruction(code="onedQuadraturePointsWeights<{}, {}, {}>({}, {});" diff --git a/test/adjoint/poisson_mc_driver.hh b/test/adjoint/poisson_mc_driver.hh index 5bd222b800baf36c09bd172c48d706a135912c80..a3ac578afc8d9a2039dd9437ef48fe971a37fcb6 100644 --- a/test/adjoint/poisson_mc_driver.hh +++ b/test/adjoint/poisson_mc_driver.hh @@ -60,7 +60,7 @@ bool driver(int argc, char** argv){ Dune::PDELab::constraints(p1_bctype, p1_dirichlet_gfs_, p1_dirichlet_gfs__cc); // Set up grid grid operators... - using LOP_R = ROperator<P1_dirichlet_GFS, P1_dirichlet_GFS, RangeType>; + using LOP_R = ROperator<P1_dirichlet_GFS, P1_dirichlet_GFS>; using MatrixBackend = Dune::PDELab::ISTL::BCRSMatrixBackend<>; using GO_r = Dune::PDELab::GridOperator<P1_dirichlet_GFS, P1_dirichlet_GFS, LOP_R, MatrixBackend, DF, RangeType, RangeType, P1_dirichlet_GFS_CC, P1_dirichlet_GFS_CC>; LOP_R lop_r(p1_dirichlet_gfs_, p1_dirichlet_gfs_, initree); @@ -122,7 +122,7 @@ bool driver(int argc, char** argv){ GF_X x_gf(p1_dirichlet_gfs_, x_r); // Local operator for adjoint problem - using LOP_Adjoint = RAdjointOperator<P1_dirichlet_GFS, P1_dirichlet_GFS, RangeType, GF_X>; + using LOP_Adjoint = RAdjointOperator<P1_dirichlet_GFS, P1_dirichlet_GFS, GF_X>; LOP_Adjoint lop_adjoint(p1_dirichlet_gfs_, p1_dirichlet_gfs_, initree, x_gf); // Grid operator for adjoint problem @@ -156,7 +156,7 @@ bool driver(int argc, char** argv){ DJDM dJdm(7,0.0); // Local operator for control problem - using LOP_Control = RControlOperator<P1_dirichlet_GFS, P1_dirichlet_GFS, RangeType, GF_Adjoint, DJDM>; + using LOP_Control = RControlOperator<P1_dirichlet_GFS, P1_dirichlet_GFS, GF_Adjoint, DJDM>; LOP_Control lop_control(p1_dirichlet_gfs_, p1_dirichlet_gfs_, initree, gf_adjoint, dJdm); // Grid operator for control problem diff --git a/test/coeffeval/coeffeval_poisson.cc b/test/coeffeval/coeffeval_poisson.cc index 4f9e8861b5139dacb8183327ad053b3cb2373b8b..f0d645ffb5a4521f80c82684de736412d49f737e 100644 --- a/test/coeffeval/coeffeval_poisson.cc +++ b/test/coeffeval/coeffeval_poisson.cc @@ -74,7 +74,7 @@ int main(int argc, char** argv) GF c_gf(p2_gfs, c); // Local Operator - using LOP_R = PoissonLocalOperator<P1_dirichlet_GFS, P1_dirichlet_GFS, RangeType, GF>; + using LOP_R = PoissonLocalOperator<P1_dirichlet_GFS, P1_dirichlet_GFS, GF>; LOP_R lop_r(p1_dirichlet_gfs_, p1_dirichlet_gfs_, initree, c_gf); // Constraints stuff diff --git a/test/sumfact/poisson/facedir-facemod-variation/poisson_dg_3d_facedir_facemod_variation_driver.cc b/test/sumfact/poisson/facedir-facemod-variation/poisson_dg_3d_facedir_facemod_variation_driver.cc index 2f8cc6c8614e0cdb954a52fa5de808dbff466b07..d9fa57bf0d692186a5761667508f9e7c1b645715 100644 --- a/test/sumfact/poisson/facedir-facemod-variation/poisson_dg_3d_facedir_facemod_variation_driver.cc +++ b/test/sumfact/poisson/facedir-facemod-variation/poisson_dg_3d_facedir_facemod_variation_driver.cc @@ -109,7 +109,7 @@ int main(int argc, char** argv){ Dune::PDELab::constraints(dg1_gfs_, dg1_gfs__cc); // Set up grid grid operators... - using LOP_R = rOperator<DG1_GFS, DG1_GFS, RangeType>; + using LOP_R = rOperator<DG1_GFS, DG1_GFS>; using MatrixBackend = Dune::PDELab::ISTL::BCRSMatrixBackend<>; using GO_r = Dune::PDELab::GridOperator<DG1_GFS, DG1_GFS, LOP_R, MatrixBackend, DF, RangeType, RangeType, DG1_GFS_CC, DG1_GFS_CC>; LOP_R lop_r(dg1_gfs_, dg1_gfs_, initree); diff --git a/test/sumfact/poisson/facedir-facemod-variation/sumfact_poisson_dg_3d_facedir_facemod_variation_driver.cc b/test/sumfact/poisson/facedir-facemod-variation/sumfact_poisson_dg_3d_facedir_facemod_variation_driver.cc index 4b57deaa50bc6e435b40dec8060d55e927797b2a..cc4c1d01d3d6d5bb67f123e98696e7945002dc45 100644 --- a/test/sumfact/poisson/facedir-facemod-variation/sumfact_poisson_dg_3d_facedir_facemod_variation_driver.cc +++ b/test/sumfact/poisson/facedir-facemod-variation/sumfact_poisson_dg_3d_facedir_facemod_variation_driver.cc @@ -251,7 +251,7 @@ int main(int argc, char** argv){ Dune::PDELab::constraints(dg1_gfs_, dg1_gfs__cc); // Set up grid grid operators... - using LOP_R = CLASSNAME<DG1_GFS, DG1_GFS, RangeType>; + using LOP_R = CLASSNAME<DG1_GFS, DG1_GFS>; using MatrixBackend = Dune::PDELab::ISTL::BCRSMatrixBackend<>; using GO_r = Dune::PDELab::GridOperator<DG1_GFS, DG1_GFS, LOP_R, MatrixBackend, DF, RangeType, RangeType, DG1_GFS_CC, DG1_GFS_CC>; LOP_R lop_r(dg1_gfs_, dg1_gfs_, initree); diff --git a/test/sumfact/poisson/facedir-facemod-variation/sumfact_poisson_fastdg_3d_facedir_facemod_variation_driver.cc b/test/sumfact/poisson/facedir-facemod-variation/sumfact_poisson_fastdg_3d_facedir_facemod_variation_driver.cc index 90a5c381b538f8c41403161f96ba78a960fe491b..ad75cfc4ed894a45879fd2e078f01fa53aff3b09 100644 --- a/test/sumfact/poisson/facedir-facemod-variation/sumfact_poisson_fastdg_3d_facedir_facemod_variation_driver.cc +++ b/test/sumfact/poisson/facedir-facemod-variation/sumfact_poisson_fastdg_3d_facedir_facemod_variation_driver.cc @@ -225,7 +225,7 @@ int main(int argc, char** argv){ Dune::PDELab::constraints(dg1_gfs_, dg1_gfs__cc); // Set up grid grid operators... - using LOP_R = CLASSNAME<DG1_GFS, DG1_GFS, RangeType>; + using LOP_R = CLASSNAME<DG1_GFS, DG1_GFS>; using MatrixBackend = Dune::PDELab::ISTL::BCRSMatrixBackend<>; using GO_r = Dune::PDELab::FastDGGridOperator<DG1_GFS, DG1_GFS, LOP_R, MatrixBackend, DF, RangeType, RangeType, DG1_GFS_CC, DG1_GFS_CC>; LOP_R lop_r(dg1_gfs_, dg1_gfs_, initree); diff --git a/test/sumfact/preconditioner/test_preconditioner_2d.cc b/test/sumfact/preconditioner/test_preconditioner_2d.cc index 2781b32399f800d1d6334565aefbede360fdbfa9..3e8fcfc117288feba4d5bd76abb5ca548e18f649 100644 --- a/test/sumfact/preconditioner/test_preconditioner_2d.cc +++ b/test/sumfact/preconditioner/test_preconditioner_2d.cc @@ -56,7 +56,7 @@ int main(int argc, char** argv){ Dune::PDELab::constraints(dg2_gfs_, dg2_gfs__cc); // Set up grid grid operators... - using FullLOP = FullOperator<DG2_GFS, DG2_GFS, RangeType>; + using FullLOP = FullOperator<DG2_GFS, DG2_GFS>; using MatrixBackend = Dune::PDELab::ISTL::BCRSMatrixBackend<>; using FullGO = Dune::PDELab::FastDGGridOperator<DG2_GFS, DG2_GFS, FullLOP, MatrixBackend, DF, RangeType, RangeType, DG2_GFS_CC, DG2_GFS_CC>; FullLOP fulllop(dg2_gfs_, dg2_gfs_, initree); @@ -65,17 +65,17 @@ int main(int argc, char** argv){ FullGO fullgo(dg2_gfs_, dg2_gfs__cc, dg2_gfs_, dg2_gfs__cc, fulllop, mb); // Additional grid operators for preconditioner - using BDLOP = BlockDiagonalOperator<DG2_GFS, DG2_GFS, RangeType>; + using BDLOP = BlockDiagonalOperator<DG2_GFS, DG2_GFS>; using BDGO = Dune::PDELab::FastDGGridOperator<DG2_GFS, DG2_GFS, BDLOP, MatrixBackend, DF, RangeType, RangeType, DG2_GFS_CC, DG2_GFS_CC>; BDLOP bdlop(dg2_gfs_, dg2_gfs_, initree); BDGO bdgo(dg2_gfs_, dg2_gfs__cc, dg2_gfs_, dg2_gfs__cc, bdlop, mb); - using BODLOP = BlockOffDiagonalOperator<DG2_GFS, DG2_GFS, RangeType>; + using BODLOP = BlockOffDiagonalOperator<DG2_GFS, DG2_GFS>; using BODGO = Dune::PDELab::FastDGGridOperator<DG2_GFS, DG2_GFS, BODLOP, MatrixBackend, DF, RangeType, RangeType, DG2_GFS_CC, DG2_GFS_CC>; BODLOP bodlop(dg2_gfs_, dg2_gfs_, initree); BODGO bodgo(dg2_gfs_, dg2_gfs__cc, dg2_gfs_, dg2_gfs__cc, bodlop, mb); - using PDLOP = PointDiagonalOperator<DG2_GFS, DG2_GFS, RangeType>; + using PDLOP = PointDiagonalOperator<DG2_GFS, DG2_GFS>; using PDGO = Dune::PDELab::FastDGGridOperator<DG2_GFS, DG2_GFS, PDLOP, MatrixBackend, DF, RangeType, RangeType, DG2_GFS_CC, DG2_GFS_CC>; PDLOP pdlop(dg2_gfs_, dg2_gfs_, initree); PDGO pdgo(dg2_gfs_, dg2_gfs__cc, dg2_gfs_, dg2_gfs__cc, pdlop, mb); diff --git a/test/sumfact/preconditioner/test_preconditioner_3d.cc b/test/sumfact/preconditioner/test_preconditioner_3d.cc index ec84a1efbf7e19f46d8531622374f2902a3139eb..90ea7aee7def84e9fc2395a798ace1bc39018f7d 100644 --- a/test/sumfact/preconditioner/test_preconditioner_3d.cc +++ b/test/sumfact/preconditioner/test_preconditioner_3d.cc @@ -56,7 +56,7 @@ int main(int argc, char** argv){ Dune::PDELab::constraints(dg2_gfs_, dg2_gfs__cc); // Set up grid grid operators... - using FullLOP = FullOperator<DG2_GFS, DG2_GFS, RangeType>; + using FullLOP = FullOperator<DG2_GFS, DG2_GFS>; using MatrixBackend = Dune::PDELab::ISTL::BCRSMatrixBackend<>; using FullGO = Dune::PDELab::FastDGGridOperator<DG2_GFS, DG2_GFS, FullLOP, MatrixBackend, DF, RangeType, RangeType, DG2_GFS_CC, DG2_GFS_CC>; FullLOP fulllop(dg2_gfs_, dg2_gfs_, initree); @@ -65,17 +65,17 @@ int main(int argc, char** argv){ FullGO fullgo(dg2_gfs_, dg2_gfs__cc, dg2_gfs_, dg2_gfs__cc, fulllop, mb); // Additional grid operators for preconditioner - using BDLOP = BlockDiagonalOperator<DG2_GFS, DG2_GFS, RangeType>; + using BDLOP = BlockDiagonalOperator<DG2_GFS, DG2_GFS>; using BDGO = Dune::PDELab::FastDGGridOperator<DG2_GFS, DG2_GFS, BDLOP, MatrixBackend, DF, RangeType, RangeType, DG2_GFS_CC, DG2_GFS_CC>; BDLOP bdlop(dg2_gfs_, dg2_gfs_, initree); BDGO bdgo(dg2_gfs_, dg2_gfs__cc, dg2_gfs_, dg2_gfs__cc, bdlop, mb); - using BODLOP = BlockOffDiagonalOperator<DG2_GFS, DG2_GFS, RangeType>; + using BODLOP = BlockOffDiagonalOperator<DG2_GFS, DG2_GFS>; using BODGO = Dune::PDELab::FastDGGridOperator<DG2_GFS, DG2_GFS, BODLOP, MatrixBackend, DF, RangeType, RangeType, DG2_GFS_CC, DG2_GFS_CC>; BODLOP bodlop(dg2_gfs_, dg2_gfs_, initree); BODGO bodgo(dg2_gfs_, dg2_gfs__cc, dg2_gfs_, dg2_gfs__cc, bodlop, mb); - using PDLOP = PointDiagonalOperator<DG2_GFS, DG2_GFS, RangeType>; + using PDLOP = PointDiagonalOperator<DG2_GFS, DG2_GFS>; using PDGO = Dune::PDELab::FastDGGridOperator<DG2_GFS, DG2_GFS, PDLOP, MatrixBackend, DF, RangeType, RangeType, DG2_GFS_CC, DG2_GFS_CC>; PDLOP pdlop(dg2_gfs_, dg2_gfs_, initree); PDGO pdgo(dg2_gfs_, dg2_gfs__cc, dg2_gfs_, dg2_gfs__cc, pdlop, mb);