Octopus
ghost_interaction.F90
Go to the documentation of this file.
1!! Copyright (C) 2020 M. Oliveira
2!!
3!! This Source Code Form is subject to the terms of the Mozilla Public
4!! License, v. 2.0. If a copy of the MPL was not distributed with this
5!! file, You can obtain one at https://mozilla.org/MPL/2.0/.
6!!
7
8#include "global.h"
9
11 use debug_oct_m
12 use global_oct_m
16
17 implicit none
18
19 private
20 public :: &
22
25 type, extends(interaction_t) :: ghost_interaction_t
26 contains
27 procedure :: calculate => ghost_interaction_calculate
28 procedure :: calculate_energy => ghost_interaction_calculate_energy
30 end type ghost_interaction_t
31
32 interface ghost_interaction_t
33 module procedure ghost_interaction_init
34 end interface ghost_interaction_t
35
36contains
37
38 ! ---------------------------------------------------------
39 function ghost_interaction_init(partner) result(this)
40 class(interaction_partner_t), target, intent(inout) :: partner
41 class(ghost_interaction_t), pointer :: this
42
44
45 allocate(this)
46
47 this%label = "ghost"
48
49 this%partner => partner
50 this%intra_interaction = .false.
51
53 end function ghost_interaction_init
54
55 ! ---------------------------------------------------------
56 subroutine ghost_interaction_calculate(this)
57 class(ghost_interaction_t), intent(inout) :: this
58
60
61 ! A ghost interaction does not do anything
62
64 end subroutine ghost_interaction_calculate
65
66 ! ---------------------------------------------------------
68 class(ghost_interaction_t), intent(inout) :: this
69
71
72 ! A ghost interaction does not have an energy
73
74 this%energy = m_zero
75
78
79
80 ! ---------------------------------------------------------
81 subroutine ghost_interaction_finalize(this)
82 type(ghost_interaction_t), intent(inout) :: this
83
85
86 call interaction_end(this)
87
89 end subroutine ghost_interaction_finalize
90
92
93!! Local Variables:
94!! mode: f90
95!! coding: utf-8
96!! End:
subroutine ghost_interaction_calculate(this)
subroutine ghost_interaction_calculate_energy(this)
class(ghost_interaction_t) function, pointer ghost_interaction_init(partner)
subroutine ghost_interaction_finalize(this)
real(8), parameter, public m_zero
Definition: global.F90:167
This module defines the abstract interaction_t class, and some auxiliary classes for interactions.
subroutine, public interaction_end(this)
This module defines classes and functions for interaction partners.
The ghost ineraction is a dummy interaction, which needs to be setup between otherwise non-interactin...
abstract interaction class