Neko 1.99.5
A portable framework for high-order spectral element flow simulations
Loading...
Searching...
No Matches
case.f90
Go to the documentation of this file.
1! Copyright (c) 2020-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!
34module case
35 use num_types, only : rp, sp, dp
36 use fluid_pnpn, only : fluid_pnpn_t
38 use fluid_scheme_base, only: fluid_scheme_base_t, fluid_scheme_base_factory
40 use chkp_output, only : chkp_output_t
41 use mesh_field, only : mesh_fld_t
43 use redist, only : redist_mesh
45 use flow_ic, only : set_flow_ic
46 use scalar_ic, only : set_scalar_ic
47 use file, only : file_t
49 use mesh, only : mesh_t
50 use math, only : neko_eps
51 use checkpoint, only: chkp_t
53 use logger, only : neko_log, neko_log_quiet
55 use user_intf, only : user_t
56 use scalar_pnpn, only : scalar_pnpn_t
58 use time_state, only : time_state_t
59 use json_module, only : json_file
64 use scalars, only : scalars_t
65 use comm, only : neko_comm, pe_rank, pe_size
66 use mpi_f08, only : mpi_bcast, mpi_character, mpi_integer, mpi_logical
68 use vector, only : vector_t
69
70 implicit none
71 private
72
73 type, public :: case_t
74 type(mesh_t) :: msh
75 type(json_file) :: params
76 character(len=:), allocatable :: output_directory
78 type(fluid_output_t) :: f_out
79 type(time_state_t) :: time
80 type(chkp_output_t) :: chkp_out
81 type(chkp_t) :: chkp
82 type(user_t) :: user
83 class(fluid_scheme_base_t), allocatable :: fluid
84 type(scalars_t), allocatable :: scalars
85 contains
86 procedure, private, pass(this) :: case_init_from_file
87 procedure, private, pass(this) :: case_init_from_json
88 procedure, pass(this) :: free => case_free
90 end type case_t
91
92contains
93
95 subroutine case_init_from_file(this, case_file)
96 class(case_t), target, intent(inout) :: this
97 character(len=*), intent(in) :: case_file
98 integer :: ierr, integer_val
99 character(len=:), allocatable :: json_buffer
100 logical :: exist
101
102 ! Check if the file exists
103 inquire(file = trim(case_file), exist = exist)
104 if (.not. exist) then
105 call neko_error('The case file '//trim(case_file)//' does not exist.')
106 end if
107
108 call neko_log%section('Case')
109 call neko_log%message('Reading case file ' // trim(case_file), &
111
112 call this%params%initialize()
113 if (pe_rank .eq. 0) then
114 call this%params%load_file(filename = trim(case_file))
115 call this%params%print_to_string(json_buffer)
116 integer_val = len(json_buffer)
117 end if
118
119 call mpi_bcast(integer_val, 1, mpi_integer, 0, neko_comm, ierr)
120 if (pe_rank .ne. 0) allocate(character(len = integer_val) :: json_buffer)
121 call mpi_bcast(json_buffer, integer_val, mpi_character, 0, neko_comm, ierr)
122 call this%params%load_from_string(json_buffer)
123
124 deallocate(json_buffer)
125
126 call case_init_common(this)
127
128 end subroutine case_init_from_file
129
131 subroutine case_init_from_json(this, case_json)
132 class(case_t), target, intent(inout) :: this
133 type(json_file), intent(in) :: case_json
134
135 call neko_log%section('Case')
136 call neko_log%message('Creating case from JSON object', neko_log_quiet)
137
138 this%params = case_json
139
140 call case_init_common(this)
141
142 end subroutine case_init_from_json
143
145 subroutine case_init_common(this)
146 type(case_t), target, intent(inout) :: this
147 integer :: lx = 0
148 logical :: scalar = .false.
149 type(file_t) :: msh_file, bdry_file, part_file
150 type(mesh_fld_t) :: msh_part, parts
151 logical :: found, logical_val, load_balance
152 logical :: temperature_found = .false.
153 integer :: integer_val, var_type
154 real(kind=rp) :: real_val
155 real(kind=rp), allocatable :: real_vals(:)
156 type(vector_t), pointer :: vec
157 character(len=:), allocatable :: string_val, name, file_format
158 character(len=NEKO_FNAME_LEN) :: lb_file, lb_name, lb_path, lb_ext
159 integer :: output_dir_len
160 integer :: precision, layout
161 type(json_file) :: scalar_params, numerics_params
162 type(json_file) :: json_subdict
163 integer :: n_scalars, i
164 logical :: tmp_feature
165
166 !
167 ! Setup user defined functions
168 !
169 call this%user%init()
170
171 ! Run user startup routine
172 call this%user%startup(this%params)
173
174 ! Check if default value fill-in is allowed
175 if (this%params%valid_path('case.no_defaults')) then
176 call json_get(this%params, 'case.no_defaults', json_no_defaults)
177 end if
178
179
180 !
181 ! Populate const registry with global data from the case file
182 !
183 if (this%params%valid_path('case.constants')) then
184 call this%params%info('case.constants', &
185 n_children = integer_val)
186 do i = 1, integer_val
187 call json_extract_item(this%params, &
188 'case.constants', i, json_subdict)
189 call json_get(json_subdict, 'name', string_val)
190
191 call json_subdict%info('value', found = found, var_type = var_type)
192
193 select case (var_type)
194 case (5) ! integer
195 call json_get(json_subdict, 'value', integer_val)
196 call neko_const_registry%add_integer_scalar(integer_val, &
197 trim(string_val))
198 case (6) ! real
199 call json_get(json_subdict, 'value', real_val)
200 call neko_const_registry%add_real_scalar(real_val, &
201 trim(string_val))
202 case (3) ! array
203 call json_get(json_subdict, 'value', real_vals)
204 call neko_const_registry%add_vector(size(real_vals), &
205 trim(string_val))
206 vec => neko_const_registry%get_vector(trim(string_val))
207 vec%x = real_vals
208 case default
209 call neko_error('case_init_common: Unsupported constant ' // &
210 'type in case.constants for entry '//trim(string_val)//'.')
211 end select
212 end do
213 end if
214
215 !
216 ! Load mesh and perform load balancing if requested
217 !
218 call json_get_or_default(this%params, 'case.mesh_file', string_val, &
219 'no mesh')
220 call json_get_or_default(this%params, 'case.load_balancing', load_balance, &
221 .false.)
222
223 if (trim(string_val) .eq. 'no mesh') then
224 call neko_error('The mesh_file keyword could not be found in the .' // &
225 'case file. Often caused by incorrectly formatted json.')
226 end if
227
228 if (pe_rank .eq. 0) then
229 inquire(file = trim(string_val), exist = found)
230 end if
231 call mpi_bcast(found, 1, mpi_logical, 0, neko_comm)
232
233 if (.not. found) then
234 call neko_error('The mesh file ' // trim(string_val) // &
235 ' does not exist.')
236 end if
237
238 if (.not. load_balance .or. pe_size .eq. 1) then
239 if (load_balance) then
240 call neko_log%message('Load balancing requested but only one ' // &
241 'MPI rank found, ignoring.')
242 end if
243
244 call msh_file%init(string_val)
245 call msh_file%read(this%msh)
246
247 else if (load_balance) then
248 call neko_log%section('Load Balancing')
249
250 call filename_split(trim(string_val), lb_path, lb_name, lb_ext)
251 write(lb_file, '(A,A,A,I0,A)') &
252 trim(lb_path), trim(lb_name), "_lb_", pe_size, trim(lb_ext)
253
254 if (pe_rank .eq. 0) then
255 inquire(file = trim(lb_file), exist = found)
256 end if
257 call mpi_bcast(found, 1, mpi_logical, 0, neko_comm)
258
259 if (found) then
260 call neko_log%message('Reading balanced mesh')
261 call msh_file%init(lb_file)
262 call msh_file%read(this%msh)
263 else
264 call msh_file%init(string_val)
265 call msh_file%read(this%msh)
266
267 call neko_log%message('Performing load balancing with ParMETIS')
268 call parmetis_partmeshkway(this%msh, parts)
269 call redist_mesh(this%msh, parts)
270
271 ! store the balanced mesh (for e.g. restarts)
272 call msh_file%init(lb_file)
273 call msh_file%write(this%msh)
274 end if
275
276 call neko_log%end_section()
277 end if
278
279 ! Run user mesh motion routine
280 call this%user%mesh_setup(this%msh, this%time)
281
282 !
283 ! Time control
284 !
285 call json_get(this%params, 'case.time', json_subdict)
286 call this%time%init(json_subdict)
287
288 !
289 ! Initialize point_zones registry
290 !
291 call neko_point_zone_registry%init(this%params, this%msh)
292
293 !
294 ! Setup fluid scheme
295 !
296 call json_get(this%params, 'case.fluid.scheme', string_val)
297 call fluid_scheme_base_factory(this%fluid, trim(string_val))
298
299 call json_get_or_lookup(this%params, 'case.numerics.polynomial_order', lx)
300 lx = lx + 1 ! add 1 to get number of gll points
301 ! Set time lags in chkp
302 call this%chkp%init()
303 this%chkp%tlag => this%time%tlag
304 this%chkp%dtlag => this%time%dtlag
305 call this%fluid%init(this%msh, lx, this%params, this%user, this%chkp)
306
307
308 !
309 ! Setup scratch registry
310 !
311 call neko_scratch_registry%set_dofmap(this%fluid%dm_Xh)
312
313 !
314 ! Setup scalar scheme
315 !
316 ! @todo no scalar factory for now, probably not needed
317 scalar = .false.
318 n_scalars = 0
319 if (this%params%valid_path('case.scalar')) then
320 call json_get_or_default(this%params, 'case.scalar.enabled', scalar, &
321 .true.)
322 n_scalars = 1
323 else if (this%params%valid_path('case.scalars')) then
324 call this%params%info('case.scalars', n_children = n_scalars)
325 if (n_scalars > 0) then
326 scalar = .true.
327 end if
328 end if
329
330 if (scalar) then
331 allocate(this%scalars)
332 call json_get(this%params, 'case.numerics', numerics_params)
333 if (this%params%valid_path('case.scalar')) then
334 ! For backward compatibility
335 call json_get(this%params, 'case.scalar', scalar_params)
336 call this%scalars%init(this%msh, this%fluid%c_Xh, this%fluid%gs_Xh, &
337 scalar_params, numerics_params, this%user, this%chkp, &
338 this%fluid%ulag, this%fluid%vlag, this%fluid%wlag, &
339 this%fluid%ext_bdf, this%fluid%rho)
340 else
341 ! Multiple scalars
342 call json_get(this%params, 'case.scalars', json_subdict)
343 call this%scalars%init(n_scalars, this%msh, this%fluid%c_Xh, &
344 this%fluid%gs_Xh, json_subdict, numerics_params, this%user, &
345 this%chkp, this%fluid%ulag, this%fluid%vlag, this%fluid%wlag, &
346 this%fluid%ext_bdf, this%fluid%rho)
347 end if
348 end if
349
350 !
351 ! Setup initial conditions
352 !
353 call json_get(this%params, 'case.fluid.initial_condition.type', &
354 string_val)
355 call json_get(this%params, 'case.fluid.initial_condition', &
356 json_subdict)
357
358 call neko_log%section("Fluid initial condition ")
359
360 if (this%params%valid_path('case.restart_file')) then
361 call neko_log%message("Restart file specified, " // &
362 "initial conditions ignored")
363 else if (trim(string_val) .ne. 'user') then
364 call set_flow_ic(this%fluid%u, this%fluid%v, this%fluid%w, &
365 this%fluid%p, this%fluid%c_Xh, this%fluid%gs_Xh, string_val, &
366 json_subdict)
367 else
368 call json_get(this%params, 'case.fluid.scheme', string_val)
369 if (trim(string_val) .eq. 'compressible') then
370 call set_flow_ic(this%fluid%rho, &
371 this%fluid%u, this%fluid%v, this%fluid%w, this%fluid%p, &
372 this%fluid%c_Xh, this%fluid%gs_Xh, &
373 this%user%initial_conditions, this%fluid%name)
374 else
375 call set_flow_ic(this%fluid%u, this%fluid%v, this%fluid%w, &
376 this%fluid%p, this%fluid%c_Xh, this%fluid%gs_Xh, &
377 this%user%initial_conditions, this%fluid%name)
378 end if
379 end if
380
381 call neko_log%end_section()
382
383 if (scalar) then
384 call neko_log%section("Scalar initial condition ")
385
386 if (this%params%valid_path('case.restart_file')) then
387 call neko_log%message("Restart file specified, " // &
388 "initial conditions ignored")
389 else if (this%params%valid_path('case.scalar')) then
390 ! For backward compatibility with single scalar
391 call json_get(this%params, 'case.scalar.initial_condition.type', &
392 string_val)
393 call json_get(this%params, &
394 'case.scalar.initial_condition', json_subdict)
395
396 if (trim(string_val) .ne. 'user') then
397 if (trim(this%scalars%scalar_fields(1)%scalar%name) .eq. &
398 'temperature') then
399 call set_scalar_ic(this%scalars%scalar_fields(1)%scalar%s, &
400 this%scalars%scalar_fields(1)%scalar%c_Xh, &
401 this%scalars%scalar_fields(1)%scalar%gs_Xh, &
402 string_val, json_subdict, 0)
403 else
404 call set_scalar_ic(this%scalars%scalar_fields(1)%scalar%s, &
405 this%scalars%scalar_fields(1)%scalar%c_Xh, &
406 this%scalars%scalar_fields(1)%scalar%gs_Xh, &
407 string_val, json_subdict, 1)
408 end if
409 else
410 call set_scalar_ic(this%scalars%scalar_fields(1)%scalar%name, &
411 this%scalars%scalar_fields(1)%scalar%s, &
412 this%scalars%scalar_fields(1)%scalar%c_Xh, &
413 this%scalars%scalar_fields(1)%scalar%gs_Xh, &
414 this%user%initial_conditions)
415 end if
416
417 else
418 ! Handle multiple scalars
419 do i = 1, n_scalars
420 call json_extract_item(this%params, 'case.scalars', i, &
421 scalar_params)
422 call json_get(scalar_params, 'initial_condition.type', string_val)
423 call json_get(scalar_params, 'initial_condition', &
424 json_subdict)
425
426 if (trim(string_val) .ne. 'user') then
427 if (trim(this%scalars%scalar_fields(i)%scalar%name) .eq. &
428 'temperature') then
429 call set_scalar_ic( &
430 this%scalars%scalar_fields(i)%scalar%s, &
431 this%scalars%scalar_fields(i)%scalar%c_Xh, &
432 this%scalars%scalar_fields(i)%scalar%gs_Xh, &
433 string_val, json_subdict, 0)
434 temperature_found = .true.
435 else
436 if (temperature_found) then
437 ! If temperature is found, other scalars start
438 ! from index 1
439 call set_scalar_ic( &
440 this%scalars%scalar_fields(i)%scalar%s, &
441 this%scalars%scalar_fields(i)%scalar%c_Xh, &
442 this%scalars%scalar_fields(i)%scalar%gs_Xh, &
443 string_val, json_subdict, i - 1)
444 else
445 ! If temperature is not found, other scalars
446 ! start from index 0
447 call set_scalar_ic( &
448 this%scalars%scalar_fields(i)%scalar%s, &
449 this%scalars%scalar_fields(i)%scalar%c_Xh, &
450 this%scalars%scalar_fields(i)%scalar%gs_Xh, &
451 string_val, json_subdict, i)
452 end if
453 end if
454 else
455 call set_scalar_ic(this%scalars%scalar_fields(i)%scalar%name,&
456 this%scalars%scalar_fields(i)%scalar%s, &
457 this%scalars%scalar_fields(i)%scalar%c_Xh, &
458 this%scalars%scalar_fields(i)%scalar%gs_Xh, &
459 this%user%initial_conditions)
460 end if
461 end do
462 end if
463
464 call neko_log%end_section()
465 end if
466
467 ! Add initial conditions to BDF scheme (if present)
468 select type (f => this%fluid)
469 type is (fluid_pnpn_t)
470 call f%ulag%set(f%u)
471 call f%vlag%set(f%v)
472 call f%wlag%set(f%w)
473 end select
474
475 !
476 ! Validate that the case is properly setup for time-stepping
477 !
478 call this%fluid%validate
479
480 if (scalar) then
481 call this%scalars%validate()
482 end if
483
484 !
485 ! Get and process output directory
486 !
487 call json_get_or_default(this%params, 'case.output_directory',&
488 this%output_directory, '')
489
490 output_dir_len = len(trim(this%output_directory))
491 if (output_dir_len .gt. 0) then
492 if (this%output_directory(output_dir_len:output_dir_len) .ne. "/") then
493 this%output_directory = trim(this%output_directory)//"/"
494 end if
495 if (pe_rank .eq. 0) then
496 call mkdir(trim(this%output_directory))
497 end if
498 end if
499
500 !
501 ! Save mesh partitions (if requested)
502 !
503 call json_get_or_default(this%params, 'case.output_partitions',&
504 logical_val, .false.)
505 if (logical_val) then
506 call msh_part%init(this%msh, 'MPI_Rank')
507 msh_part%data = pe_rank
508 call part_file%init(trim(this%output_directory)//'partitions.vtk')
509 call part_file%write(msh_part)
510 call msh_part%free()
511 end if
512
513 !
514 ! Setup output precision of the field files
515 !
516 call json_get_or_default(this%params, 'case.output_precision', string_val,&
517 'single')
518
519 if (trim(string_val) .eq. 'double') then
520 precision = dp
521 else
522 precision = sp
523 end if
524
525 !
526 ! Setup output layout of the field bp file
527 !
528 call json_get_or_lookup_or_default(this%params, 'case.output_layout', &
529 layout, 1)
530
531 !
532 ! Setup output_controller
533 !
534 call json_get_or_default(this%params, 'case.fluid.output_filename', &
535 name, "field")
536 call json_get_or_default(this%params, 'case.fluid.output_format', &
537 file_format, 'fld')
538 call json_get_or_default(this%params, &
539 'case.fluid.output_mesh_in_all_files', &
540 logical_val, .false.)
541
542 ! To ensure we don't miss saving the mesh for ALE.
543 call json_get_or_default(this%params, 'case.fluid.ale.enabled', &
544 tmp_feature, .false.)
545 if (tmp_feature) logical_val = .true.
546
547 call this%output_controller%init(this%time%end_time)
548 if (scalar) then
549 call this%f_out%init(precision, this%fluid, this%scalars, name = name, &
550 path = trim(this%output_directory), &
551 fmt = trim(file_format), layout = layout, &
552 always_write_mesh = logical_val)
553 else
554 call this%f_out%init(precision, this%fluid, name = name, &
555 path = trim(this%output_directory), &
556 fmt = trim(file_format), layout = layout, &
557 always_write_mesh = logical_val)
558 end if
559
560 call json_get_or_default(this%params, 'case.fluid.output_subdivide', &
561 logical_val, .false.)
562 call this%f_out%file_%set_subdivide(logical_val)
563
564 call json_get(this%params, 'case.fluid.output_control', string_val)
565
566 if (trim(string_val) .eq. 'org') then
567 ! yes, it should be real_val below for type compatibility
568 call json_get_or_lookup(this%params, 'case.nsamples', integer_val)
569 real_val = real(integer_val, kind=rp)
570 call this%output_controller%add(this%f_out, real_val, 'nsamples')
571 else if (trim(string_val) .eq. 'never') then
572 call this%output_controller%add(this%f_out, 0.0_rp, 'never')
573 else if (trim(string_val) .eq. 'tsteps' .or. &
574 trim(string_val) .eq. 'nsamples') then
575 call json_get_or_lookup(this%params, 'case.fluid.output_value', &
576 integer_val)
577 real_val = real(integer_val, kind=rp)
578 call this%output_controller%add(this%f_out, real_val, string_val)
579 else if (trim(string_val) .eq. 'simulationtime') then
580 call json_get_or_lookup(this%params, 'case.fluid.output_value', real_val)
581 call this%output_controller%add(this%f_out, real_val, string_val)
582 else
583 call neko_log%error('Unknown output control type for the fluid: ' // &
584 trim(string_val))
585 end if
586
587 !
588 ! Save checkpoints (if nothing specified, default to saving at end of sim)
589 !
590 call json_get(this%params, 'case.output_checkpoints', logical_val)
591 if (logical_val) then
592 call json_get_or_default(this%params, 'case.checkpoint_filename', &
593 name, "fluid")
594 call json_get_or_default(this%params, 'case.checkpoint_format', &
595 string_val, "chkp")
596 call this%chkp_out%init(this%chkp, name = name,&
597 path = this%output_directory, fmt = trim(string_val))
598 call json_get(this%params, 'case.checkpoint_control', &
599 string_val)
600 if (trim(string_val) .eq. 'tsteps' .or. &
601 trim(string_val) .eq. 'nsamples') then
602 call json_get_or_lookup(this%params, 'case.checkpoint_value', &
603 integer_val)
604 real_val = real(integer_val, kind=rp)
605 else if (trim(string_val) .eq. 'simulationtime') then
606 call json_get_or_lookup(this%params, 'case.checkpoint_value', &
607 real_val)
608 else if (trim(string_val) .eq. 'never') then
609 real_val = 0.0_rp
610 end if
611
612 call this%output_controller%add(this%chkp_out, real_val, string_val, &
613 neko_eps)
614 end if
615
616 !
617 ! Setup joblimit
618 !
619 if (this%params%valid_path('case.job_timelimit')) then
620 call json_get(this%params, 'case.job_timelimit', string_val)
621 call jobctrl_set_time_limit(string_val)
622 end if
623
624 call neko_log%end_section()
625
626 call scalar_params%destroy()
627 call numerics_params%destroy()
628 call json_subdict%destroy()
629
630 nullify(vec)
631
632 end subroutine case_init_common
633
635 subroutine case_free(this)
636 class(case_t), intent(inout) :: this
637
638 if (allocated(this%fluid)) then
639 call this%fluid%free()
640 deallocate(this%fluid)
641 end if
642
643 if (allocated(this%scalars)) then
644 call this%scalars%free()
645 deallocate(this%scalars)
646 end if
647
648 call this%msh%free()
649
650 call this%f_out%free()
651
652 call this%output_controller%free()
653
654 if (allocated(this%output_directory)) then
655 deallocate(this%output_directory)
656 end if
657
658 end subroutine case_free
659
660end module case
double real
Retrieves a parameter by name or assigns a provided default value. In the latter case also adds the m...
Retrieves a parameter by name or throws an error.
Defines a simulation case.
Definition case.f90:34
subroutine case_init_from_file(this, case_file)
Initialize a case from an input file case_file.
Definition case.f90:96
subroutine case_free(this)
Deallocate a case.
Definition case.f90:636
subroutine case_init_from_json(this, case_json)
Initialize a case from a JSON object describing a case.
Definition case.f90:132
subroutine case_init_common(this)
Initialize a case from its (loaded) params object.
Definition case.f90:146
Defines a checkpoint.
Defines an output for a checkpoint.
Definition comm.F90:1
integer, public pe_size
MPI size of communicator.
Definition comm.F90:61
integer, public pe_rank
MPI rank.
Definition comm.F90:58
type(mpi_comm), public neko_comm
MPI communicator.
Definition comm.F90:45
Module for file I/O operations.
Definition file.f90:34
Initial flow condition.
Definition flow_ic.f90:34
Defines an output for a fluid.
Modular version of the Classic Nek5000 Pn/Pn formulation for fluids.
Job control.
Definition jobctrl.f90:34
Utilities for retrieving parameters from the case files.
logical, public json_no_defaults
If true, the json_get_or_default routines will not add missing parameters.
Logging routines.
Definition log.f90:34
integer, parameter, public neko_log_quiet
Always logged.
Definition log.f90:82
type(log_t), public neko_log
Global log stream.
Definition log.f90:80
Definition math.f90:60
real(kind=rp), parameter, public neko_eps
Machine epsilon .
Definition math.f90:70
Defines a mesh field.
Defines a mesh.
Definition mesh.f90:34
integer, parameter, public dp
Definition num_types.f90:9
integer, parameter, public sp
Definition num_types.f90:8
integer, parameter, public rp
Global precision used in computations.
Definition num_types.f90:12
Implements output_controller_t
Interface to ParMETIS.
Definition parmetis.F90:34
subroutine, public parmetis_partmeshkway(msh, parts, weights, nprts)
Compute a k-way partitioning of a mesh msh.
Definition parmetis.F90:112
type(point_zone_registry_t), target, public neko_point_zone_registry
Global point_zone registry.
Redistribution routines.
Definition redist.f90:34
subroutine, public redist_mesh(msh, parts)
Redistribute a mesh msh according to new partitions.
Definition redist.f90:59
Defines a registry for storing solution fields.
Definition registry.f90:34
type(registry_t), target, public neko_registry
Global field registry.
Definition registry.f90:144
type(registry_t), target, public neko_const_registry
This registry is used to store user-defined scalars and vectors, provided under the constants section...
Definition registry.f90:150
Scalar initial condition.
Definition scalar_ic.f90:34
Contains the scalar_pnpn_t type.
Contains the scalar_scheme_t type.
Contains the scalars_t type that manages multiple scalar fields.
Definition scalars.f90:35
Defines a registry for storing and requesting temporary objects This can be used when you have a func...
type(scratch_registry_t), target, public neko_scratch_registry
Global scratch registry.
Compound scheme for the advection and diffusion operators in a transport equation.
Module with things related to the simulation time.
Interfaces for user interaction with NEKO.
Definition user_intf.f90:34
Utilities.
Definition utils.f90:35
integer, parameter, public neko_fname_len
Definition utils.f90:42
subroutine, public filename_split(fname, path, name, suffix)
Extract file name components.
Definition utils.f90:131
recursive subroutine, public mkdir(path, mode)
Recursively create a directory and all parent directories if they do not exist. This should be safer ...
Definition utils.f90:174
Defines a vector.
Definition vector.f90:34
A wrapper around a polymorphic generic_file_t that handles its init. This is essentially a factory fo...
Definition file.f90:56
Base type of all fluid formulations.
Centralized controller for a list of outputs.
Base type for a scalar advection-diffusion solver.
Type to manage multiple scalar transport equations.
Definition scalars.f90:61
Implements the logic to compute the time coefficients for the advection and diffusion operators in a ...
A struct that contains all info about the time, expand as needed.
A type collecting all the overridable user routines and flag to suppress type injection from custom m...