您好,欢迎访问三七文档
当前位置:首页 > 商业/管理/HR > 市场营销 > 02-4_FLAC3D5.0_Fish调整网格简析
FLAC3D5.0培训教程(武汉)工程师李振2014.3.27-3.28ITASCA(武汉)咨询有限公司FLAC3D5.0培训日程安排1.FLAC3DV5.0界面操作2.FLAC3D基本操作方法vs应用流程;FISH调整网格3.FLAC3D内置Fish语言的应用;4.FLAC3D结构单元vs接触单元;5.FLAC3D渗流模块6.其他2014.3.27~2014.3.28利用fish调整规整网格建立交叉隧道一、建模思路二、建模过程fish语句的分析三、小结一、建模思路•1首先用内置brick生成砖型规整网格•2在现有网格的基础上调整gridpoint的坐标,坐标的调整依据建模人员期望的网格形状来进行•3规划好网格的调整次序(如先调整端面网格,再调整中间部分的网格)FLAC3D3.00ItascaConsultingGroup,Inc.Minneapolis,MNUSASettings:ModelPerspective10:53:23FriDec172010Center:X:3.275e+000Y:5.600e+000Z:3.800e+000Rotation:X:20.000Y:0.000Z:20.000Dist:5.969e+001Mag.:1Ang.:22.500BlockGroupbrick_1brick_2brick_3brick_5brick_6brick_7brick_8brick_9brick_10brick_11AxesLinestyleXYZ镜像两次生成最终网格FLAC3D3.00ItascaConsultingGroup,Inc.Minneapolis,MNUSASettings:ModelPerspective10:56:09FriDec172010Center:X:3.275e+000Y:5.600e+000Z:3.800e+000Rotation:X:30.000Y:0.000Z:30.000Dist:5.969e+001Mag.:1Ang.:22.500BlockGroupbrick_1brick_2brick_3brick_5brick_6brick_7brick_8brick_9brick_10brick_11AxesLinestyleXYZFLAC3D3.00ItascaConsultingGroup,Inc.Minneapolis,MNUSASettings:ModelPerspective10:59:22FriDec172010Center:X:3.275e+000Y:5.600e+000Z:3.800e+000Rotation:X:30.000Y:0.000Z:330.000Dist:5.969e+001Mag.:1Ang.:22.500BlockGroupbrick_1brick_3brick_4brick_5brick_6brick_7brick_8brick_9brick_11brick_12AxesLinestyleXYZFLAC3D3.00ItascaConsultingGroup,Inc.Minneapolis,MNUSASettings:ModelPerspective11:02:03FriDec172010Center:X:5.481e+000Y:-1.275e+000Z:9.182e-001Rotation:X:30.000Y:0.000Z:40.000Dist:8.364e+001Mag.:1Ang.:22.500BlockGroupbrick_2brick_3brick_4brick_5brick_6brick_7brick_8brick_10brick_11brick_12AxesLinestyleXYZ调用fish调整网格二、建模过程fish语句的分析•2.1为了分析整个网格调整的过程,将手册中的命令进行分解简化,从整个命令来看,最先调整的两个砖型网格依次为brick_3,brick_1(此名称代表两个类组);为了清晰明了地理解调整过程,因此,在建立brick时,只建立此两个砖型网格,即只保留如下的命令行(前面的参数设置命令不变)。只分析brick_1和brick_3FLAC3D3.00ItascaConsultingGroup,Inc.Minneapolis,MNUSASettings:ModelPerspective11:29:09FriDec172010Center:X:3.275e+000Y:6.000e-001Z:1.300e+000Rotation:X:20.000Y:0.000Z:40.000Dist:2.264e+001Mag.:1.25Ang.:22.500BlockGroupbrick_1brick_3AxesLinestyleXYZ•2.2将shape函数进行分解简化,将与brick_1和brick_3无关的fish语句全部删除或处理为注释行。为了弄清楚每个调整步的作用,将每个调整步骤重新定义为一个新的函数,依次运行并在运行后使用plot显示调整后的效果,同时做出深入的分析,弄清每个语句的作用。①Fish语句中,函数retrieve_pointer,函数set_pointer,函数get_parray,函数create_and_fill_pointers,函数find_extremes,保持不变。将函数create_all_bricks更名为函数create_13_bricks,只保留与两个brick相关的语句,如下所示。②将shape_tunnel_b函数分解成如下的单个小的函数,分别运行这些小函数,分析这些小函数各自的作用。FLAC3D3.00ItascaConsultingGroup,Inc.Minneapolis,MNUSASettings:ModelPerspective13:15:07FriDec172010Center:X:3.275e+000Y:6.000e-001Z:1.300e+000Rotation:X:20.000Y:0.000Z:40.000Dist:2.264e+001Mag.:1.25Ang.:22.500BlockGroupbrick_1brick_3AxesLinestyleXYZACBDGHFEKLJI③分析create_13_bricks这个函数,此函数中的关键部分是create_and_fill_pointers函数defcreate_13_bricksii=out('IndexingBrick1')pxsize=zone_x_a;Brick1pysize=zone_x_bpzsize=zone_y_tunxmin=x0brickxmax=x1brickymin=y0brickymax=y1brickzmin=z1brickzmax=z2brickxrat=1.0yrat=1.0zrat=1.0create_and_fill_pointersparray01=parrayii=out('IndexingBrick3')pxsize=zone_z_b;Brick3pysize=zone_x_bpzsize=zone_y_tunxmin=x1brickxmax=x2brickymin=y0brickymax=y1brickzmin=z1brickzmax=z2brickxrat=zone_rat_byrat=1.0zrat=1.0create_and_fill_pointersparray03=parrayendcreate_13_bricks图中所示建模所用的部分参数,除brick_3的x方向网格比率为1.2以外,其余网格变化率皆为1.0,即定居等分。z0brickz1brick③重点分析create_and_fill_pointers函数函数get_parray的作用便是计算当前的网格体的gridpoint的数目,然后利用内置函数get_mem(isize)向计算机内存来申请isize个fish变量对象。用这些个fish变量对象来存储网格体中每个gridpoint的地址。以brick_1和brick_3为例,每个块体有(pxsize+1)*(pysize+1)*(pzsize+1)=6*6*6个gridpoint。继续执行create_and_fill_pointers函数,下面的语句便是寻找每个gridpoint的地址,并将其值(pointer类型)传递给相应的fish变量对象,而这个过程通过函数set_pointer来实现。此函数中ioffset用来控制这isize个fish变量对象首地址的偏移量。手册中对内存函数用法的解释•lose_mem(n,ad)ThisfunctionreturnsnFISH-variableobjectstothehost.Theparameteradistheaddressofthestartofthearrayofobjects;thereisnocheckingdonetoverifythatadisavalidaddress.Thereturnedvalueisundefined.••get_mem(n)ThisfunctiongetsnFISH-variableobjectsfromthehost'smemoryspaceandreturnstheaddressofthestartofthecontiguousarrayofobjects••mem(ad)Thisfunctionmaybeusedeitherasasourceordestination(i.e.,ontheright-orleft-handsideofanexpression):•var=mem(ad)ThevalueoftheFISH-variableataddressadistransmittedtotheregularFISHvariablevar(togetherwiththetype).•mem(ad)=varThevalueandtypeoftheregularFISHvariablevarisplacedintheFISH-variableataddressad.••Itistheuser'sresponsibilitytocheckthattheaddressesgivencontainvalidFISHvariables.Duringexecution,anerrormessageisgivenifadisnotoftypepointer.z0z1z2z3z4z5Gridpoint遍历的次序,循环从内到外x0y0z0x0y0z1x0y0z2x0y0z3x0y0z4x0y0z5x0y1z0x0y1z1x0y1z2x0y1z3x0y1z4x0y1z5x0y5z0x0y5z1x0y5z2x0y5z3x0y5z4x0y5z5x1y0z0x1y0z1x1y0z2x1y0z3x1y0z4x1y0z5x1y1z0x1y1z1x1y1z2x1y1z3x1y1z4x1y1z5x1y5z0x1y5z1x1y5z2x1y5z3x1y5z4x1y5z5另外要注意的就是寻找块体网格节点附近坐标的方法,ifxrat#1.0thenfxpos=((xrat^ixpos)-1.0)/((xrat^pxsize)-1.0)elsefxpos=float(ixpos)/float(pxsize)endiffxpos=(fxpos*(xmax-xmin))+xmin这是一个小的数学问题:对与任意的直线段l,假设将其分成n份,相邻线段的比例为rat(沿直线段方向),那么求出前i段直线段的长度l0lil1l2l3liln求出前第一段的长度,然后应用等比数列前i项的求和公式即可得到上面代码中的运算式。
本文标题:02-4_FLAC3D5.0_Fish调整网格简析
链接地址:https://www.777doc.com/doc-3839051 .html