test1.tcl

来自「算断裂的」· TCL 代码 · 共 66 行

TCL
66
字号
## QMG test 1## This is an approximation to the mesh on the cover of Claes ## Johnson's book ``Numerical solutions of partial differential## equations by the finite element method'' , Cambridge U. Press 1987.## It has greater refinement near the origin.global PIglobal interactiveset wedgeangle [expr $PI/6.0]## Make a circular approximation with 4 Bezier curves from pi/6 to 2pi.gmset {verts codes} [gm_circ_approx $wedgeangle [expr 2 * $PI] 4]## Put one more vertex to start the wedge.gmset newverts [concat {{0 0}} $verts]gmset newcodes [concat 0 $codes]gmset domain [gm_cpoly $newverts $newcodes]## The size function is of the form h0*r^p+f, where p is determined## by (4.31) in Johnson, and f is determined so that the H1 error on## the innermost triangles matches the H1 error everywhere else.set h0 0.2set gamma [expr $PI / ( 2*$PI - $wedgeangle)]set f [expr pow($h0,(1.0/$gamma))]set p [expr 1.0 - $gamma]set sizectl "(formula ($h0 * pow(%0*%0+%1*%1, $p/2.0) + $f))"set show 0if {[llength [info globals interactive]]} {    puts "size control string = $sizectl"    set show 1}gmset mesh [gmmeshgen $domain size $sizectl show $show]gmset {numvtx numelt} [gmmeshsize $mesh]set asp [gmchecktri $domain $mesh]if {[llength [info globals aspprod]]} {    global aspprod    set aspprod [expr $aspprod * $asp]    global meshsizesum    set meshsizesum [expr $meshsizesum + $numvtx]}if {[llength [info globals interactive]]} {    gmviz $mesh white}# ------------------------------------------------------------------# Copyright (c) 1999 by Cornell University.  All rights reserved# See the accompanying file 'Copyright' for authorship information,# the terms of the license governing this software, and disclaimers# concerning this software.# ------------------------------------------------------------------# This file is part of the QMG software.  # Version 2.0 of QMG, release date September 3, 1999.# ------------------------------------------------------------------

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?