Octopus
interactions_factory_abst.F90
Go to the documentation of this file.
1!! Copyright (C) 2020-24 M. Oliveira
2!!
3!! This program is free software; you can redistribute it and/or modify
4!! it under the terms of the GNU General Public License as published by
5!! the Free Software Foundation; either version 2, or (at your option)
6!! any later version.
7!!
8!! This program is distributed in the hope that it will be useful,
9!! but WITHOUT ANY WARRANTY; without even the implied warranty of
10!! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11!! GNU General Public License for more details.
12!!
13!! You should have received a copy of the GNU General Public License
14!! along with this program; if not, write to the Free Software
15!! Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
16!! 02110-1301, USA.
17!!
18
25 implicit none
26
27 private
28 public :: &
31
32 integer, parameter, public :: &
33 NO_PARTNERS = -1, &
34 all_partners = -2, &
35 only_partners = -3, &
36 all_except = -4
37
46 !
48 integer :: mode
49 integer :: timing
50 character(len=MAX_NAMESPACE_LEN), allocatable :: partners(:)
52
55 contains
56 procedure(interactions_factory_abst_create), deferred :: create
57
58 procedure(interactions_factory_abst_options), deferred, nopass :: options
59
61
62 abstract interface
63
67 !
68 function interactions_factory_abst_create(this, type, partner) result(interaction)
71 import interaction_t
72 class(interactions_factory_abst_t), intent(in) :: this
73 integer, intent(in) :: type
74 class(interaction_partner_t), target, intent(inout) :: partner
75 class(interaction_t), pointer :: interaction
77
82 !
83 function interactions_factory_abst_options(namespace, interactions) result(options)
86 type(namespace_t), intent(in) :: namespace
87 integer, intent(in) :: interactions(:)
88 type(interactions_factory_options_t) :: options(size(interactions))
90 end interface
91
93
94!! Local Variables:
95!! mode: f90
96!! coding: utf-8
97!! End:
if write to the Free Software Franklin Fifth USA !If the compiler accepts long Fortran it is better to use that and build all the preprocessor definitions in one line In !this the debuggers will provide the right line numbers !If the compiler accepts line number then CARDINAL and ACARDINAL !will put them just a new line or a ampersand plus a new line !These macros should be used in macros that span several lines They should by !put immedialty before a line where a compilation error might occur and at the !end of the macro !Note that the cardinal and newline words are substituted by the program !preprocess pl by the ampersand and by a real new line just before compilation !The assertions are ignored if the code is compiled in not debug mode(NDEBUG ! is defined). Otherwise it is merely a logical assertion that
Interface for the function to create a specific interaction.
Interface for the function to get the interaction options for a given namespace.
This module defines the abstract interaction_t class, and some auxiliary classes for interactions.
This module defines classes and functions for interaction partners.
This module defines the abstract class for the interaction factory.
integer, parameter, public only_partners
abstract interaction class
abstract class for general interaction partners
type for storing options to be used when creating a given interaction