Dynamically allocates all arrays within the flow fields container.
Sizing is determined by the number of cells and faces in the provided mesh. All fields are initialized to zero upon allocation.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(mesh_t), | intent(in) | :: | mesh |
The mesh structure defining the domain size. |
||
| type(flow_fields_t), | intent(inout) | :: | fields |
The container to be allocated. |
subroutine allocate_fields(mesh, fields) type(mesh_t), intent(in) :: mesh type(flow_fields_t), intent(inout) :: fields call finalize_fields(fields) allocate(fields%u(3, mesh%ncells)) allocate(fields%u_old(3, mesh%ncells)) allocate(fields%u_star(3, mesh%ncells)) allocate(fields%p(mesh%ncells)) allocate(fields%phi(mesh%ncells)) allocate(fields%div(mesh%ncells)) allocate(fields%face_flux(mesh%nfaces)) allocate(fields%rhs_old(3, mesh%ncells)) fields%u = zero fields%u_old = zero fields%u_star = zero fields%p = zero fields%phi = zero fields%div = zero fields%face_flux = zero fields%rhs_old = zero fields%rhs_old_valid = .false. end subroutine allocate_fields