Skip to content
Snippets Groups Projects
Unverified Commit 352dedab authored by Thomas Baumann's avatar Thomas Baumann Committed by GitHub
Browse files

Refactor for space transfer classes (#517)

parent 913463d4
Branches
Tags
No related merge requests found
...@@ -27,17 +27,17 @@ class SpaceTransfer(object): ...@@ -27,17 +27,17 @@ class SpaceTransfer(object):
coarse_prob (pySDC.Problem.ptype): reference to the coarse problem coarse_prob (pySDC.Problem.ptype): reference to the coarse problem
""" """
def __init__(self, fine_prob, coarse_prob, space_transfer_params): def __init__(self, fine_prob, coarse_prob, params):
""" """
Initialization routine Initialization routine
Args: Args:
fine_prob (pySDC.Problem.ptype): reference to the fine problem fine_prob (pySDC.Problem.ptype): reference to the fine problem
coarse_prob (pySDC.Problem.ptype): reference to the coarse problem coarse_prob (pySDC.Problem.ptype): reference to the coarse problem
space_transfer_params (dict): user-defined parameters params (dict): user-defined parameters
""" """
self.params = _Pars(space_transfer_params) self.params = _Pars(params)
# set up logger # set up logger
self.logger = logging.getLogger('space-transfer') self.logger = logging.getLogger('space-transfer')
......
...@@ -10,21 +10,6 @@ class mesh_to_mesh_fenics(SpaceTransfer): ...@@ -10,21 +10,6 @@ class mesh_to_mesh_fenics(SpaceTransfer):
This implementation can restrict and prolong between fenics meshes This implementation can restrict and prolong between fenics meshes
""" """
def __init__(self, fine_prob, coarse_prob, params):
"""
Initialization routine
Args:
fine_prob: fine problem
coarse_prob: coarse problem
params: parameters for the transfer operators
"""
# invoke super initialization
super(mesh_to_mesh_fenics, self).__init__(fine_prob, coarse_prob, params)
pass
def project(self, F): def project(self, F):
""" """
Restriction implementation via projection Restriction implementation via projection
......
...@@ -5,7 +5,7 @@ from pySDC.implementations.datatype_classes.mesh import mesh, imex_mesh ...@@ -5,7 +5,7 @@ from pySDC.implementations.datatype_classes.mesh import mesh, imex_mesh
class mesh_to_mesh(SpaceTransfer): class mesh_to_mesh(SpaceTransfer):
""" """
Custon base_transfer class, implements Transfer.py Custom base_transfer class, implements Transfer.py
This implementation can restrict and prolong between nd meshes with dirichlet-0 or periodic boundaries This implementation can restrict and prolong between nd meshes with dirichlet-0 or periodic boundaries
via matrix-vector products via matrix-vector products
...@@ -15,18 +15,6 @@ class mesh_to_mesh(SpaceTransfer): ...@@ -15,18 +15,6 @@ class mesh_to_mesh(SpaceTransfer):
Pspace: spatial prolongation matrix, dim. Nc x Nf Pspace: spatial prolongation matrix, dim. Nc x Nf
""" """
def __init__(self, fine_prob, coarse_prob, params):
"""
Initialization routine
Args:
fine_prob: fine problem
coarse_prob: coarse problem
params: parameters for the transfer operators
"""
# invoke super initialization
super(mesh_to_mesh, self).__init__(fine_prob, coarse_prob, params)
def restrict(self, F): def restrict(self, F):
""" """
Restriction implementation Restriction implementation
......
...@@ -5,24 +5,12 @@ from pySDC.implementations.datatype_classes.particles import particles, fields, ...@@ -5,24 +5,12 @@ from pySDC.implementations.datatype_classes.particles import particles, fields,
class particles_to_particles(SpaceTransfer): class particles_to_particles(SpaceTransfer):
""" """
Custon transfer class, implements SpaceTransfer.py Custom transfer class, implements SpaceTransfer.py
This implementation is just a dummy for particles with no direct functionality, i.e. the number of particles is not This implementation is just a dummy for particles with no direct functionality, i.e. the number of particles is not
reduced on the coarse problem reduced on the coarse problem
""" """
def __init__(self, fine_prob, coarse_prob, params):
"""
Initialization routine
Args:
fine_prob: fine problem
coarse_prob: coarse problem
params: parameters for the transfer operators
"""
super(particles_to_particles, self).__init__(fine_prob, coarse_prob, params)
pass
def restrict(self, F): def restrict(self, F):
""" """
Dummy restriction routine Dummy restriction routine
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment