Neko 0.9.99
A portable framework for high-order spectral element flow simulations
Loading...
Searching...
No Matches
non_normal.f90
Go to the documentation of this file.
1! Copyright (c) 2020-2021, 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
36 use symmetry, only : symmetry_t
37 use num_types, only : rp
38 use tuple, only : tuple_i4_t
39 use coefs, only : coef_t
40 use, intrinsic :: iso_c_binding
41 implicit none
42 private
43
46 type, public, extends(symmetry_t) :: non_normal_t
47 contains
49 procedure, pass(this) :: init => non_normal_init
51 procedure, pass(this) :: init_from_components => &
54 procedure, pass(this) :: free => non_normal_free
56 procedure, pass(this) :: finalize => non_normal_finalize
57 end type non_normal_t
58
59contains
60
64 subroutine non_normal_init(this, coef, json)
65 class(non_normal_t), target, intent(inout) :: this
66 type(coef_t), intent(in) :: coef
67 type(json_file), intent(inout) ::json
68
69 call this%init_from_components(coef)
70 end subroutine non_normal_init
71
74 subroutine non_normal_init_from_components(this, coef)
75 class(non_normal_t), target, intent(inout) :: this
76 type(coef_t), intent(in) :: coef
77
78 call this%free()
79 call this%symmetry_t%init_from_components(coef)
80
82
84 subroutine non_normal_finalize(this)
85 class(non_normal_t), target, intent(inout) :: this
86 integer :: i, j, k, l
87 type(tuple_i4_t), pointer :: bfp(:)
88 real(kind=rp) :: sx, sy, sz
89 real(kind=rp), parameter :: tol = 1d-3
90 type(tuple_i4_t) :: bc_facet
91 integer :: facet, el
92
93 associate(c => this%coef, nx => this%coef%nx, ny => this%coef%ny, &
94 nz => this%coef%nz)
95 bfp => this%marked_facet%array()
96 do i = 1, this%marked_facet%size()
97 bc_facet = bfp(i)
98 facet = bc_facet%x(1)
99 el = bc_facet%x(2)
100 call this%get_normal_axis(sx, sy, sz, facet, el)
101
102 if (sx .lt. tol) then
103 call this%bc_y%mark_facet(facet, el)
104 call this%bc_z%mark_facet(facet, el)
105 end if
106
107 if (sy .lt. tol) then
108 call this%bc_x%mark_facet(facet, el)
109 call this%bc_z%mark_facet(facet, el)
110 end if
111
112 if (sz .lt. tol) then
113 call this%bc_y%mark_facet(facet, el)
114 call this%bc_x%mark_facet(facet, el)
115 end if
116 end do
117 end associate
118 call this%bc_x%finalize()
119 call this%bc_y%finalize()
120 call this%bc_z%finalize()
121
122 call this%finalize_base()
123 end subroutine non_normal_finalize
124
126 subroutine non_normal_free(this)
127 class(non_normal_t), target, intent(inout) :: this
128
129 call this%symmetry_t%free()
130 end subroutine non_normal_free
131end module non_normal
Coefficients.
Definition coef.f90:34
Dirichlet condition on axis aligned plane in the non normal direction.
subroutine non_normal_finalize(this)
Finalize.
subroutine non_normal_init_from_components(this, coef)
Constructor from components.
subroutine non_normal_init(this, coef, json)
Constructor.
subroutine non_normal_free(this)
Destructor.
integer, parameter, public rp
Global precision used in computations.
Definition num_types.f90:12
Mixed Dirichlet-Neumann axis aligned symmetry plane.
Definition symmetry.f90:34
Implements a n-tuple.
Definition tuple.f90:34
Coefficients defined on a given (mesh, ) tuple. Arrays use indices (i,j,k,e): element e,...
Definition coef.f90:55
Dirichlet condition in non normal direction of a plane.
Mixed Dirichlet-Neumann symmetry plane condition.
Definition symmetry.f90:49
Integer based 2-tuple.
Definition tuple.f90:51