DCS
a Driven-Cavity Open source Simulator code
 All Classes Files Functions Variables Groups Pages
Data_Type_Face.f90
Go to the documentation of this file.
1 
6 
12 
18 
24 
26 module data_type_face
27 !-----------------------------------------------------------------------------------------------------------------------------------
28 USE ir_precision ! Integers and reals precision definition.
29 USE data_type_node ! Definition of Type_Node.
30 USE data_type_vector ! Definition of Type_Vector.
31 !-----------------------------------------------------------------------------------------------------------------------------------
32 
33 !-----------------------------------------------------------------------------------------------------------------------------------
34 private
35 !-----------------------------------------------------------------------------------------------------------------------------------
36 
37 !-----------------------------------------------------------------------------------------------------------------------------------
40 type, public:: type_face
41  type(type_node_ptr):: node(1:2)
42  type(type_vector), pointer:: n
43  real(R8P), pointer:: s => null()
44  contains
45  procedure, non_overridable:: initialize ! Procedure for initializing Type_Face.
46  procedure, non_overridable:: finalize ! Procedure for finalizing Type_Face.
47  procedure, non_overridable:: pprint ! Procedure for printing Type_Face components with a "pretty" format.
48 endtype type_face
51 type, public:: type_face_ptr
52  type(type_face), pointer:: p => null()
53 endtype type_face_ptr
54 !-----------------------------------------------------------------------------------------------------------------------------------
55 contains
59 
63  subroutine initialize(self,node1,node2,N,S)
64  !---------------------------------------------------------------------------------------------------------------------------------
65  implicit none
66  class(type_face), intent(INOUT):: self
67  type(type_node), pointer, intent(IN):: node1
68  type(type_node), pointer, intent(IN):: node2
69  type(type_vector), pointer, intent(IN):: n
70  real(R8P), pointer, intent(IN):: s
71  !---------------------------------------------------------------------------------------------------------------------------------
72 
73  !---------------------------------------------------------------------------------------------------------------------------------
74  self%node(1)%p => node1
75  self%node(2)%p => node2
76  self%N => n
77  self%S => s
78  return
79  !---------------------------------------------------------------------------------------------------------------------------------
80  endsubroutine initialize
81 
83  subroutine finalize(self)
84  !---------------------------------------------------------------------------------------------------------------------------------
85  implicit none
86  class(type_face), intent(INOUT):: self
87  integer(I4P):: n
88  !---------------------------------------------------------------------------------------------------------------------------------
89 
90  !---------------------------------------------------------------------------------------------------------------------------------
91  do n=lbound(self%node,dim=1),ubound(self%node,dim=1)
92  if (associated(self%node(n)%p)) deallocate(self%node(n)%p) ; self%node(n)%p => null()
93  enddo
94  if (associated(self%N)) deallocate(self%N) ; self%N => null()
95  if (associated(self%S)) deallocate(self%S) ; self%S => null()
96  return
97  !---------------------------------------------------------------------------------------------------------------------------------
98  endsubroutine finalize
99 
102  function pprint(self,unit) result(err)
103  !---------------------------------------------------------------------------------------------------------------------------------
104  implicit none
105  class(type_face), intent(IN):: self
106  integer(I4P), intent(IN):: unit
107  integer(I4P):: err
108  integer(I4P):: n
109  !---------------------------------------------------------------------------------------------------------------------------------
110 
111  !---------------------------------------------------------------------------------------------------------------------------------
112  write(unit,'(A)',iostat=err)' Nodes data:'
113  do n=lbound(self%node,dim=1),ubound(self%node,dim=1)
114  if (associated(self%node(n)%p)) then
115  write(unit,'(A)',iostat=err)' n='//trim(str(n=n))
116  err = self%node(n)%p%pprint(unit=unit)
117  endif
118  enddo
119  if (associated(self%N)) then
120  write(unit,'(A)',iostat=err)' Face outward unit normal:'
121  write(unit,'(A)',iostat=err)' x='//trim(str(n=self%N%x))//' y='//trim(str(n=self%N%y))//' z='//trim(str(n=self%N%z))
122  endif
123  write(unit,'(A)',iostat=err)' Face area='//trim(str(n=self%S))
124  return
125  !---------------------------------------------------------------------------------------------------------------------------------
126  endfunction pprint
128 endmodule data_type_face
Derived type containing conservative variables.
procedure, non_overridable finalize
This module contains the definition of Type_Node and its procedures.
Pointer of Type_Face for creating array of pointers of Type_Face.
This module contains the definition of Type_Face and its procedures.
Derived type containing conservative variables.
Derived type defining vectors.
Procedure for converting number, real and integer, to string (number to string type casting); logical...
This module contains the definition of Type_Vector and its procedures.
procedure, non_overridable initialize
procedure, non_overridable pprint
Pointer of Type_Node for creating array of pointers of Type_Node.
Module IR_Precision makes available some portable kind-parameters and some useful procedures to deal ...