Neko 1.99.9
A portable framework for high-order spectral element flow simulations
Loading...
Searching...
No Matches
lpt_simcomp.f90
Go to the documentation of this file.
1! Copyright (c) 2026, The Neko Authors
2! All rights reserved.
3!
4! Redistribution and use in source and binary forms, with or without
5! modification, are permitted provided that the following conditions
6! are met:
7!
8! * Redistributions of source code must retain the above copyright
9! notice, this list of conditions and the following disclaimer.
10!
11! * Redistributions in binary form must reproduce the above
12! copyright notice, this list of conditions and the following
13! disclaimer in the documentation and/or other materials provided
14! with the distribution.
15!
16! * Neither the name of the authors nor the names of its
17! contributors may be used to endorse or promote products derived
18! from this software without specific prior written permission.
19!
20! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21! "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22! LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
23! FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
24! COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
25! INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
26! BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
27! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
28! CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29! LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
30! ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31! POSSIBILITY OF SUCH DAMAGE.
32!
35 use json_module, only : json_file
37 use case, only : case_t
38 use time_state, only : time_state_t
39 use num_types, only : dp
40 use lpt, only : lpt_t
41 implicit none
42 private
43
45 type, public, extends(simulation_component_t) :: lpt_simcomp_t
47 type(lpt_t) :: lpt
48 contains
50 procedure, pass(this) :: init => lpt_simcomp_init_from_json
52 procedure, pass(this) :: free => lpt_simcomp_free
54 procedure, pass(this) :: preprocess_ => lpt_simcomp_preprocess
56 procedure, pass(this) :: compute_ => lpt_simcomp_compute
58 procedure, pass(this) :: time_to_next => lpt_simcomp_time_to_next
59 end type lpt_simcomp_t
60
61contains
62
64 subroutine lpt_simcomp_init_from_json(this, json, case)
65 class(lpt_simcomp_t), intent(inout), target :: this
66 type(json_file), intent(inout) :: json
67 class(case_t), intent(inout), target :: case
68
69 call this%free()
70 call this%init_base(json, case)
71 this%preprocess_controller = this%compute_controller
72 call this%lpt%init(json, case)
73 this%lpt%output_controller = this%output_controller
74 this%name = this%lpt%name
75 end subroutine lpt_simcomp_init_from_json
76
80 function lpt_simcomp_time_to_next(this, time) result(t)
81 class(lpt_simcomp_t), intent(in) :: this
82 type(time_state_t), intent(in) :: time
83 real(kind=dp) :: t
84
85 t = min(this%preprocess_controller%time_to_next(time), &
86 this%compute_controller%time_to_next(time), &
87 this%output_controller%time_to_next(time), &
88 this%lpt%output_controller%time_to_next(time))
89
90 end function lpt_simcomp_time_to_next
91
93 subroutine lpt_simcomp_free(this)
94 class(lpt_simcomp_t), intent(inout) :: this
95
96 call this%free_base()
97 call this%lpt%free()
98 end subroutine lpt_simcomp_free
99
101 subroutine lpt_simcomp_preprocess(this, time)
102 class(lpt_simcomp_t), intent(inout) :: this
103 type(time_state_t), intent(in) :: time
104
105 call this%lpt%preprocess(time)
106 end subroutine lpt_simcomp_preprocess
107
109 subroutine lpt_simcomp_compute(this, time)
110 class(lpt_simcomp_t), intent(inout) :: this
111 type(time_state_t), intent(in) :: time
112
113 call this%lpt%compute(time)
114 end subroutine lpt_simcomp_compute
115
116end module lpt_simcomp
Defines a simulation case.
Definition case.f90:34
Simulation-component handler for Lagrangian particle tracking.
subroutine lpt_simcomp_free(this)
Free the component.
subroutine lpt_simcomp_preprocess(this, time)
Update LPT before the fluid solve.
real(kind=dp) function lpt_simcomp_time_to_next(this, time)
The time until the next scheduled execution, including the output of the particle tracker,...
subroutine lpt_simcomp_init_from_json(this, json, case)
Construct from JSON.
subroutine lpt_simcomp_compute(this, time)
Update LPT after the fluid solve.
Implements lpt_t. (Lagrangian Particle Tracking)
Definition lpt.f90:34
integer, parameter, public dp
Definition num_types.f90:10
Simulation components are objects that encapsulate functionality that can be fit to a particular comp...
subroutine preprocess_(this, time)
Dummy preprocessing function.
subroutine compute_(this, time)
Dummy compute function.
Module with things related to the simulation time.
Passive Lagrangian particle tracking.
Definition lpt.f90:72
A simulation component that drives passive Lagrangian particle tracking.
Base abstract class for simulation components.
A struct that contains all info about the time, expand as needed.