generate hexahedral mesh in Mentat based on a data file of Ricardo Lebensohn's "txfft" format (phi1, Phi, phi2, x, y, z, grainId, phaseId)
Only grainId is used, physical dimension and subdivisions need to be provided on command line.
improvement possible by parsing x, y, z columns to get those directly.
2010-10-25 23:27:57 +05:30
#!/usr/bin/env python
2013-05-13 16:57:59 +05:30
# -*- coding: UTF-8 no BOM -*-
generate hexahedral mesh in Mentat based on a data file of Ricardo Lebensohn's "txfft" format (phi1, Phi, phi2, x, y, z, grainId, phaseId)
Only grainId is used, physical dimension and subdivisions need to be provided on command line.
improvement possible by parsing x, y, z columns to get those directly.
2010-10-25 23:27:57 +05:30
2014-11-18 13:30:45 +05:30
import os , sys , string
2014-10-13 19:28:26 +05:30
from optparse import OptionParser
import damask
generate hexahedral mesh in Mentat based on a data file of Ricardo Lebensohn's "txfft" format (phi1, Phi, phi2, x, y, z, grainId, phaseId)
Only grainId is used, physical dimension and subdivisions need to be provided on command line.
improvement possible by parsing x, y, z columns to get those directly.
2010-10-25 23:27:57 +05:30
2014-10-13 19:28:26 +05:30
scriptID = string . replace ( ' $Id$ ' , ' \n ' , ' \\ n ' )
2014-11-18 21:01:39 +05:30
scriptName = os . path . splitext ( scriptID . split ( ) [ 1 ] ) [ 0 ]
2013-07-18 18:58:54 +05:30
2013-05-13 16:57:59 +05:30
#-------------------------------------------------------------------------------------------------
generate hexahedral mesh in Mentat based on a data file of Ricardo Lebensohn's "txfft" format (phi1, Phi, phi2, x, y, z, grainId, phaseId)
Only grainId is used, physical dimension and subdivisions need to be provided on command line.
improvement possible by parsing x, y, z columns to get those directly.
2010-10-25 23:27:57 +05:30
def outMentat ( cmd , locals ) :
2013-05-13 16:57:59 +05:30
#-------------------------------------------------------------------------------------------------
generate hexahedral mesh in Mentat based on a data file of Ricardo Lebensohn's "txfft" format (phi1, Phi, phi2, x, y, z, grainId, phaseId)
Only grainId is used, physical dimension and subdivisions need to be provided on command line.
improvement possible by parsing x, y, z columns to get those directly.
2010-10-25 23:27:57 +05:30
if cmd [ 0 : 3 ] == ' (!) ' :
exec ( cmd [ 3 : ] )
elif cmd [ 0 : 3 ] == ' (?) ' :
cmd = eval ( cmd [ 3 : ] )
py_send ( cmd )
else :
py_send ( cmd )
return
2013-05-13 16:57:59 +05:30
#-------------------------------------------------------------------------------------------------
generate hexahedral mesh in Mentat based on a data file of Ricardo Lebensohn's "txfft" format (phi1, Phi, phi2, x, y, z, grainId, phaseId)
Only grainId is used, physical dimension and subdivisions need to be provided on command line.
improvement possible by parsing x, y, z columns to get those directly.
2010-10-25 23:27:57 +05:30
def outStdout ( cmd , locals ) :
2013-05-13 16:57:59 +05:30
#-------------------------------------------------------------------------------------------------
generate hexahedral mesh in Mentat based on a data file of Ricardo Lebensohn's "txfft" format (phi1, Phi, phi2, x, y, z, grainId, phaseId)
Only grainId is used, physical dimension and subdivisions need to be provided on command line.
improvement possible by parsing x, y, z columns to get those directly.
2010-10-25 23:27:57 +05:30
if cmd [ 0 : 3 ] == ' (!) ' :
exec ( cmd [ 3 : ] )
elif cmd [ 0 : 3 ] == ' (?) ' :
cmd = eval ( cmd [ 3 : ] )
2013-09-14 16:22:02 +05:30
print ( cmd )
generate hexahedral mesh in Mentat based on a data file of Ricardo Lebensohn's "txfft" format (phi1, Phi, phi2, x, y, z, grainId, phaseId)
Only grainId is used, physical dimension and subdivisions need to be provided on command line.
improvement possible by parsing x, y, z columns to get those directly.
2010-10-25 23:27:57 +05:30
else :
2013-09-14 16:22:02 +05:30
print ( cmd )
generate hexahedral mesh in Mentat based on a data file of Ricardo Lebensohn's "txfft" format (phi1, Phi, phi2, x, y, z, grainId, phaseId)
Only grainId is used, physical dimension and subdivisions need to be provided on command line.
improvement possible by parsing x, y, z columns to get those directly.
2010-10-25 23:27:57 +05:30
return
2013-05-13 16:57:59 +05:30
#-------------------------------------------------------------------------------------------------
generate hexahedral mesh in Mentat based on a data file of Ricardo Lebensohn's "txfft" format (phi1, Phi, phi2, x, y, z, grainId, phaseId)
Only grainId is used, physical dimension and subdivisions need to be provided on command line.
improvement possible by parsing x, y, z columns to get those directly.
2010-10-25 23:27:57 +05:30
def output ( cmds , locals , dest ) :
2013-05-13 16:57:59 +05:30
#-------------------------------------------------------------------------------------------------
generate hexahedral mesh in Mentat based on a data file of Ricardo Lebensohn's "txfft" format (phi1, Phi, phi2, x, y, z, grainId, phaseId)
Only grainId is used, physical dimension and subdivisions need to be provided on command line.
improvement possible by parsing x, y, z columns to get those directly.
2010-10-25 23:27:57 +05:30
for cmd in cmds :
if isinstance ( cmd , list ) :
output ( cmd , locals , dest )
else :
{ \
' Mentat ' : outMentat , \
' Stdout ' : outStdout , \
2010-10-26 19:15:23 +05:30
} [ dest ] ( str ( cmd ) , locals )
generate hexahedral mesh in Mentat based on a data file of Ricardo Lebensohn's "txfft" format (phi1, Phi, phi2, x, y, z, grainId, phaseId)
Only grainId is used, physical dimension and subdivisions need to be provided on command line.
improvement possible by parsing x, y, z columns to get those directly.
2010-10-25 23:27:57 +05:30
return
2013-05-13 16:57:59 +05:30
#-------------------------------------------------------------------------------------------------
generate hexahedral mesh in Mentat based on a data file of Ricardo Lebensohn's "txfft" format (phi1, Phi, phi2, x, y, z, grainId, phaseId)
Only grainId is used, physical dimension and subdivisions need to be provided on command line.
improvement possible by parsing x, y, z columns to get those directly.
2010-10-25 23:27:57 +05:30
def init ( ) :
2013-05-13 16:57:59 +05:30
#-------------------------------------------------------------------------------------------------
generate hexahedral mesh in Mentat based on a data file of Ricardo Lebensohn's "txfft" format (phi1, Phi, phi2, x, y, z, grainId, phaseId)
Only grainId is used, physical dimension and subdivisions need to be provided on command line.
improvement possible by parsing x, y, z columns to get those directly.
2010-10-25 23:27:57 +05:30
return [ " *new_model yes " ,
" *reset " ,
" *select_clear " ,
" *set_element_class hex8 " ,
" *set_nodes off " ,
" *elements_solid " ,
" *show_view 4 " ,
" *reset_view " ,
" *view_perspective " ,
" *redraw " ,
]
2013-05-13 16:57:59 +05:30
#-------------------------------------------------------------------------------------------------
2011-01-24 21:51:17 +05:30
def mesh ( r , d ) :
2013-05-13 16:57:59 +05:30
#-------------------------------------------------------------------------------------------------
generate hexahedral mesh in Mentat based on a data file of Ricardo Lebensohn's "txfft" format (phi1, Phi, phi2, x, y, z, grainId, phaseId)
Only grainId is used, physical dimension and subdivisions need to be provided on command line.
improvement possible by parsing x, y, z columns to get those directly.
2010-10-25 23:27:57 +05:30
return [
" *add_nodes " ,
" %f %f %f " % ( 0.0 , 0.0 , 0.0 ) ,
" %f %f %f " % ( 0.0 , 0.0 , d [ 2 ] ) ,
" %f %f %f " % ( 0.0 , d [ 1 ] , d [ 2 ] ) ,
" %f %f %f " % ( 0.0 , d [ 1 ] , 0.0 ) ,
" %f %f %f " % ( - d [ 0 ] , 0.0 , 0.0 ) ,
" %f %f %f " % ( - d [ 0 ] , 0.0 , d [ 2 ] ) ,
" %f %f %f " % ( - d [ 0 ] , d [ 1 ] , d [ 2 ] ) ,
" %f %f %f " % ( - d [ 0 ] , d [ 1 ] , 0.0 ) ,
" *add_elements " ,
2010-10-26 19:15:23 +05:30
range ( 1 , 9 ) ,
generate hexahedral mesh in Mentat based on a data file of Ricardo Lebensohn's "txfft" format (phi1, Phi, phi2, x, y, z, grainId, phaseId)
Only grainId is used, physical dimension and subdivisions need to be provided on command line.
improvement possible by parsing x, y, z columns to get those directly.
2010-10-25 23:27:57 +05:30
" *sub_divisions " ,
2011-01-24 21:51:17 +05:30
" %i %i %i " % ( r [ 2 ] , r [ 1 ] , r [ 0 ] ) ,
generate hexahedral mesh in Mentat based on a data file of Ricardo Lebensohn's "txfft" format (phi1, Phi, phi2, x, y, z, grainId, phaseId)
Only grainId is used, physical dimension and subdivisions need to be provided on command line.
improvement possible by parsing x, y, z columns to get those directly.
2010-10-25 23:27:57 +05:30
" *subdivide_elements " ,
" all_existing " ,
" *set_sweep_tolerance " ,
2011-01-24 21:51:17 +05:30
" %f " % ( float ( min ( d ) ) / max ( r ) / 2.0 ) ,
generate hexahedral mesh in Mentat based on a data file of Ricardo Lebensohn's "txfft" format (phi1, Phi, phi2, x, y, z, grainId, phaseId)
Only grainId is used, physical dimension and subdivisions need to be provided on command line.
improvement possible by parsing x, y, z columns to get those directly.
2010-10-25 23:27:57 +05:30
" *sweep_all " ,
" *renumber_all " ,
" *set_move_scale_factor x -1 " ,
" *move_elements " ,
" all_existing " ,
" *flip_elements " ,
" all_existing " ,
" *fill_view " ,
]
2013-05-13 16:57:59 +05:30
#-------------------------------------------------------------------------------------------------
2010-10-26 19:15:23 +05:30
def material ( ) :
2013-05-13 16:57:59 +05:30
#-------------------------------------------------------------------------------------------------
2010-10-26 19:15:23 +05:30
cmds = [ \
" *new_mater standard " ,
" *mater_option general:state:solid " ,
2010-10-26 23:56:04 +05:30
" *mater_option structural:type:hypo_elast " ,
2010-10-26 19:15:23 +05:30
" *mater_name " ,
" hypela2 " ,
" *add_mater_elements " ,
" all_existing " ,
" *geometry_type mech_three_solid " ,
2013-05-13 16:57:59 +05:30
# "*geometry_option red_integ_capacity:on", # see below: reduced integration with one IP gave trouble being always OUTDATED...
2010-10-26 19:15:23 +05:30
" *add_geometry_elements " ,
" all_existing " ,
]
return cmds
2013-05-13 16:57:59 +05:30
#-------------------------------------------------------------------------------------------------
2010-10-26 19:15:23 +05:30
def geometry ( ) :
2013-05-13 16:57:59 +05:30
#-------------------------------------------------------------------------------------------------
2010-10-26 19:15:23 +05:30
cmds = [ \
" *geometry_type mech_three_solid " ,
2011-01-27 20:02:29 +05:30
# "*geometry_option red_integ_capacity:on",
2010-10-26 19:15:23 +05:30
" *add_geometry_elements " ,
" all_existing " ,
2013-05-13 16:57:59 +05:30
" *element_type 7 " , # we are NOT using reduced integration (type 117) but opt for /elementhomogeneous/ in the respective phase description (material.config)
2010-10-26 21:56:55 +05:30
" all_existing " ,
2010-10-26 19:15:23 +05:30
]
return cmds
generate hexahedral mesh in Mentat based on a data file of Ricardo Lebensohn's "txfft" format (phi1, Phi, phi2, x, y, z, grainId, phaseId)
Only grainId is used, physical dimension and subdivisions need to be provided on command line.
improvement possible by parsing x, y, z columns to get those directly.
2010-10-25 23:27:57 +05:30
2013-05-13 16:57:59 +05:30
#-------------------------------------------------------------------------------------------------
def initial_conditions ( homogenization , microstructures ) :
#-------------------------------------------------------------------------------------------------
generate hexahedral mesh in Mentat based on a data file of Ricardo Lebensohn's "txfft" format (phi1, Phi, phi2, x, y, z, grainId, phaseId)
Only grainId is used, physical dimension and subdivisions need to be provided on command line.
improvement possible by parsing x, y, z columns to get those directly.
2010-10-25 23:27:57 +05:30
elements = [ ]
element = 0
2013-05-13 16:57:59 +05:30
for id in microstructures :
generate hexahedral mesh in Mentat based on a data file of Ricardo Lebensohn's "txfft" format (phi1, Phi, phi2, x, y, z, grainId, phaseId)
Only grainId is used, physical dimension and subdivisions need to be provided on command line.
improvement possible by parsing x, y, z columns to get those directly.
2010-10-25 23:27:57 +05:30
element + = 1
if len ( elements ) < id :
for i in range ( id - len ( elements ) ) :
elements . append ( [ ] )
elements [ id - 1 ] . append ( element )
cmds = [ \
2010-10-26 21:56:55 +05:30
" *new_icond " ,
2011-01-24 21:51:17 +05:30
" *icond_name _temperature " ,
2010-10-26 21:56:55 +05:30
" *icond_type state_variable " ,
" *icond_param_value state_var_id 1 " ,
" *icond_dof_value var 300 " ,
" *add_icond_elements " ,
" all_existing " ,
generate hexahedral mesh in Mentat based on a data file of Ricardo Lebensohn's "txfft" format (phi1, Phi, phi2, x, y, z, grainId, phaseId)
Only grainId is used, physical dimension and subdivisions need to be provided on command line.
improvement possible by parsing x, y, z columns to get those directly.
2010-10-25 23:27:57 +05:30
" *new_icond " ,
2011-01-24 21:51:17 +05:30
" *icond_name _homogenization " ,
generate hexahedral mesh in Mentat based on a data file of Ricardo Lebensohn's "txfft" format (phi1, Phi, phi2, x, y, z, grainId, phaseId)
Only grainId is used, physical dimension and subdivisions need to be provided on command line.
improvement possible by parsing x, y, z columns to get those directly.
2010-10-25 23:27:57 +05:30
" *icond_type state_variable " ,
" *icond_param_value state_var_id 2 " ,
2011-01-24 21:51:17 +05:30
" *icond_dof_value var %i " % homogenization ,
generate hexahedral mesh in Mentat based on a data file of Ricardo Lebensohn's "txfft" format (phi1, Phi, phi2, x, y, z, grainId, phaseId)
Only grainId is used, physical dimension and subdivisions need to be provided on command line.
improvement possible by parsing x, y, z columns to get those directly.
2010-10-25 23:27:57 +05:30
" *add_icond_elements " ,
" all_existing " ,
]
for grain , elementList in enumerate ( elements ) :
cmds . append ( [ \
" *new_icond " ,
" *icond_name microstructure_ %i " % ( grain + 1 ) ,
" *icond_type state_variable " ,
" *icond_param_value state_var_id 3 " ,
" *icond_dof_value var %i " % ( grain + 1 ) ,
" *add_icond_elements " ,
2010-10-26 19:15:23 +05:30
elementList ,
generate hexahedral mesh in Mentat based on a data file of Ricardo Lebensohn's "txfft" format (phi1, Phi, phi2, x, y, z, grainId, phaseId)
Only grainId is used, physical dimension and subdivisions need to be provided on command line.
improvement possible by parsing x, y, z columns to get those directly.
2010-10-25 23:27:57 +05:30
" # " ,
] )
return cmds
2013-05-13 16:57:59 +05:30
#-------------------------------------------------------------------------------------------------
2011-01-24 21:51:17 +05:30
def parse_geomFile ( content , homog ) :
2013-05-13 16:57:59 +05:30
#-------------------------------------------------------------------------------------------------
2011-01-24 21:51:17 +05:30
( skip , key ) = content [ 0 ] . split ( ) [ : 2 ]
if key [ : 4 ] . lower ( ) == ' head ' :
skip = int ( skip ) + 1
else :
skip = 0
2013-05-13 16:57:59 +05:30
grid = [ 0 , 0 , 0 ]
size = [ 0.0 , 0.0 , 0.0 ]
2011-01-24 21:51:17 +05:30
homog = 0
for line in content [ : skip ] :
data = line . split ( )
2013-05-13 16:57:59 +05:30
if data [ 0 ] . lower ( ) == ' grid ' or data [ 0 ] . lower ( ) == ' resolution ' :
grid = map ( int , data [ 2 : 8 : 2 ] )
if data [ 0 ] . lower ( ) == ' size ' or data [ 0 ] . lower ( ) == ' dimension ' :
size = map ( float , data [ 2 : 8 : 2 ] )
2011-01-24 21:51:17 +05:30
if data [ 0 ] . lower ( ) == ' homogenization ' :
homog = int ( data [ 1 ] )
2013-05-13 16:57:59 +05:30
microstructures = [ ]
2011-01-24 21:51:17 +05:30
for line in content [ skip : ] :
2014-10-13 19:28:26 +05:30
for word in line . split ( ) :
microstructures . append ( int ( word ) )
2011-01-24 21:51:17 +05:30
2013-05-13 16:57:59 +05:30
return ( grid , size , homog , microstructures )
2011-01-24 21:51:17 +05:30
2013-05-13 16:57:59 +05:30
#-------------------------------------------------------------------------------------------------
2011-01-24 21:51:17 +05:30
def parse_spectralFile ( content , homog ) :
2013-05-13 16:57:59 +05:30
#-------------------------------------------------------------------------------------------------
2011-01-24 21:51:17 +05:30
coords = [ { } , { } , { } ]
maxBox = [ - 1.0e20 , - 1.0e20 , - 1.0e20 ]
minBox = [ 1.0e20 , 1.0e20 , 1.0e20 ]
2013-05-13 16:57:59 +05:30
grid = [ 0.0 , 0.0 , 0.0 ]
size = [ 0 , 0 , 0 ]
microstructures = [ ]
2011-01-24 21:51:17 +05:30
for line in content :
data = line . split ( ) [ 3 : 7 ]
2013-05-13 16:57:59 +05:30
microstructures . append ( int ( data [ 3 ] ) )
2011-01-24 21:51:17 +05:30
for i in range ( 3 ) :
maxBox [ i ] = max ( maxBox [ i ] , float ( data [ i ] ) )
minBox [ i ] = min ( minBox [ i ] , float ( data [ i ] ) )
coords [ i ] [ data [ i ] ] = True
for i in range ( 3 ) :
2013-05-13 16:57:59 +05:30
grid [ i ] = len ( coords [ i ] )
size [ i ] = ( maxBox [ i ] - minBox [ i ] ) * grid [ i ] / ( grid [ i ] - 1.0 )
2011-01-24 21:51:17 +05:30
2013-05-13 16:57:59 +05:30
return ( grid , size , homog , microstructures )
2010-10-26 19:15:23 +05:30
2013-05-13 16:57:59 +05:30
#--------------------------------------------------------------------------------------------------
# MAIN
#--------------------------------------------------------------------------------------------------
2014-10-13 19:28:26 +05:30
parser = OptionParser ( option_class = damask . extendableOption , usage = ' % prog options [file[s]] ' , description = """
2011-01-24 21:51:17 +05:30
Generate FE hexahedral mesh from spectral description file .
Acceptable formats are
geom : header plus list of grain numbers or
spectral : phi1 , Phi , phi2 , x , y , z , id , phase .
2014-10-13 19:28:26 +05:30
""" , version = scriptID)
generate hexahedral mesh in Mentat based on a data file of Ricardo Lebensohn's "txfft" format (phi1, Phi, phi2, x, y, z, grainId, phaseId)
Only grainId is used, physical dimension and subdivisions need to be provided on command line.
improvement possible by parsing x, y, z columns to get those directly.
2010-10-25 23:27:57 +05:30
parser . add_option ( " -p " , " --port " , type = " int " , \
2013-05-13 16:57:59 +05:30
dest = " port " , \
help = " Mentat connection port " )
2011-01-24 21:51:17 +05:30
parser . add_option ( " -g " , " --geom " , action = " store_const " , const = " geom " , \
2013-05-13 16:57:59 +05:30
dest = " filetype " , \
help = " file has ' geom ' format " )
2011-08-15 14:04:55 +05:30
parser . add_option ( " -s " , " --spectral " , action = " store_const " , const = " spectral " , \
2013-05-13 16:57:59 +05:30
dest = " filetype " , \
help = " file has ' spectral ' format (VPSC Lebensohn) " )
2011-08-15 14:04:55 +05:30
parser . add_option ( " --homogenization " , type = " int " , \
2013-05-13 16:57:59 +05:30
dest = " homogenization " , \
2013-05-14 22:49:36 +05:30
help = " homogenization index from material.config (only required for geom file type) " )
2011-08-15 14:04:55 +05:30
2011-01-24 21:51:17 +05:30
2011-08-15 14:04:55 +05:30
parser . set_defaults ( filetype = ' geom ' )
2011-01-24 21:51:17 +05:30
parser . set_defaults ( homogenization = 1 )
( options , args ) = parser . parse_args ( )
generate hexahedral mesh in Mentat based on a data file of Ricardo Lebensohn's "txfft" format (phi1, Phi, phi2, x, y, z, grainId, phaseId)
Only grainId is used, physical dimension and subdivisions need to be provided on command line.
improvement possible by parsing x, y, z columns to get those directly.
2010-10-25 23:27:57 +05:30
2012-01-16 15:02:36 +05:30
sys . path . append ( damask . solver . Marc ( ) . libraryPath ( ' ../../ ' ) )
2010-10-26 19:15:23 +05:30
try :
from py_mentat import *
except :
2011-11-03 18:46:00 +05:30
print ( ' no valid Mentat release found ' )
2011-01-24 21:51:17 +05:30
if options . port != None : sys . exit ( - 1 )
generate hexahedral mesh in Mentat based on a data file of Ricardo Lebensohn's "txfft" format (phi1, Phi, phi2, x, y, z, grainId, phaseId)
Only grainId is used, physical dimension and subdivisions need to be provided on command line.
improvement possible by parsing x, y, z columns to get those directly.
2010-10-25 23:27:57 +05:30
if not os . path . isfile ( args [ 0 ] ) :
parser . error ( " cannot open %s " % args [ 0 ] )
file = open ( args [ 0 ] )
content = file . readlines ( )
file . close ( )
2013-09-14 16:22:02 +05:30
print ( ' \033 [1m ' + scriptName + ' \033 [0m \n ' )
2011-01-24 21:51:17 +05:30
if options . filetype not in [ ' spectral ' , ' geom ' ] :
options . filetype = os . path . splitext ( args [ 0 ] ) [ 1 ] [ 1 : ]
2013-09-14 16:22:02 +05:30
print ( ' \n parsing %s ... ' % options . filetype , )
2011-01-24 21:51:17 +05:30
sys . stdout . flush ( )
2013-05-13 16:57:59 +05:30
( grid , size , homog , microstructures ) = { \
2011-01-24 21:51:17 +05:30
' geom ' : parse_geomFile ,
' spectral ' : parse_spectralFile ,
} [ options . filetype ] ( content , options . homogenization )
2013-09-14 16:22:02 +05:30
print ( ' %i microstructures in %s with grid %s and homogenization %i \n ' % ( len ( list ( set ( microstructures ) ) ) , str ( size ) , str ( grid ) , homog ) )
2011-01-24 21:51:17 +05:30
generate hexahedral mesh in Mentat based on a data file of Ricardo Lebensohn's "txfft" format (phi1, Phi, phi2, x, y, z, grainId, phaseId)
Only grainId is used, physical dimension and subdivisions need to be provided on command line.
improvement possible by parsing x, y, z columns to get those directly.
2010-10-25 23:27:57 +05:30
cmds = [ \
init ( ) ,
2013-05-13 16:57:59 +05:30
mesh ( grid , size ) ,
2010-10-26 19:15:23 +05:30
material ( ) ,
geometry ( ) ,
2013-05-13 16:57:59 +05:30
initial_conditions ( homog , microstructures ) ,
2011-01-24 21:51:17 +05:30
' *identify_sets ' ,
' *redraw ' ,
generate hexahedral mesh in Mentat based on a data file of Ricardo Lebensohn's "txfft" format (phi1, Phi, phi2, x, y, z, grainId, phaseId)
Only grainId is used, physical dimension and subdivisions need to be provided on command line.
improvement possible by parsing x, y, z columns to get those directly.
2010-10-25 23:27:57 +05:30
]
outputLocals = { }
if ( options . port != None ) :
py_connect ( ' ' , options . port )
output ( cmds , outputLocals , ' Mentat ' )
py_disconnect ( )
else :
output ( cmds , outputLocals , ' Stdout ' )
2010-10-26 19:15:23 +05:30