Skip to content

Commit

Permalink
Refactor for space transfer classes
Browse files Browse the repository at this point in the history
  • Loading branch information
brownbaerchen committed Jan 24, 2025
1 parent 913463d commit 2b5387c
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 44 deletions.
6 changes: 3 additions & 3 deletions pySDC/core/space_transfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,17 @@ class SpaceTransfer(object):
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
Args:
fine_prob (pySDC.Problem.ptype): reference to the fine 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
self.logger = logging.getLogger('space-transfer')
Expand Down
15 changes: 0 additions & 15 deletions pySDC/implementations/transfer_classes/TransferFenicsMesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,6 @@ class mesh_to_mesh_fenics(SpaceTransfer):
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):
"""
Restriction implementation via projection
Expand Down
14 changes: 1 addition & 13 deletions pySDC/implementations/transfer_classes/TransferMesh_NoCoarse.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

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
via matrix-vector products
Expand All @@ -15,18 +15,6 @@ class mesh_to_mesh(SpaceTransfer):
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):
"""
Restriction implementation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,12 @@

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
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):
"""
Dummy restriction routine
Expand Down

0 comments on commit 2b5387c

Please sign in to comment.