Neko 1.99.9
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_dp
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=dp) :: double_val
156 real(kind=rp), allocatable :: real_vals(:)
157 type(vector_t), pointer :: vec
158 character(len=:), allocatable :: string_val, name, file_format
159 character(len=NEKO_FNAME_LEN) :: lb_file, lb_name, lb_path, lb_ext
160 integer :: output_dir_len
161 integer :: precision, layout
162 type(json_file) :: scalar_params, numerics_params
163 type(json_file) :: json_subdict
164 integer :: n_scalars, i
165 logical :: tmp_feature
166
167 !
168 ! Setup user defined functions
169 !
170 call this%user%init()
171
172 ! Run user startup routine
173 call this%user%startup(this%params)
174
175 ! Check if default value fill-in is allowed
176 if (this%params%valid_path('case.no_defaults')) then
177 call json_get(this%params, 'case.no_defaults', json_no_defaults)
178 end if
179
180
181 !
182 ! Populate const registry with global data from the case file
183 !
184 if (this%params%valid_path('case.constants')) then
185 call this%params%info('case.constants', &
186 n_children = integer_val)
187 do i = 1, integer_val
188 call json_extract_item(this%params, &
189 'case.constants', i, json_subdict)
190 call json_get(json_subdict, 'name', string_val)
191
192 call json_subdict%info('value', found = found, var_type = var_type)
193
194 select case (var_type)
195 case (5) ! integer
196 call json_get(json_subdict, 'value', integer_val)
197 call neko_const_registry%add_integer_scalar(integer_val, &
198 trim(string_val))
199 case (6) ! real
200 call json_get(json_subdict, 'value', real_val)
201 call neko_const_registry%add_real_scalar(real_val, &
202 trim(string_val))
203 case (3) ! array
204 call json_get(json_subdict, 'value', real_vals)
205 call neko_const_registry%add_vector(size(real_vals), &
206 trim(string_val))
207 vec => neko_const_registry%get_vector(trim(string_val))
208 vec%x = real_vals
209 case default
210 call neko_error('case_init_common: Unsupported constant ' // &
211 'type in case.constants for entry '//trim(string_val)//'.')
212 end select
213 end do
214 end if
215
216 !
217 ! Load mesh and perform load balancing if requested
218 !
219 call json_get_or_default(this%params, 'case.mesh_file', string_val, &
220 'no mesh')
221 call json_get_or_default(this%params, 'case.load_balancing', load_balance, &
222 .false.)
223
224 if (trim(string_val) .eq. 'no mesh') then
225 call neko_error('The mesh_file keyword could not be found in the .' // &
226 'case file. Often caused by incorrectly formatted json.')
227 end if
228
229 if (pe_rank .eq. 0) then
230 inquire(file = trim(string_val), exist = found)
231 end if
232 call mpi_bcast(found, 1, mpi_logical, 0, neko_comm)
233
234 if (.not. found) then
235 call neko_error('The mesh file ' // trim(string_val) // &
236 ' does not exist.')
237 end if
238
239 if (.not. load_balance .or. pe_size .eq. 1) then
240 if (load_balance) then
241 call neko_log%message('Load balancing requested but only one ' // &
242 'MPI rank found, ignoring.')
243 end if
244
245 call msh_file%init(string_val)
246 call msh_file%read(this%msh)
247
248 else if (load_balance) then
249 call neko_log%section('Load Balancing')
250
251 call filename_split(trim(string_val), lb_path, lb_name, lb_ext)
252 write(lb_file, '(A,A,A,I0,A)') &
253 trim(lb_path), trim(lb_name), "_lb_", pe_size, trim(lb_ext)
254
255 if (pe_rank .eq. 0) then
256 inquire(file = trim(lb_file), exist = found)
257 end if
258 call mpi_bcast(found, 1, mpi_logical, 0, neko_comm)
259
260 if (found) then
261 call neko_log%message('Reading balanced mesh')
262 call msh_file%init(lb_file)
263 call msh_file%read(this%msh)
264 else
265 call msh_file%init(string_val)
266 call msh_file%read(this%msh)
267
268 call neko_log%message('Performing load balancing with ParMETIS')
269 call parmetis_partmeshkway(this%msh, parts)
270 call redist_mesh(this%msh, parts)
271
272 ! store the balanced mesh (for e.g. restarts)
273 call msh_file%init(lb_file)
274 call msh_file%write(this%msh)
275 end if
276
277 call neko_log%end_section()
278 end if
279
280 ! Run user mesh motion routine
281 call this%user%mesh_setup(this%msh, this%time)
282
283 !
284 ! Time control
285 !
286 call json_get(this%params, 'case.time', json_subdict)
287 call this%time%init(json_subdict)
288
289 !
290 ! Initialize point_zones registry
291 !
292 call neko_point_zone_registry%init(this%params, this%msh)
293
294 !
295 ! Setup fluid scheme
296 !
297 call json_get(this%params, 'case.fluid.scheme', string_val)
298 call fluid_scheme_base_factory(this%fluid, trim(string_val))
299
300 call json_get_or_lookup(this%params, 'case.numerics.polynomial_order', lx)
301 lx = lx + 1 ! add 1 to get number of gll points
302 ! Set time lags in chkp
303 call this%chkp%init()
304 this%chkp%tlag => this%time%tlag
305 this%chkp%dtlag => this%time%dtlag
306 call this%fluid%init(this%msh, lx, this%params, this%user, this%chkp)
307
308
309 !
310 ! Setup scratch registry
311 !
312 call neko_scratch_registry%set_dofmap(this%fluid%dm_Xh)
313
314 !
315 ! Setup scalar scheme
316 !
317 ! @todo no scalar factory for now, probably not needed
318 scalar = .false.
319 n_scalars = 0
320 if (this%params%valid_path('case.scalar')) then
321 call json_get_or_default(this%params, 'case.scalar.enabled', scalar, &
322 .true.)
323 n_scalars = 1
324 else if (this%params%valid_path('case.scalars')) then
325 call this%params%info('case.scalars', n_children = n_scalars)
326 if (n_scalars > 0) then
327 scalar = .true.
328 end if
329 end if
330
331 if (scalar) then
332 allocate(this%scalars)
333 call json_get(this%params, 'case.numerics', numerics_params)
334 if (this%params%valid_path('case.scalar')) then
335 ! For backward compatibility
336 call json_get(this%params, 'case.scalar', scalar_params)
337 call this%scalars%init(this%msh, this%fluid%c_Xh, this%fluid%gs_Xh, &
338 scalar_params, numerics_params, this%user, this%chkp, &
339 this%fluid%ulag, this%fluid%vlag, this%fluid%wlag, &
340 this%fluid%ext_bdf, this%fluid%rho)
341 else
342 ! Multiple scalars
343 call json_get(this%params, 'case.scalars', json_subdict)
344 call this%scalars%init(n_scalars, this%msh, this%fluid%c_Xh, &
345 this%fluid%gs_Xh, json_subdict, numerics_params, this%user, &
346 this%chkp, this%fluid%ulag, this%fluid%vlag, this%fluid%wlag, &
347 this%fluid%ext_bdf, this%fluid%rho)
348 end if
349 end if
350
351 !
352 ! Setup initial conditions
353 !
354 call json_get(this%params, 'case.fluid.initial_condition.type', &
355 string_val)
356 call json_get(this%params, 'case.fluid.initial_condition', &
357 json_subdict)
358
359 call neko_log%section("Fluid initial condition ")
360
361 if (this%params%valid_path('case.restart_file')) then
362 call neko_log%message("Restart file specified, " // &
363 "initial conditions ignored")
364 else if (trim(string_val) .ne. 'user') then
365 call set_flow_ic(this%fluid%u, this%fluid%v, this%fluid%w, &
366 this%fluid%p, this%fluid%c_Xh, this%fluid%gs_Xh, string_val, &
367 json_subdict)
368 else
369 call json_get(this%params, 'case.fluid.scheme', string_val)
370 if (trim(string_val) .eq. 'compressible') then
371 call set_flow_ic(this%fluid%rho, &
372 this%fluid%u, this%fluid%v, this%fluid%w, this%fluid%p, &
373 this%fluid%c_Xh, this%fluid%gs_Xh, &
374 this%user%initial_conditions, this%fluid%name)
375 else
376 call set_flow_ic(this%fluid%u, this%fluid%v, this%fluid%w, &
377 this%fluid%p, this%fluid%c_Xh, this%fluid%gs_Xh, &
378 this%user%initial_conditions, this%fluid%name)
379 end if
380 end if
381
382 call neko_log%end_section()
383
384 if (scalar) then
385 call neko_log%section("Scalar initial condition ")
386
387 if (this%params%valid_path('case.restart_file')) then
388 call neko_log%message("Restart file specified, " // &
389 "initial conditions ignored")
390 else if (this%params%valid_path('case.scalar')) then
391 ! For backward compatibility with single scalar
392 call json_get(this%params, 'case.scalar.initial_condition.type', &
393 string_val)
394 call json_get(this%params, &
395 'case.scalar.initial_condition', json_subdict)
396
397 if (trim(string_val) .ne. 'user') then
398 if (trim(this%scalars%scalar_fields(1)%scalar%name) .eq. &
399 'temperature') then
400 call set_scalar_ic(this%scalars%scalar_fields(1)%scalar%s, &
401 this%scalars%scalar_fields(1)%scalar%c_Xh, &
402 this%scalars%scalar_fields(1)%scalar%gs_Xh, &
403 string_val, json_subdict, 0)
404 else
405 call set_scalar_ic(this%scalars%scalar_fields(1)%scalar%s, &
406 this%scalars%scalar_fields(1)%scalar%c_Xh, &
407 this%scalars%scalar_fields(1)%scalar%gs_Xh, &
408 string_val, json_subdict, 1)
409 end if
410 else
411 call set_scalar_ic(this%scalars%scalar_fields(1)%scalar%name, &
412 this%scalars%scalar_fields(1)%scalar%s, &
413 this%scalars%scalar_fields(1)%scalar%c_Xh, &
414 this%scalars%scalar_fields(1)%scalar%gs_Xh, &
415 this%user%initial_conditions)
416 end if
417
418 else
419 ! Handle multiple scalars
420 do i = 1, n_scalars
421 call json_extract_item(this%params, 'case.scalars', i, &
422 scalar_params)
423 call json_get(scalar_params, 'initial_condition.type', string_val)
424 call json_get(scalar_params, 'initial_condition', &
425 json_subdict)
426
427 if (trim(string_val) .ne. 'user') then
428 if (trim(this%scalars%scalar_fields(i)%scalar%name) .eq. &
429 'temperature') then
430 call set_scalar_ic( &
431 this%scalars%scalar_fields(i)%scalar%s, &
432 this%scalars%scalar_fields(i)%scalar%c_Xh, &
433 this%scalars%scalar_fields(i)%scalar%gs_Xh, &
434 string_val, json_subdict, 0)
435 temperature_found = .true.
436 else
437 if (temperature_found) then
438 ! If temperature is found, other scalars start
439 ! from index 1
440 call set_scalar_ic( &
441 this%scalars%scalar_fields(i)%scalar%s, &
442 this%scalars%scalar_fields(i)%scalar%c_Xh, &
443 this%scalars%scalar_fields(i)%scalar%gs_Xh, &
444 string_val, json_subdict, i - 1)
445 else
446 ! If temperature is not found, other scalars
447 ! start from index 0
448 call set_scalar_ic( &
449 this%scalars%scalar_fields(i)%scalar%s, &
450 this%scalars%scalar_fields(i)%scalar%c_Xh, &
451 this%scalars%scalar_fields(i)%scalar%gs_Xh, &
452 string_val, json_subdict, i)
453 end if
454 end if
455 else
456 call set_scalar_ic(this%scalars%scalar_fields(i)%scalar%name,&
457 this%scalars%scalar_fields(i)%scalar%s, &
458 this%scalars%scalar_fields(i)%scalar%c_Xh, &
459 this%scalars%scalar_fields(i)%scalar%gs_Xh, &
460 this%user%initial_conditions)
461 end if
462 end do
463 end if
464
465 call neko_log%end_section()
466 end if
467
468 ! Add initial conditions to BDF scheme (if present)
469 select type (f => this%fluid)
470 type is (fluid_pnpn_t)
471 call f%ulag%set(f%u)
472 call f%vlag%set(f%v)
473 call f%wlag%set(f%w)
474 end select
475
476 !
477 ! Validate that the case is properly setup for time-stepping
478 !
479 call this%fluid%validate
480
481 if (scalar) then
482 call this%scalars%validate()
483 end if
484
485 !
486 ! Get and process output directory
487 !
488 call json_get_or_default(this%params, 'case.output_directory',&
489 this%output_directory, '')
490
491 output_dir_len = len(trim(this%output_directory))
492 if (output_dir_len .gt. 0) then
493 if (this%output_directory(output_dir_len:output_dir_len) .ne. "/") then
494 this%output_directory = trim(this%output_directory)//"/"
495 end if
496 if (pe_rank .eq. 0) then
497 call mkdir(trim(this%output_directory))
498 end if
499 end if
500
501 !
502 ! Save mesh partitions (if requested)
503 !
504 call json_get_or_default(this%params, 'case.output_partitions',&
505 logical_val, .false.)
506 if (logical_val) then
507 call msh_part%init(this%msh, 'MPI_Rank')
508 msh_part%data = pe_rank
509 call part_file%init(trim(this%output_directory)//'partitions.vtk')
510 call part_file%write(msh_part)
511 call msh_part%free()
512 end if
513
514 !
515 ! Setup output precision of the field files
516 !
517 call json_get_or_default(this%params, 'case.output_precision', string_val,&
518 'single')
519
520 if (trim(string_val) .eq. 'double') then
521 precision = dp
522 else
523 precision = sp
524 end if
525
526 !
527 ! Setup output layout of the field bp file
528 !
529 call json_get_or_lookup_or_default(this%params, 'case.output_layout', &
530 layout, 1)
531
532 !
533 ! Setup output_controller
534 !
535 call json_get_or_default(this%params, 'case.fluid.output_filename', &
536 name, "field")
537 call json_get_or_default(this%params, 'case.fluid.output_format', &
538 file_format, 'fld')
539 call json_get_or_default(this%params, &
540 'case.fluid.output_mesh_in_all_files', &
541 logical_val, .false.)
542
543 ! To ensure we don't miss saving the mesh for ALE.
544 call json_get_or_default(this%params, 'case.fluid.ale.enabled', &
545 tmp_feature, .false.)
546 if (tmp_feature) logical_val = .true.
547
548 call this%output_controller%init(this%time%end_time)
549 if (scalar) then
550 call this%f_out%init(precision, this%fluid, this%scalars, name = name, &
551 path = trim(this%output_directory), &
552 fmt = trim(file_format), layout = layout, &
553 always_write_mesh = logical_val)
554 else
555 call this%f_out%init(precision, this%fluid, name = name, &
556 path = trim(this%output_directory), &
557 fmt = trim(file_format), layout = layout, &
558 always_write_mesh = logical_val)
559 end if
560
561 call json_get_or_default(this%params, 'case.fluid.output_subdivide', &
562 logical_val, .false.)
563 call this%f_out%file_%set_subdivide(logical_val)
564
565 call json_get(this%params, 'case.fluid.output_control', string_val)
566
567 if (trim(string_val) .eq. 'org') then
568 ! yes, it should be real_val below for type compatibility
569 call json_get_or_lookup(this%params, 'case.nsamples', integer_val)
570 double_val = real(integer_val, kind=dp)
571 call this%output_controller%add(this%f_out, double_val, 'nsamples')
572 else if (trim(string_val) .eq. 'never') then
573 call this%output_controller%add(this%f_out, 0.0_dp, 'never')
574 else if (trim(string_val) .eq. 'tsteps' .or. &
575 trim(string_val) .eq. 'nsamples') then
576 call json_get_or_lookup(this%params, 'case.fluid.output_value', &
577 integer_val)
578 double_val = real(integer_val, kind=dp)
579 call this%output_controller%add(this%f_out, double_val, string_val)
580 else if (trim(string_val) .eq. 'simulationtime') then
581 call json_get_or_lookup(this%params, 'case.fluid.output_value', &
582 double_val)
583 call this%output_controller%add(this%f_out, double_val, string_val)
584 else
585 call neko_log%error('Unknown output control type for the fluid: ' // &
586 trim(string_val))
587 end if
588
589 !
590 ! Save checkpoints (if nothing specified, default to saving at end of sim)
591 !
592 call json_get(this%params, 'case.output_checkpoints', logical_val)
593 if (logical_val) then
594 call json_get_or_default(this%params, 'case.checkpoint_filename', &
595 name, "fluid")
596 call json_get_or_default(this%params, 'case.checkpoint_format', &
597 string_val, "chkp")
598 call this%chkp_out%init(this%chkp, name = name,&
599 path = this%output_directory, fmt = trim(string_val))
600 call json_get(this%params, 'case.checkpoint_control', &
601 string_val)
602 if (trim(string_val) .eq. 'tsteps' .or. &
603 trim(string_val) .eq. 'nsamples') then
604 call json_get_or_lookup(this%params, 'case.checkpoint_value', &
605 integer_val)
606 double_val = real(integer_val, kind=dp)
607 else if (trim(string_val) .eq. 'simulationtime') then
608 call json_get_or_lookup(this%params, 'case.checkpoint_value', &
609 double_val)
610 else if (trim(string_val) .eq. 'never') then
611 double_val = 0.0_rp
612 end if
613
614 call this%output_controller%add(this%chkp_out, double_val, string_val, &
616 end if
617
618 !
619 ! Setup joblimit
620 !
621 if (this%params%valid_path('case.job_timelimit')) then
622 call json_get(this%params, 'case.job_timelimit', string_val)
623 call jobctrl_set_time_limit(string_val)
624 end if
625
626 call neko_log%end_section()
627
628 call scalar_params%destroy()
629 call numerics_params%destroy()
630 call json_subdict%destroy()
631
632 nullify(vec)
633
634 end subroutine case_init_common
635
637 subroutine case_free(this)
638 class(case_t), intent(inout) :: this
639
640 if (allocated(this%fluid)) then
641 call this%fluid%free()
642 deallocate(this%fluid)
643 end if
644
645 if (allocated(this%scalars)) then
646 call this%scalars%free()
647 deallocate(this%scalars)
648 end if
649
650 call this%msh%free()
651
652 call this%f_out%free()
653
654 call this%output_controller%free()
655
656 if (allocated(this%output_directory)) then
657 deallocate(this%output_directory)
658 end if
659
660 end subroutine case_free
661
662end 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:638
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:62
integer, public pe_rank
MPI rank.
Definition comm.F90:59
type(mpi_comm), public neko_comm
MPI communicator.
Definition comm.F90:46
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=dp), parameter, public neko_eps_dp
Definition math.f90:71
Defines a mesh field.
Defines a mesh.
Definition mesh.f90:34
integer, parameter, public dp
Definition num_types.f90:10
integer, parameter, public sp
Definition num_types.f90:8
integer, parameter, public rp
Global precision used in computations.
Definition num_types.f90:14
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...