58 |
|
#define __FORTRAN90 |
59 |
|
#include "brains/fSimulation.h" |
60 |
|
#include "UseTheForce/fSwitchingFunction.h" |
61 |
+ |
#include "UseTheForce/DarkSide/fElectrostaticSummationMethod.h" |
62 |
|
|
63 |
|
type (simtype), public, save :: thisSim |
64 |
|
|
84 |
|
real(kind=dp), allocatable, dimension(:), public :: mfactLocal |
85 |
|
|
86 |
|
logical, allocatable, dimension(:) :: simHasAtypeMap |
87 |
+ |
#ifdef IS_MPI |
88 |
+ |
logical, allocatable, dimension(:) :: simHasAtypeMapTemp |
89 |
+ |
#endif |
90 |
+ |
|
91 |
|
real(kind=dp), public, dimension(3,3), save :: Hmat, HmatInv |
92 |
|
logical, public, save :: boxIsOrthorhombic |
93 |
|
|
109 |
|
public :: SimUsesShapes |
110 |
|
public :: SimUsesFLARB |
111 |
|
public :: SimUsesRF |
112 |
+ |
public :: SimUsesDampedWolf |
113 |
|
public :: SimRequiresPrepairCalc |
114 |
|
public :: SimRequiresPostpairCalc |
115 |
|
public :: SimHasAtype |
561 |
|
doesit = thisSim%SIM_uses_RF |
562 |
|
end function SimUsesRF |
563 |
|
|
564 |
+ |
function SimUsesDampedWolf() result(doesit) |
565 |
+ |
logical :: doesit |
566 |
+ |
doesit = thisSim%SIM_uses_DampedWolf |
567 |
+ |
end function SimUsesDampedWolf |
568 |
+ |
|
569 |
|
function SimRequiresPrepairCalc() result(doesit) |
570 |
|
logical :: doesit |
571 |
|
doesit = thisSim%SIM_uses_EAM |
572 |
|
end function SimRequiresPrepairCalc |
573 |
< |
|
573 |
> |
|
574 |
|
function SimRequiresPostpairCalc() result(doesit) |
575 |
|
logical :: doesit |
576 |
< |
doesit = thisSim%SIM_uses_RF |
576 |
> |
doesit = thisSim%SIM_uses_RF .or. thisSim%SIM_uses_DampedWolf |
577 |
|
end function SimRequiresPostpairCalc |
578 |
|
|
579 |
|
! Function returns true if the simulation has this atype |
605 |
|
end if |
606 |
|
SimHasAtypeMap = .false. |
607 |
|
end if |
608 |
+ |
|
609 |
|
! Loop through the local atoms and grab the atypes present |
610 |
|
do me_i = 1,nLocal |
611 |
|
SimHasAtypeMap(atid(me_i)) = .true. |
613 |
|
! For MPI, we need to know all possible atypes present in |
614 |
|
! simulation on all processors. Use LOR operation to set map. |
615 |
|
#ifdef IS_MPI |
616 |
< |
call mpi_allreduce(SimHasAtypeMap, SimHasAtypeMap, nAtypes, & |
616 |
> |
if (.not.allocated(SimHasAtypeMapTemp)) then |
617 |
> |
allocate(SimHasAtypeMapTemp(nAtypes),stat=alloc_stat) |
618 |
> |
if (alloc_stat /= 0 ) then |
619 |
> |
status = -1 |
620 |
> |
return |
621 |
> |
end if |
622 |
> |
end if |
623 |
> |
call mpi_allreduce(SimHasAtypeMap, SimHasAtypeMaptemp, nAtypes, & |
624 |
|
mpi_logical, MPI_LOR, mpi_comm_world, mpiErrors) |
625 |
+ |
simHasAtypeMap = simHasAtypeMapTemp |
626 |
+ |
deallocate(simHasAtypeMapTemp) |
627 |
|
#endif |
628 |
|
end subroutine createSimHasAtype |
629 |
|
|