fault_approx.tcl

This example shows how one goes from randomly spaced data points to an evenly sampled surface with taking fault curves into account. In this sample we have 11 scattered data points to approximate (file examples/surfit/curvs/11points.txt) and 4 fault curves, which are divide whole surface domain into 3 independent subdomains. The main idea of fault curves is that parts of resulting surface between fault curve are independent of each other. Important! You should place fault rule only after fault modifiable rules!

See also:
fault
Here is the image of the resulting surface:

surface with faults

Pic 1. Surface with faults

This result was obtained with "examples/surfit/curvs/fault_approx.tcl" script.

00001 #
00002 # This script was generated with funner v2.1beta (www.gridding.info)
00003 
00004 # 
00005 # load plugins
00006 # 
00007 load libsurfit[info sharedlibextension]
00008 
00009 # remove all previous data and gridding rules
00010 clear_data 
00011 
00012 # set name of surface
00013 set map_name "map_faults_approx" 
00014 
00015 # set solver
00016 set_solver "cg" 
00017 
00018 # set tolerance for solver
00019 set tol 1e-005 
00020 
00021 ##
00022 ## load initial data 
00023 ##
00024  
00025 # load points from text file 
00026 pnts_read "11points.txt" "11points"  
00027  
00028 # load curve from text file 
00029 curv_read "flt_line1.txt" "flt_line1"  
00030  
00031 # load curve from text file 
00032 curv_read "flt_line2.txt" "flt_line2"  
00033  
00034 # load curve from text file 
00035 curv_read "flt_line3.txt" "flt_line3"  
00036  
00037 # load curve from text file 
00038 curv_read "flt_line4.txt" "flt_line4"  
00039  
00040 ##
00041 ## construct grid 
00042 ##
00043 grid_get 1 99 1 -50 50 1 
00044  
00045 ##
00046 ## create gridding rules
00047 ##
00048 
00049 # resulting surface should tend to be constant or plane 
00050 completer 0.5 2  
00051 
00052 # fault line 
00053 fault "flt_line1"  
00054 
00055 # fault line 
00056 fault "flt_line2"  
00057 
00058 # fault line 
00059 fault "flt_line3"  
00060 
00061 # fault line 
00062 fault "flt_line4"  
00063 
00064 # add "resulting surface at points = points values" with weight 
00065 points_add 1 "11points" 
00066 
00067 ##
00068 ## run gridding algorithm
00069 ##
00070 surfit 
00071 
00072 ##
00073 ## save results 
00074 ##
00075 
00076 # unload grid from memory
00077 grid_unload 
00078 
00079 # save surface to surfit datafile 
00080 surf_save "fault_approx.dat" "map_faults_approx" 



surfit: open source gridding and contouring software.