Beispiel #1
0
    def __init__(self, nn=3, relax='J', eps=2e-10, maxiter=1000,
                 moment_corrections=None,
                 extended=None,
                 timer=nulltimer):

        FDPoissonSolver.__init__(self, nn=nn, relax=relax,
                                 eps=eps, maxiter=maxiter,
                                 remove_moment=None)

        self.timer = timer

        if moment_corrections is None:
            self.moment_corrections = None
        elif isinstance(moment_corrections, int):
            self.moment_corrections = [{'moms': range(moment_corrections),
                                        'center': None}]
        else:
            self.moment_corrections = moment_corrections

        self.is_extended = False
        # Broadcast over band, kpt, etc. communicators required?
        self.requires_broadcast = False
        if extended is not None:
            self.is_extended = True
            self.extended = extended
            assert 'gpts' in extended.keys(), 'gpts parameter is missing'
            self.extended['gpts'] = np.array(self.extended['gpts'])
            # Multiply gpts by 2 to get gpts on fine grid
            self.extended['finegpts'] = self.extended['gpts'] * 2
            assert 'useprev' in extended.keys(), 'useprev parameter is missing'
            if self.extended.get('comm') is not None:
                self.requires_broadcast = True
Beispiel #2
0
 def __init__(self,
              k2=0.0,
              nn='M',
              relax='GS',
              eps=2e-10,
              use_charge_center=True):
     assert k2 <= 0, 'Currently only defined for k^2<=0'
     FDPoissonSolver.__init__(self,
                              nn,
                              relax,
                              eps,
                              use_charge_center=use_charge_center)
     self.k2 = k2
Beispiel #3
0
 def __init__(self,
              nn=3,
              relax='J',
              eps=2e-10,
              maxiter=1000,
              remove_moment=None,
              use_charge_center=True):
     if remove_moment is not None:
         raise NotImplementedError(
             'Removing arbitrary multipole moments '
             'is not implemented for SolvationPoissonSolver!')
     FDPoissonSolver.__init__(self,
                              nn,
                              relax,
                              eps,
                              maxiter,
                              remove_moment,
                              use_charge_center=use_charge_center)