Changeset bd99c62
- Timestamp:
- 12/08/10 12:36:24 (2 years ago)
- Branches:
- master, external, fix-prolong, refactor, refactor-ext, refactor-subsolvers
- Children:
- dd63f9f
- Parents:
- f2101f9
- git-author:
- Oleg Batrashev <ogbash@…> (12/08/10 12:36:24)
- git-committer:
- Oleg Batrashev <ogbash@…> (12/08/10 12:36:24)
- Location:
- src
- Files:
-
- 2 edited
-
datatypes/Mesh.F90 (modified) (8 diffs)
-
main/main_drivers.F90 (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/datatypes/Mesh.F90
r0bd2cda rbd99c62 243 243 end function Mesh_newInit 244 244 245 246 !----------------------------------------------------------247 !! Allocates Mesh's main data248 !----------------------------------------------------------249 subroutine Mesh_allocate(M, &250 nfrelt, &251 mhead, &252 freemap, &253 coords, &254 eptnmap, &255 freemask)256 implicit none257 258 type(Mesh), intent(in out) :: M259 logical, intent(in), optional :: nfrelt, mhead, freemap260 logical, intent(in), optional :: coords, eptnmap, freemask261 logical :: all=.false.262 if (.not.present(nfrelt) .and.&263 (.not.present(mhead)) .and.&264 (.not.present(freemap)).and.&265 (.not.present(coords)) .and.&266 (.not.present(eptnmap)) .and.&267 (.not.present(freemask))) then268 if (.not.associated(M%nfrelt)) allocate(M%nfrelt(M%nell))269 if (.not.associated(M%mhead)) allocate(M%mhead(M%mfrelt,M%nell))270 if (.not.associated(M%freemap)) allocate(M%freemap(M%ngf))271 if (.not.associated(M%coords)) allocate(M%coords(M%nsd,M%nnode))272 if (.not.associated(M%eptnmap)) allocate(M%eptnmap(M%nell))273 if (.not.associated(M%freemask)) allocate(M%freemask(M%ngf))274 all = .true.275 end if276 277 if (present(nfrelt) .and.(.not.all).and.&278 (.not.associated(M%nfrelt))) allocate(M%nfrelt(M%nell))279 if (present(mhead) .and.(.not.all).and.&280 (.not.associated(M%mhead))) allocate(M%mhead(M%mfrelt,M%nell))281 if (present(freemap) .and.(.not.all).and.&282 (.not.associated(M%freemap))) allocate(M%freemap(M%ngf))283 if (present(coords) .and.(.not.all).and.&284 (.not.associated(M%coords))) allocate(M%coords(M%nsd,M%nnode))285 if (present(eptnmap) .and.(.not.all).and.&286 (.not.associated(M%eptnmap))) allocate(M%eptnmap(M%nell))287 if (present(freemask).and.(.not.all).and.&288 (.not.associated(M%freemask))) allocate(M%freemask(M%ngf))289 290 end subroutine Mesh_allocate291 292 293 245 !------------------------- 294 246 !! Destructor … … 387 339 nnode=ngf 388 340 call Mesh_Init(M, nell, ngf, nsd, mfrelt, nnode) 389 call Mesh_allocate(M,coords=.true.,freemap=.true.) ! needing the coords...341 allocate(M%coords(M%nsd,M%nnode),M%freemap(M%ngf)) ! needing the coords... 390 342 M%freemap= (/ (i,i=1,ngf) /) 391 343 do j=1,n … … 1503 1455 end do 1504 1456 else 1457 if (.NOT.associated(M%nfrelt)) allocate(M%nfrelt(M%nell)) 1505 1458 call MPI_RECV(M%nfrelt, M%nell, MPI_INTEGER, & 1506 1459 D_MASTER, D_TAG_MESH_NFRELT, MPI_COMM_WORLD, status, ierr) … … 1516 1469 end do 1517 1470 else 1471 if (.NOT.associated(M%mhead)) allocate(M%mhead(M%mfrelt,M%nell)) 1518 1472 call MPI_RECV(M%mhead, M%mfrelt*M%nell, MPI_INTEGER, & 1519 1473 D_MASTER, D_TAG_MESH_MHEAD, MPI_COMM_WORLD, status, ierr) … … 1529 1483 end do 1530 1484 else 1485 if (.not.associated(M%freemap)) allocate(M%freemap(M%ngf)) 1531 1486 call MPI_RECV(M%freemap, M%ngf, MPI_INTEGER, & 1532 1487 D_MASTER, D_TAG_MESH_FREEMASK, MPI_COMM_WORLD, status, ierr) … … 1542 1497 end do 1543 1498 else 1499 if (.not.associated(M%coords)) allocate(M%coords(M%nsd,M%nnode)) 1544 1500 call MPI_RECV(M%coords, M%nnode*M%nsd, MPI_xyzkind, & 1545 1501 D_MASTER, D_TAG_MESH_FREEMASK, MPI_COMM_WORLD, status, ierr) … … 1555 1511 end do 1556 1512 else 1513 if (.not.associated(M%eptnmap)) allocate(M%eptnmap(M%nell)) 1557 1514 call MPI_RECV(M%eptnmap, M%nell, MPI_INTEGER, & 1558 1515 D_MASTER, D_TAG_MESH_EPTNMAP, MPI_COMM_WORLD, status, ierr) … … 1592 1549 end do 1593 1550 else 1551 if (.not.associated(M%freemask)) allocate(M%freemask(M%ngf)) 1594 1552 call MPI_RECV(M%freemask, M%ngf, MPI_BYTE, & 1595 1553 D_MASTER, D_TAG_MESH_FREEMASK, MPI_COMM_WORLD, status, ierr) -
src/main/main_drivers.F90
r848affb rbd99c62 88 88 type(SpMtx),intent(in out),optional :: A_interf !< matrix at interface 89 89 90 if (ismaster()) then ! MASTER 91 write(stream,*) 92 write(stream,*) 'master thread' 93 if (D_MSGLVL > 1) & 94 call MasterCtrlData_print() 95 96 else ! SLAVES 97 write(stream,'(a,i4,a)') 'slave [',myrank,'] thread' 98 if (D_MSGLVL > 1) & 99 call SharedCtrlData_print() 100 end if 101 90 102 ! ======================= 91 103 ! Mesh and its Dual Graph … … 93 105 ! 94 106 ! Create Mesh object 107 95 108 Msh = Mesh_New() 96 109 97 if (ismaster()) then ! MASTER 98 write(stream,*) 99 write(stream,*) 'master thread' 100 101 if (D_MSGLVL > 1) & 102 call MasterCtrlData_print() 103 110 if (ismaster()) then 104 111 ! Initialise Mesh object 105 112 call Mesh_initFromFile(Msh, trim(mctls%info_file)) 106 107 else ! SLAVES 108 write(stream,'(a,i4,a)') 'slave [',myrank,'] thread' 109 110 if (D_MSGLVL > 1) & 111 call SharedCtrlData_print() 112 end if 113 endif 113 114 114 115 ! Get from master Mesh's parameters: nell, ngf, mfrelt, nsd, nnode … … 116 117 if (D_MSGLVL > 1) & 117 118 call Mesh_printInfo(Msh) 118 119 ! Allocate data arrays (nfrelt, mhead, freemap, eptnmap) for mesh120 call Mesh_allocate(Msh, &121 nfrelt =.true., &122 mhead =.true., &123 freemap =.true., &124 eptnmap =.true.)125 119 126 120 ! Master reads in from files: feedom lists, coordinates, freedom map … … 141 135 ! For multi-variable problems which have more than one block 142 136 if (sctls%number_of_blocks > 1) then 143 call Mesh_allocate(Msh, freemask=.true.)144 137 if (ismaster()) then 145 138 call Mesh_readFromFile(Msh, &
Note: See TracChangeset
for help on using the changeset viewer.
