Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
thermal_initialize.f90
Go to the documentation of this file.
1 
2 
3 !!****
4 !!
5 !! NAME
6 !! thermal_initialize
7 !!
8 !! FUNCTION
9 !! Creates all of the data structures and matrices needed
10 !! by the implicit thermal solver
11 !!
12 !! INPUTS
13 !! none
14 !!
15 !! OUTPUTS
16 !! none
17 !!
18 !! USES
19 !! MPI
20 !!
21 !!****
22 
23 SUBROUTINE thermal_initialize(global)
24 
25  USE implicit_global
27 
28  IMPLICIT NONE
29 
30  TYPE(rocfrac_global) :: global
31  INTEGER :: i, j, m
32 
33  ! ... Set up the global to local node mapping
34  ! ... GNumNP is the number of nodes in the entire model
35  ! ... global%NumNP is the number of node points that
36  ! ... this process knows about.
37  ! ... Node points that are represented by GNumNP but
38  ! ... are not known ot this process (NumNP) are represented
39  ! ... in the Global2Local array by the value -1.
40 
41  ALLOCATE(global2local(1:gnumnp))
42  global2local(:) = -1
43  DO i = 1, global%NumNP
44  global2local(local2global(i)) = i
45  ENDDO
46 
47 
48 
49  ! ... Initialize MPI communications
50 
51  ! ... InitComm1 sets up variables that aid in communication
52  ! ... of boundary nodes on one process to the process that
53  ! ... owns that node. Usefull in constructing capacitance and
54  ! ... stiffness matrices.
55 
56  ! ... InitComm2 sets up variables that aid in communication
57  ! ... of nodes owned by one process to the processes that contain
58  ! ... those nodes in their partition. Usefull in constructing
59  ! ... internal load vector.
60 
61  IF(myid==0) print*,'INITIALIZING COMMUNICATIONS'
62  IF (nprocs > 1) THEN
63  CALL initcomm1(global)
64  CALL initcomm2(global)
65  ENDIF
66 
67 
68 
69  ! ... Set up some constants
70  ! ... nstart_ktc is the 1st node number that this process is
71  ! ... responsible for. nrows_ktc is the number of rows of the
72  ! ... capacitance and stiffness matrices owned by this process.
73 
74  nstart_ktc = gnumnp
75  DO m = 1, gnumnp
76  DO i = 1, global%NumNp
77  IF (local2global(i) == m) THEN
78  IF (nodeproc(i) == myid) THEN
79  nstart_ktc = min(nstart_ktc,local2global(i))
80  ENDIF
81  ENDIF
82  ENDDO
83  ENDDO
84 
85  nrows_ktc = lnumnp
86 
87  ! ... Set up the nodal DOF vectors
88  ! ... Need to do more research on this
89 
90  ALLOCATE(node_flag(1:global%NumNp,1:3))
91  ALLOCATE(boundary_value(1:global%NumNp,1:3))
92  node_flag(1:global%NumNp,1) = 0
93  DO i = 1, global%NumNdsBCHT
94  IF ( global%BCFlagHT(2,i) == 0 ) THEN
95  node_flag(global%BCFlagHT(1,i),1:3) = 8
96  boundary_value(global%BCFlagHT(1,i),1:3) = global%BCvalueHT(1,i)
97  ENDIF
98  IF ( global%BCFlagHT(2,i) == 1 ) THEN
99  node_flag(global%BCFlagHT(1,i),1:3) = 7
100  boundary_value(global%BCFlagHT(1,i),1:3) = global%BCvalueHT(1,i)
101  ENDIF
102  ENDDO
103 
104 
105  ! ... Create the global thermal capacitance matrix
106  CALL glbthermcap(global)
107 
108  ! ... Create the global thermal stiffness matrix
109  CALL glbthermstiff(global)
110 
111 
112 
113 END SUBROUTINE thermal_initialize
FT m(int i, int j) const
subroutine initcomm1(global)
Definition: InitComm.f90:74
subroutine glbthermcap(global)
Definition: GlbThermCap.f90:22
subroutine initcomm2(global)
Definition: InitComm.f90:265
subroutine thermal_initialize(global)
subroutine glbthermstiff(global)
blockLoc i
Definition: read.cpp:79
virtual std::ostream & print(std::ostream &os) const
Vector_n min(const Array_n_const &v1, const Array_n_const &v2)
Definition: Vector_n.h:346
j indices j
Definition: Indexing.h:6