17 include
"visitfortransimV2interface.inc"
22 integer runflag, endflag
23 common /simstate/ runflag, endflag
26 integer par_rank, par_size
27 common /parallel/ par_rank, par_size
43 if(par_size.gt.1)
then
44 err = visitsetparallel(1)
46 err = visitsetparallelrank(par_rank)
53 if(par_rank.eq.0)
then
54 err = visitinitializesim(
"nek5000", 7,
55 .
"Nek5000 Simulation", 18,
56 .
"/no/useful/path", 15,
57 . visit_f77nullstring, visit_f77nullstringlen,
58 . visit_f77nullstring, visit_f77nullstringlen,
59 . visit_f77nullstring, visit_f77nullstringlen)
73 character (len=80) str
74 integer err, i, N, len
75 integer visitsetoptions, visitsetdirectory, visitopentracefile
82 if(str.eq.
"-dir")
then
84 err = visitsetdirectory(str, len)
86 elseif(str.eq.
"-options")
then
88 err = visitsetoptions(str, len)
90 elseif(str.eq.
"-trace")
then
92 err = visitopentracefile(str, len)
106 include
"visitfortransimV2interface.inc"
108 integer par_rank, par_size
109 common /parallel/ par_rank, par_size
110 integer command, e, doloop, success, ret
111 integer visit_command_process
112 integer visit_command_success
113 integer visit_command_failure
114 parameter(visit_command_process = 0)
115 parameter(visit_command_success = 1)
116 parameter(visit_command_failure = 2)
118 if(par_rank.eq.0)
then
119 success = visitprocessenginecommand()
121 if(success.gt.0)
then
122 command = visit_command_success
125 command = visit_command_failure
129 call mpi_bcast(command,1,mpi_integer,0,mpi_comm_world,e)
132 2345
call mpi_bcast(command,1,mpi_integer,0,mpi_comm_world,e)
133 if(command.eq.visit_command_process)
then
134 success = visitprocessenginecommand()
135 elseif(command.eq.visit_command_success)
then
156 include
"visitfortransimV2interface.inc"
158 integer processvisitcommand
160 integer visitstate, result, blocking, ierr
162 integer runflag, endflag
163 common /simstate/ runflag, endflag
165 integer par_rank, par_size
166 common /parallel/ par_rank, par_size
169 if(endflag.eq.0)
then
171 result = visitisconnected()
174 result = visittimestepchanged()
176 result = visitupdateplots()
181 2000
format(
'VisIt Check!')
184 if(runflag.eq.1)
then
192 if(par_rank.eq.0)
then
193 visitstate = visitdetectinput(blocking, -1)
195 call mpi_bcast(visitstate,1,mpi_integer,0,mpi_comm_world,ierr)
197 if (visitstate.eq.0)
then
200 elseif (visitstate.eq.1)
then
204 result = visitattemptconnection()
205 if (result.eq.1)
then
207 2001
format(
'VisIt connected!')
210 2002
format(
'VisIt did not connected!')
214 elseif (visitstate.eq.2)
then
218 if (processvisitcommand().eq.0)
then
219 result = visitdisconnect()
224 if(runflag.eq.2)
then
227 elseif (visitstate.eq.3)
then
229 elseif (visitstate.lt.0)
then
241 include
"visitfortransimV2interface.inc"
245 integer runflag, endflag
246 common /simstate/ runflag, endflag
249 result = visitisconnected()
261 if (endflag.eq.2)
then
282 character*8 cmd, args
284 include
"visitfortransimV2interface.inc"
286 integer runflag, endflag
287 common /simstate/ runflag, endflag
290 if(visitstrcmp(cmd, lcmd,
"stop", 4).eq.0)
then
292 elseif(visitstrcmp(cmd, lcmd,
"step", 4).eq.0)
then
294 elseif(visitstrcmp(cmd, lcmd,
"run", 3).eq.0)
then
296 elseif(visitstrcmp(cmd, lcmd,
"exit", 4).eq.0)
then
298 elseif(visitstrcmp(cmd, lcmd,
"finish", 6).eq.0)
then
299 if(endflag.eq.1)
then
312 integer value, sender, ierr
313 call mpi_bcast(
value,1,mpi_integer,sender,mpi_comm_world,ierr)
324 integer lstr, sender, ierr
325 call mpi_bcast(str,lstr,mpi_character,sender,mpi_comm_world,ierr)
335 integer c, ierr, VISIT_COMMAND_PROCESS
336 parameter(visit_command_process = 0)
337 c = visit_command_process
338 call mpi_bcast(c, 1, mpi_integer, 0, mpi_comm_world, ierr)
346 include
"visitfortransimV2interface.inc"
360 include
"visitfortransimV2interface.inc"
362 integer runflag, endflag
363 common /simstate/ runflag, endflag
365 integer par_rank, par_size
366 common /parallel/ par_rank, par_size
368 integer md, mmd, vmd, cmd, emd, err, idim, k
369 character*3 seqstring
371 if(visitmdsimalloc(md).eq.visit_okay)
then
372 err = visitmdsimsetcycletime(md, istep, time)
373 if(runflag.eq.1)
then
374 err = visitmdsimsetmode(md, visit_simmode_running)
376 err = visitmdsimsetmode(md, visit_simmode_stopped)
389 if(visitmdmeshalloc(mmd).eq.visit_okay)
then
390 err = visitmdmeshsetname(mmd,
"mesh", 4)
391 err = visitmdmeshsetmeshtype(mmd,
392 . visit_meshtype_curvilinear)
393 err = visitmdmeshsettopologicaldim(mmd, idim)
394 err = visitmdmeshsetspatialdim(mmd, idim)
395 err = visitmdmeshsetnumdomains(mmd, nelgt)
396 err = visitmdmeshsetdomaintitle(mmd,
"Domains", 7)
397 err = visitmdmeshsetdomainpiecename(mmd,
"domain", 6)
400 err = visitmdmeshsetxlabel(mmd,
"X-Axis", 6)
401 err = visitmdmeshsetylabel(mmd,
"Y-Axis", 6)
404 err = visitmdmeshsetzlabel(mmd,
"Z-Axis", 6)
406 err = visitmdsimaddmesh(md, mmd)
412 if(visitmdvaralloc(vmd).eq.visit_okay)
then
413 err = visitmdvarsetname(vmd,
"x_velocity", 10)
414 err = visitmdvarsetmeshname(vmd,
"mesh", 4)
416 err = visitmdvarsetcentering(vmd, visit_varcentering_node)
417 err = visitmdvarsettype(vmd, visit_vartype_scalar)
419 err = visitmdsimaddvariable(md, vmd)
423 if(visitmdvaralloc(vmd).eq.visit_okay)
then
424 err = visitmdvarsetname(vmd,
"y_velocity", 10)
425 err = visitmdvarsetmeshname(vmd,
"mesh", 4)
427 err = visitmdvarsetcentering(vmd, visit_varcentering_node)
428 err = visitmdvarsettype(vmd, visit_vartype_scalar)
430 err = visitmdsimaddvariable(md, vmd)
435 if(visitmdvaralloc(vmd).eq.visit_okay)
then
436 err = visitmdvarsetname(vmd,
"z_velocity", 10)
437 err = visitmdvarsetmeshname(vmd,
"mesh", 4)
439 err = visitmdvarsetcentering(vmd, visit_varcentering_node)
440 err = visitmdvarsettype(vmd, visit_vartype_scalar)
442 err = visitmdsimaddvariable(md, vmd)
447 if(visitmdexpralloc(emd).eq.visit_okay)
then
448 err = visitmdexprsetname(emd,
"velocity", 8)
450 err = visitmdexprsetdefinition(emd,
451 .
"{x_velocity, y_velocity, z_velocity}", 36)
453 err = visitmdexprsetdefinition(emd,
454 .
"{x_velocity, y_velocity}", 24)
456 err = visitmdexprsettype(emd, visit_vartype_vector)
458 err = visitmdsimaddexpression(md, emd)
462 if(visitmdexpralloc(emd).eq.visit_okay)
then
463 err = visitmdexprsetname(emd,
"velocity_mag", 12)
464 err = visitmdexprsetdefinition(emd,
465 .
"magnitude(velocity)", 19)
466 err = visitmdexprsettype(emd, visit_vartype_scalar)
468 err = visitmdsimaddexpression(md, emd)
474 if(visitmdvaralloc(vmd).eq.visit_okay)
then
475 err = visitmdvarsetname(vmd,
"pressure", 8)
476 err = visitmdvarsetmeshname(vmd,
"mesh", 4)
478 err = visitmdvarsetcentering(vmd, visit_varcentering_node)
479 err = visitmdvarsettype(vmd, visit_vartype_scalar)
481 err = visitmdsimaddvariable(md, vmd)
487 if(visitmdvaralloc(vmd).eq.visit_okay)
then
488 err = visitmdvarsetname(vmd,
"temperature", 11)
489 err = visitmdvarsetmeshname(vmd,
"mesh", 4)
491 err = visitmdvarsetcentering(vmd, visit_varcentering_node)
492 err = visitmdvarsettype(vmd, visit_vartype_scalar)
494 err = visitmdsimaddvariable(md, vmd)
501 if(visitmdvaralloc(vmd).eq.visit_okay)
then
502 write (seqstring,
'(I0)') k
503 err = visitmdvarsetname(vmd,
"s"//trim(seqstring),
504 . 1+len_trim(seqstring))
505 err = visitmdvarsetmeshname(vmd,
"mesh", 4)
507 err = visitmdvarsetcentering(vmd, visit_varcentering_node)
508 err = visitmdvarsettype(vmd, visit_vartype_scalar)
510 err = visitmdsimaddvariable(md, vmd)
517 err = visitmdcmdalloc(cmd)
518 if(err.eq.visit_okay)
then
519 err = visitmdcmdsetname(cmd,
"stop", 4)
520 err = visitmdsimaddgenericcommand(md, cmd)
522 err = visitmdcmdalloc(cmd)
523 if(err.eq.visit_okay)
then
524 err = visitmdcmdsetname(cmd,
"step", 4)
525 err = visitmdsimaddgenericcommand(md, cmd)
527 err = visitmdcmdalloc(cmd)
528 if(err.eq.visit_okay)
then
529 err = visitmdcmdsetname(cmd,
"run", 3)
530 err = visitmdsimaddgenericcommand(md, cmd)
532 err = visitmdcmdalloc(cmd)
533 if(err.eq.visit_okay)
then
534 err = visitmdcmdsetname(cmd,
"exit", 4)
535 err = visitmdsimaddgenericcommand(md, cmd)
537 err = visitmdcmdalloc(cmd)
538 if(err.eq.visit_okay)
then
539 err = visitmdcmdsetname(cmd,
"finish", 6)
540 err = visitmdsimaddgenericcommand(md, cmd)
554 integer domain, lname
555 include
"visitfortransimV2interface.inc"
558 integer vh, x, y, z, err, dl, dmdims(3)
560 vh = visit_invalid_handle
564 domain =
gllel(domain + 1)
566 if(visitstrcmp(name, lname,
"mesh", 4).eq.0)
then
567 if(visitcurvmeshalloc(vh).eq.visit_okay)
then
568 err = visitvardataalloc(x)
569 err = visitvardataalloc(y)
570 if(if3d) err = visitvardataalloc(z)
573 err = visitvardatasetd(x, visit_owner_sim, 1, dl,
575 err = visitvardatasetd(y, visit_owner_sim, 1, dl,
578 err = visitvardatasetd(z, visit_owner_sim, 1, dl,
586 err = visitcurvmeshsetcoordsxyz(vh, dmdims, x, y, z)
588 err = visitcurvmeshsetcoordsxy(vh, dmdims, x, y)
603 integer domain, lname
604 include
"visitfortransimV2interface.inc"
617 integer gdomain, lname
618 include
"visitfortransimV2interface.inc"
620 integer h, nvals, err, domain, k
622 nvals = lx1 * ly1 * lz1
624 h = visit_invalid_handle
628 gdomain = gdomain + 1
629 domain =
gllel(gdomain)
631 if(visitvardataalloc(h).eq.visit_okay)
then
632 if(visitstrcmp(name, lname,
"temperature", 11).eq.0)
then
633 err = visitvardatasetd(h, visit_owner_sim, 1, nvals,
635 elseif(visitstrcmp(name, lname,
"pressure", 8).eq.0)
then
636 if(gdomain.le.nelgv)
then
637 err = visitvardatasetd(h, visit_owner_sim, 1, nvals,
640 elseif(visitstrcmp(name, lname,
"x_velocity", 10).eq.0)
then
641 if(gdomain.le.nelgv)
then
642 err = visitvardatasetd(h, visit_owner_sim, 1, nvals,
645 elseif(visitstrcmp(name, lname,
"y_velocity", 10).eq.0)
then
646 if(gdomain.le.nelgv)
then
647 err = visitvardatasetd(h, visit_owner_sim, 1, nvals,
650 elseif(visitstrcmp(name, lname,
"z_velocity", 10).eq.0)
then
651 if(gdomain.le.nelgv)
then
652 err = visitvardatasetd(h, visit_owner_sim, 1, nvals,
655 elseif(visitstrcmp(
"s", 1, name, 1).eq.0)
then
657 read( name(2:lname),
'(i10)' ) k
660 err = visitvardatasetd(h, visit_owner_sim, 1, nvals,
676 integer handle, lname
677 include
"visitfortransimV2interface.inc"
688 include
"visitfortransimV2interface.inc"
692 h = visit_invalid_handle
694 if(visitdomainlistalloc(h).eq.visit_okay)
then
695 if(visitvardataalloc(dl).eq.visit_okay)
then
699 lglel(i) = lglel(i) - 1
701 err = visitvardataseti(dl, visit_owner_copy,1,nelt,lglel)
702 err = visitdomainlistsetdomains(h, nelgt, dl)
705 lglel(i) = lglel(i) + 1
721 include
"visitfortransimV2interface.inc"
733 include
"visitfortransimV2interface.inc"
745 integer domain, lname
746 include
"visitfortransimV2interface.inc"
integer function gllel(ieg)
subroutine mpi_comm_rank(comm, me, ierror)
subroutine mpi_comm_size(comm, nprocs, ierror)
subroutine mpi_bcast(data, n, datatype, node, comm, ierror)
integer function visitgetvariable(gdomain, name, lname)
integer function visitactivatetimestep()
integer function visitgetcurve(handle, name, lname)
integer function visitgetmaterial(domain, name, lname)
subroutine simulationarguments()
integer function processvisitcommand()
integer function visitgetdomainbounds(name, lname)
integer function visitgetmesh(domain, name, lname)
integer function visitgetmetadata()
integer function visitgetdomainlist()
integer function visitgetdomainnesting(name, lname)
integer function visitgetmixedvariable(domain, name, lname)
subroutine visitcommandcallback(cmd, lcmd, args, largs)
integer function visitbroadcaststringfunction(str, lstr, sender)
subroutine visitslaveprocesscallback()
integer function visitbroadcastintfunction(value, sender)