paramesh amr_prolong(提升操作)
来源:互联网 发布:金蝶软件集团 编辑:程序博客网 时间:2024/05/17 03:15
amr_refine_derefine执行的操作
which_child(lnblocks2) = j在amr_refine_blocks中设定代表这是
父块的第几个子块(j为块的morton号)
Call amr_refine_blocks (nprocs, mype)
!-----refine blocks, create their children, the children's parents,
!-----turn the children on, and turn the parents off
Do i = 1,maxblocks_tr
newchild(i) = .False.
End Do
//把当前块的newchild标志设为false,这些不是新生成的子块
Do i = 1,lnblocks
If (refine(i)) Then ! refine block 'i' on this processor
Do j = 1,nchild ! create 'nchild' new child blocks for block 'i'
lnblocks2 = lnblocks2 + 1
child(1,j,i) = lnblocks2 ! child j's on-processor id
child(2,j,i) = mype ! child j's processor no.
lrefine(lnblocks2) = lrefine(i) + 1 ! refinement level of child
//把新生成的块的newchild标志设为true
newchild(lnblocks2) = .True. ! this is a new child
parent(1,lnblocks2) = i ! child j's parent
parent(2,lnblocks2) = mype ! child j's parent's processor
p_cache_addr(:) = -1初始值为-1
Do lreflevel = lref_min,lref_max
模块2
比如在不使用barsara方法的情况下,即prol_fc_dbz标志位false
对facevar变量进行提升操作(prolong)
iblock=0
lref_min = 100
lref_max = 1
If (lnblocks > 0) Then
Do lb = 1,lnblocks
If (newchild(lb)) Then
iblock = iblock+1
index(iblock) = lb
indx(iblock) = iblock
iblock初始为0,iblock记录的是新生成的子块数量,这些子块的数据需要提升操作而来
indx(iblock)即为该子块在所有新子块中为第几块
index(iblock)存的该新子块的原来的块号索引
If (iblock > 0) Then
Do lbi = 1,iblock
lb = index(indx(lbi))
//lb为新子块原来的块号索引
If (lrefine(lb) == lreflevel) Then
!------compute offset for child cell inside parent
ioff = mod(which_child(lb)-1,2)*nxb/2
joff = mod((which_child(lb)-1)/2,2)*nyb/2
koff = mod((which_child(lb)-1)/4,2)*nzb/2
需计算子块在父块中所处的位置
!------get address of parent block
parent_blk = parent(1,lb)
parent_pe = parent(2,lb)
获取父块的块号与父块所在的cpu
这一段就是对facevar变量的插值提升操作,这里的facevarx1是父节点的数据,应该是在之前调用的amr_1blk_guardcell的时候保存到facevarx1,facevary1这些暂存变量的吧
Else
!--------prolong using other methods!--------x-face
recvf(1:nfacevar, il_bnd1:iu_bnd1+1, &
jl_bnd1:ju_bnd1,kl_bnd1:ku_bnd1) &
= facevarx1(1:nfacevar, il_bnd1:iu_bnd1+1, &
jl_bnd1:ju_bnd1,kl_bnd1:ku_bnd1, 1)
Call amr_1blk_fc_prol_gen_fun(recvf, &
ia,ib+1,ja,jb,ka,kb,idest,ioff,joff,koff, &
mype,lb,parent_pe,parent_blk,1)
If (ndim > 1) Then
!--------y-face
recvf(1:nfacevar, il_bnd1:iu_bnd1,jl_bnd1:ju_bnd1+k2d, &
kl_bnd1:ku_bnd1) &
= facevary1(1:nfacevar, il_bnd1:iu_bnd1, &
jl_bnd1:ju_bnd1+k2d,kl_bnd1:ku_bnd1, 1)
Call amr_1blk_fc_prol_gen_fun(recvf, &
ia,ib,ja,jb+1,ka,kb,idest,ioff,joff,koff, &
mype,lb,parent_pe,parent_blk,2)
End If ! End If (ndim > 1)
If (ndim == 3) Then
!--------z-face
recvf(1:nfacevar, il_bnd1:iu_bnd1,jl_bnd1:ju_bnd1, &
kl_bnd1:ku_bnd1+k3d) &
= facevarz1(1:nfacevar, il_bnd1:iu_bnd1,jl_bnd1:ju_bnd1, &
kl_bnd1:ku_bnd1+k3d, 1)
Call amr_1blk_fc_prol_gen_fun(recvf, &
ia,ib,ja,jb,ka,kb+1,idest,ioff,joff,koff, &
mype,lb,parent_pe,parent_blk,3)
End If ! End If (ndim == 3)
amr_1blk_fc_prol_gen_fun再会根据interp_mask_facex(:),interp_mask_facey数组数据的设置选择特定的插值方法
这个数组只要在执行amr_prolong之前调用就可以了
- paramesh amr_prolong(提升操作)
- paramesh unk与unk1之间的操作
- Eclipse快捷键操作效率提升指南(不断更新)
- 如何使用Alfred提升操作效率(上)
- 数据库操作之提升篇
- 整型提升 和 位操作
- 请求的操作需要提升
- JDBC批量操作性能提升
- ContentProviderOperation批量操作提升性能
- redis大幅性能提升之使用管道(PipeLine)和批量(Batch)操作
- 类型转换操作符-2.提升
- 如何提升JavaScript操作DOM的效率
- .net 操作Excel 高效率方法,提升速度
- 如何提升JavaScript操作DOM的效率
- Mongodb采用$in方式提升操作效率
- PLSQL批量Forall操作性能提升详解
- Memcached提升web数据操作读写性能
- Memcached提升Web数据操作读写性能
- 从”零“开始
- Lua与C/C++的交互5:C/C++调用Lua函数
- CentOS6 下安装HP-LaserJet 1020打印机
- MSSQL 性能优化综述详解
- linux 查看磁盘IO状态操作指南
- paramesh amr_prolong(提升操作)
- [Software Engineering][Software Architecture][Theory]The VCSA Architecture[VCSA][2012.11.15]
- 【木头Cocos2d-x 010】游戏实例-《跑跑跑》制作教程(第二篇)——加入主角
- C++标准转换符之reinterpret_cast
- vc中调用其他应用程序的方法(函数) winexec,shellexecute ,createprocess
- pythonchallenge第二关
- 关于开源框架Pushlet中的定点推送消息和与浏览器参数交互详解
- b3log中数据库连接的处理
- [Software Engineering][Software Project Management][Theory]FM-VCSA 1-1[VCSA][2012.11.15]