VTK input error

technical aspects of .dri file generation (e.g. debug mode ) etc...
Post Reply
k.ankit0004
Posts: 4
Joined: Fri Jun 01, 2018 11:41 am
anti_bot: 333

VTK input error

Post by k.ankit0004 » Mon Jun 18, 2018 3:41 pm

Hello everyone,

I am new to MICRESS.
I was trying to import initial microstructure using vtk file but I am getting an error for it.

The section of Input file is
# Grain input
# ===========
# Type of grain positioning?
# Options: deterministic random [deterministic_infile] from_file
from_file
# Filename of initial grain/phase structure [VTK_identifier (default=korn)] ?
grain_new.vtk
# Treatment of data?
# (n: none, 1: 1D, x: rotate Clockwise along x-axis, y, z,
# or p: 'phase to grains transformation')
n
-1
input


Here is the output I am getting

# Reading (uncompressing) the VTK data file

STOP in routine 'initFeldVonVTK'

# Dataset of the VTK file is not supported

# Error while reading file: grain_new.vtk


I am attaching the file in the drive
https://drive.google.com/drive/folders/ ... sp=sharing

Please see if anyone can help me with it.

Thanking You,

Bernd
Posts: 1504
Joined: Mon Jun 23, 2008 9:29 pm

Re: VTK input error

Post by Bernd » Mon Jun 18, 2018 4:57 pm

Dear k.ankit0004,

Welcome to the MICRESS forum!

The file which you share by Google Drive seems to be too large. Can you please paste the vtk header in the post? Perhaps, it is just the VTK identifyer which is not correct...

Bernd

k.ankit0004
Posts: 4
Joined: Fri Jun 01, 2018 11:41 am
anti_bot: 333

Re: VTK input error

Post by k.ankit0004 » Tue Jun 19, 2018 8:47 am

Dear Bernd,

Thank you for your quick response.
I am attaching the image of the VTK file header
VTK file header.PNG
VTK file header.PNG (11.08 KiB) Viewed 10511 times
Regards

Bernd
Posts: 1504
Joined: Mon Jun 23, 2008 9:29 pm

Re: VTK input error

Post by Bernd » Tue Jun 19, 2018 12:31 pm

Hi k.ankit0004,

the header you sent contains unreadable characters, could this be the problem, or was it just a compatibility issue with your text editor?

Anyway, the file is much too big to make any tests. I would propose to create a small test file instead in order to find out what could be the problem.

Is it the first time you try to read a vtk file with MICRESS?

Bernd

k.ankit0004
Posts: 4
Joined: Fri Jun 01, 2018 11:41 am
anti_bot: 333

Re: VTK input error

Post by k.ankit0004 » Tue Jun 19, 2018 12:49 pm

Dear Bernd,

Yes, it is for first time I am trying to read VTK file with MICRESS.
And the VTK file that I created was using Dream.3D software and I was able to view the initial microstructure in Paraview.

Let me see if smaller file works.

Regards

Bernd
Posts: 1504
Joined: Mon Jun 23, 2008 9:29 pm

Re: VTK input error

Post by Bernd » Tue Jun 19, 2018 5:48 pm

Dear k.ankit0004,

if you used Dream2D to create the vtk file, it does not automatically have the "korn" VTK_Identifier. Instead, you must specify "FeatureIds":

# Filename of initial grain/phase structure [VTK_identifier (default=korn)] ?
grain_new.vtk FeatureIds

Bernd

k.ankit0004
Posts: 4
Joined: Fri Jun 01, 2018 11:41 am
anti_bot: 333

Re: VTK input error

Post by k.ankit0004 » Thu Jun 21, 2018 6:47 am

Dear Bernd

As you mentioned earlier I have converted my VTK file into readable ASCII format.

But still I am getting the same error.
I am attaching the code, VTK file header and output here. See if there is any problem with it.

Code: Select all

#
# Automatic 'Driving File' written out by MICRESS.
#
#
#
# MICRESS binary
# ==============
# version number: 6.400 (Linux)
# compiled: 01/17/2018
# compiler version: Intel 1400 20140120
# executable architecture: x64
# Thermo-Calc coupling: enabled
#    Version:    19
#    Link Date:  20-03-2017 12:28:00
#    OS Name:    Linux
#    Build Date: 10716
#    Compiler:   ifort (IFORT) 14.0.2 20140120
# OpenMP: disabled
# shell: /bin/tcsh
# ('double precision' binary)
#
#
# Language settings
# =================
# Please select a language: 'English', 'Deutsch' or 'Francais'
English
#
#
# Flags and settings
# ==================
#
# Geometry
# --------
# Grid size?
# (for 2D calculations: CellsY=1, for 1D calculations: CellsX=1, CellsY=1)
# Cells in X-direction (CellsX):
1000
# Cells in Y-direction (CellsY):
1
# Cells in Z-direction (CellsZ):
1000
# Cell dimension (grid spacing in micrometers):
# (optionally followed by rescaling factor for the output in the form of '3/4')
0.350000
#
# Flags
# -----
# Type of coupling?
# Options:  phase  concentration [volume_change] temperature  temp_cyl_coord
#    [stress] [stress_coupled] [flow] [flow_coarse] [dislocation]
phase
# Type of potential?
# Options:  double_obstacle  multi_obstacle   [fd_correction]
multi_obstacle fd_correction
#
# Phase field data structure
# --------------------------
# Coefficient for initial dimension of field iFace
#  [minimum usage] [target usage]
1.0
# Coefficient for initial dimension of field nTupel
#  [minimum usage] [target usage]
0.3
#
#
# Restart options
# ===============
# Restart using old results?
# Options:    new       restart [reset_time | structure_only]
new
#
#
# Name of output files
# ====================
# Name of result files?
trial_vtk/New_single_ReX
# Overwrite files with the same name?
# Options:    overwrite      write_protected     append
#             [zipped|not_zipped|vtk]
#             [unix|windows|non_native]
overwrite
#
#
# Selection of the outputs
# ========================
# [legacy|verbose|terse]
# Restart data output?                                 ('rest')
# Options:     out_restart      no_out_restart         [wallclock time, h.]
no_out_restart
# Grain number output?                                 ('korn')
# Options:     out_grains       no_out_grains
out_grains
# Phase number output?                                 ('phas')
# Options:     out_phases       no_out_phases          [no_interfaces]
out_phases
# Fraction output?                                     ('frac')
# Options:     out_fraction     no_out_fraction        [phase number]
no_out_fraction
# Average fraction table?                              ('TabF')
# Options:     tab_fractions    no_tab_fractions       [front_temp] [TabL_steps]
no_tab_fractions
# Interface output?                                    ('intf')
# Options:     out_interface    no_out_interface       [sharp]
out_interface
# Driving-force output?                                ('driv')
# Options:     out_driv_force   no_out_driv_force
no_out_driv_force
# Interface mobility output?                           ('mueS')
# Options:     out_mobility     no_out_mobility
no_out_mobility
# Curvature output?                                    ('krum')
# Options:     out_curvature    no_out_curvature
out_curvature
# Interface velocity output?                           ('vel')
# Options:     out_velocity     no_out_velocity
out_velocity
# Should the grain-time file be written out?           ('TabK')
# Options:     tab_grains       no_tab_grains          [extra|standard]
no_tab_grains
# Should the 'von Neumann Mullins' output be written out?       ('TabN')
# Options:    tab_vnm    no_tab_vnm
no_tab_vnm
# Should the 'grain data output' be written out?       ('TabGD')
# Options:    tab_grain_data    no_tab_grain_data
tab_grain_data
# Temperature output?                                  ('temp')
# Options:     out_temp         no_out_temp
out_temp
# Recrystallisation energy output?                     ('rex')
# Options:     out_recrystall   no_out_recrystall
out_recrystall
# Recrystallised fraction output?                      ('TabR')
# Options:     tab_recrystall   no_tab_recrystall
tab_recrystall
# Dislocation density output?                          ('rhoD')
# Options:     out_disloc       no_out_disloc
out_disloc
# Miller-Indices output?                               ('mill')
# Options:     out_miller       no_out_miller
out_miller
# Orientation output?                                  ('orie')
# Options:     out_orientation  no_out_orientation
out_orientation
# Should the orientation-time file be written?         ('TabO')
# Options:   tab_orientation  no_tab_orientation    [rotmat]
tab_orientation
# Should monitoring outputs be written out?            ('TabL')
# Options:     tab_log [simulation time, s] [wallclock time, min]  no_tab_log
no_tab_log
#
#
# Time input data
# ===============
# Finish input of output times (in seconds) with 'end_of_simulation'
# 'regularly-spaced' outputs can be set with 'linear_step'
# or 'logarithmic_step' and then specifying the increment
# and end value
# ('automatic_outputs' optionally followed by the number
#  of outputs can be used in conjuction with 'linear_from_file')
#  'first'                  : additional output for first time-step
#  'end_at_temperature'    : additional output and end of simulation
#                             at given temperature
linear_step 0.1 2.
linear_step 0.2 5.
linear_step 0.5 10.
linear_step 1.0 20.
linear_step 2.0 30.
linear_step 5.0 50.
end_of_simulation
# Time-step?
# Options:   fix ...[s]   automatic    automatic_limited
automatic
# Coefficient for phase-field criterion 1.00
# Number of steps to adjust profiles of initially sharp interfaces [exclude_inactive]?
10
#
#
# Phase data
# ==========
# Number of distinct solid phases?
1
#
# Data for phase 1:
# -----------------
# Simulation of recrystallisation in phase 1?
# Options:   recrystall     no_recrystall   [verbose|no_verbose]
recrystall verbose
# Which recrystallisation model?
# Options:  energy  mean_disloc  local_disloc  [all_interfaces]
energy
# Energy threshold for recrystallisation  model? [J/cm**3 or MPa]
2.123E-02
# Is phase 1 anisotrop?
# Options: isotropic  anisotropic  faceted_a faceted_b  antifaceted
anisotropic
# Crystal symmetry of the phase?
# Options:   none  cubic  hexagonal  tetragonal orthorhombic
tetragonal
# Should grains of phase 1 be reduced to categories?
# Options:   categorize no_categorize
no_categorize
#
# Orientation
# -----------
# How shall grain orientations be defined?
# Options:  angle_2d  euler_zxz  angle_axis  miller_indices  quaternion
miller_indices
#
#
# Grain input
# ===========
# Type of grain positioning?
# Options:  deterministic   random [deterministic_infile]   from_file
from_file
# Filename of initial grain/phase structure [VTK_identifier  (default=korn)] ?
singlephasenew.vtk FeatureIds
# Treatment of data?
# (n: none, 1: 1D, x: rotate Clockwise along x-axis, y, z,
#  or p: 'phase to grains transformation')
n
-1
# Data for further nucleation
# ===========================
# Enable further nucleation?
# Options:  nucleation   nucleation_symm   no_nucleation  [verbose|no_verbose]
nucleation
# Additional output for nucleation?
# Options:     out_nucleation     no_out_nucleation
no_out_nucleation
#
# Number of types of seeds?
2
#
# Input for seed type 1:
# ----------------------
# Type of 'position' of the seeds?
# Options:   bulk  region  interface  triple  quadruple  front  [restrictive]
interface
# Phase of new grains (integer) [unresolved|add_to_grain]?
1
# Reference phase (integer) [min. and max. fraction (real)]?
1
# Substrate phase [2nd phase in interface]?
# (set to 1 to disable the effect of substrate curvature)
1
# maximum number of new nuclei 1?
# (set negative for unlimited number)
1000
# Grain radius [micrometers]?
0.800000
# Choice of growth mode:
# Options:   stabilisation analytical_curvature
stabilisation
# critical recrystallisation energy [J/cm**3 or MPa]?
1.5000
# Determination of nuclei orientations?
# Options:   random    fix     fix_direction   parent_relation
parent_relation
# Minimal value of rotation angle? [Degree]
+0.000
# Maximal value of rotation angle? [Degree]
+15.00
# Referring to which coordinate system shall the rotation axis be defined?
# local  (system of the crystal)
# global (system of the workpiece)
global
# Rotation axis? [3 reals in one line]
+0.000 +1.000 +0.000
# Shield effect:
# Shield time [s] [shield phase or group number] ?
100.00
# Shield distance [micrometers]  [ nucleation distance [micrometers] ]?
25.000
# Input of minimal and maximal energy of the nuclei:
# Minimum of recrystallisation energy?  [J/cm**3 or MPa]
0.0000
# Maximum of recrystallisation energy?  [J/cm**3 or MPa]
0.0000
# Nucleation range
# min. nucleation temperature for seed type 1 [K]
998.5000
# max. nucleation temperature for seed type 1 [K]
1001.000
# Time between checks for nucleation? [s]
# Options:  constant   from_file
constant
# Time interval [s]
1.50000E-02
# Shall random noise be applied?
# Options:     nucleation_noise   no_nucleation_noise
nucleation_noise
# Factor for random noise?
# (applied as DeltaT -> (1+Factor*(RAND-1/2))*DeltaT)
1.000E-03
#
# Input for seed type 2:
# ----------------------
# Type of 'position' of the seeds?
# Options:   bulk  region  interface  triple  quadruple  front  [restrictive]
region
# Minimal value of x-coordinates?  [micrometers]
0.0000
# Maximal value of x-coordinates?  [micrometers]
250.00
# Minimal value of z-coordinates?  [micrometers]
0.0000
# Maximal value of z-coordinates?  [micrometers]
250.00
# Phase of new grains (integer) [unresolved|add_to_grain]?
1
# Reference phase (integer) [min. and max. fraction (real)]?
1
# Which nucleation model shall be used?
# Options:    seed_undercooling    seed_density
seed_undercooling
# maximum number of new nuclei 2?
# (set negative for unlimited number)
100
# Grain radius [micrometers]?
0.700000
# Choice of growth mode:
# Options:   stabilisation analytical_curvature
stabilisation
# critical recrystallisation energy [J/cm**3 or MPa]?
2.5000
# Determination of nuclei orientations?
# Options:   random    fix     fix_direction   parent_relation
parent_relation
# Minimal value of rotation angle? [Degree]
+20.00
# Maximal value of rotation angle? [Degree]
+25.00
# Referring to which coordinate system shall the rotation axis be defined?
# local  (system of the crystal)
# global (system of the workpiece)
global
# Rotation axis? [3 reals in one line]
+0.000 +1.000 +0.000
# Shield effect:
# Shield time [s] [shield phase or group number] ?
100.00
# Shield distance [micrometers]  [ nucleation distance [micrometers] ]?
25.000
# Input of minimal and maximal energy of the nuclei:
# Minimum of recrystallisation energy?  [J/cm**3 or MPa]
0.0000
# Maximum of recrystallisation energy?  [J/cm**3 or MPa]
0.0000
# Nucleation range
# min. nucleation temperature for seed type 2 [K]
998.5000
# max. nucleation temperature for seed type 2 [K]
1001.000
# Time between checks for nucleation? [s]
# Options:  constant   from_file
constant
# Time interval [s]
1.50000E-02
# Shall random noise be applied?
# Options:     nucleation_noise   no_nucleation_noise
nucleation_noise
# Factor for random noise?
# (applied as DeltaT -> (1+Factor*(RAND-1/2))*DeltaT)
1.000E-03
#
# Seed for random-number generator initialisation
# -----------------------------------------------
7
#
# Max. number of simultaneous nucleations?
# ----------------------------------------
# (set to 0 for automatic)
5
#
# Shall metastable small seeds be killed?
# ---------------------------------------
# Options:     kill_metastable      no_kill_metastable
no_kill_metastable
#
#
# Phase interaction data
# ======================
#
# Data for phase interaction 0 / 1:
# ---------------------------------
# Simulation of interaction between phases 0 and 1?
# Options: phase_interaction  no_phase_interaction
#  [standard|particle_pinning[_temperature]|solute_drag]
no_phase_interaction
#
# Data for phase interaction 1 / 1:
# ---------------------------------
# Simulation of interaction between phases 1 and 1?
# Options: phase_interaction  no_phase_interaction  identical phases nb
#  [standard|particle_pinning[_temperature]|solute_drag]
phase_interaction
# Type of interfacial energy definition between phases 1 and 1?
# Options:  constant  temp_dependent
constant
# Interfacial energy between phases 1 and 1? [J/cm**2]
#     [max. value for num. interface stabilisation [J/cm**2]]
5.00000E-05
# Type of mobility definition between phases 1 and 1?
# Options: constant temp_dependent dg_dependent [fixed_minimum]
constant
# Kinetic coefficient mu between phases 1 and 1  [ min. value ] [cm**4/(Js)] ?
5.00000E-04
# Shall misorientation be considered?
# Options:   misorientation    no_misorientation
#           [low_angle_limit (degrees)] default:15    [special_orient (nb)]
misorientation  15.
# Input of the misorientation coefficients:
# Modification of interfacial energy for low angle boundaries
# Options:  factor   read-shockley
factor
# Prefactor of interfacial energy for low angle boundaries?
0.20000
# Modification of the mobility for low angle boundaries
# Options:  factor   humphreys [min_reduction + parameters B and N
#                         (default: min_reduction=0. B=5.0 N=4.0)]
factor
# Prefactor of interfacial mobility for low angle boundaries?
0.10000
#
#
# Phase diagram - input data
# ==========================
#
#
#
#
# Boundary conditions
# ===================
# Type of temperature trend?
# Options:   linear     linear_from_file     profiles_from_file
linear
# Number of connecting points?    (integer)
0
# Initial temperature at the bottom?  (real)  [K]
1000.000
# Temperature gradient in z-direction?  [K/cm]
0.0000
# Cooling rate? [K/s]
-1.0000
# Moving-frame system in z-direction?
# Options:      moving_frame      no_moving_frame
no_moving_frame
#
# Boundary conditions for phase field in each direction
# Options: i (insulation) s (symmetric) p (periodic/wrap-around)
#          g (gradient)   f (fixed)     w (wetting)
# Sequence: W E (S N, if 3D) B T borders
ppii
# Unit-cell model symmetric with respect to the x/y diagonal plane?
# Options:    unit_cell_symm   no_unit_cell_symm
no_unit_cell_symm
#
#
# Other numerical parameters
# ==========================
# Phase minimum?
5.00E-03	
# Interface thickness (in cells)?
4.00
4
#
#


Output

# Reading (uncompressing) the VTK data file
STOP in routine 'initFeldVonVTK'
# Dataset of the VTK file is not supported
# Error while reading file: singlephasenew.vtk

VTK file Header
VTK_header.PNG
VTK_header.PNG (8.89 KiB) Viewed 10499 times
Regards

Georg
Posts: 3
Joined: Tue Jun 24, 2008 5:17 pm

Re: VTK input error

Post by Georg » Thu Jun 21, 2018 4:53 pm

Hi Ankit,

would be great if you could send the vtk file ( a small one) or post it here.

One problem is that you use phase 1 as anisotropic. This requires the specification of orientations for each grain when reading from vtk.

I would thus recommend to start with an isotropic phase 1..Then:

# Geometry
# --------
# Grid size?
# (for 2D calculations: CellsY=1, for 1D calculations: CellsX=1, CellsY=1)
# Cells in X-direction (CellsX):
128
# Cells in Y-direction (CellsY):
128
# Cells in Z-direction (CellsZ):
128
# Cell dimension (grid spacing in micrometers):
# (optionally followed by rescaling factor for the output in the form of '3/4')
0.5000
#
The values in bold should match the RVE size definition originating from dream3d. This information can be read directly from the HDFview of the dream3D file.

and further down:

# Grain input
# ===========
# Type of grain positioning?
# Options: deterministic random [deterministic_infile] from_file
from_file
# Filename of initial grain/phase structure [VTK_identifier (default=korn)] ?
2D_microstructure.vtk FeatureIds
# Treatment of data?
# (n: none, 1: 1D, f: flip (bottom<->top), t: transpose,
# or p: 'phase to grains transformation')
n
# Number of grains at the beginning?
# (Set to less than 1 for the number of grain to be read from the input data,
# with optionally a minimal size, in cells)
-1
# Read grain properties from a file?
# Options: input from_file identical blocks
identical
# Input data for grain number 1:
# Phase number? (integer)
1
# 'Non-geometric' data for grains 1 to 53 identical
#...

This should work for an isotropic phase 1


For anisotropic following should work:

# Data for phase 1:
# -----------------
# Simulation of recrystallisation in phase 1?
# Options: recrystall no_recrystall [verbose|no_verbose]
no_recrystall
# Is phase 1 anisotrop?
# Options: isotropic anisotropic faceted antifaceted
anisotropic
# Crystal symmetry of the phase?
# Options: none cubic hexagonal tetragonal orthorhombic
cubic
# Should grains of phase 1 be reduced to categories?
# Options: categorize no_categorize
no_categorize
#
# Orientation
# -----------
# How shall grain orientations be defined?
# Options: angle_2d euler_zxz angle_axis miller_indices quaternion
euler_zxz
#

....

# Read grain properties from a file?
# Options: input from_file identical
# blocks
from_file
# Filename of properties of the grain
# structure?
FeatureProps.txt
#
....


FeatureProps.txt contains for each grain (number as read from the vtk) the PhaseID (1 in all cases) and the 3 Euler angles (3 reals):
1
-1.7264961
0.5024153
2.4992003
1
-1.7097814
0.7891875
2.337595
1
-0.67405975
0.6139743
0.9105239
1
1.007061
0.34944314
-1.6559123
……

The information about the orientation of each of the grains can be -by now - LOCALLY AND MANUALLY extracted from the .dream3d file as .txt file using hdf5view, figure
fig1.png
fig1.png (103.9 KiB) Viewed 10485 times
This extraction generates the 2 files (i) EulerAngles.txt and (ii) Phases.txt, which – for each grain - contain the information about its three Euler angles (in zxz notation..) and its phase (always phase 1 in the present example),figure:
fig2.png
fig2.png (13.2 KiB) Viewed 10485 times
Remove grain „0“ and its related properties from both files!

These two files have to be merged into a single file called e.g. FeatureProps.txt. This can be done using a suitable python script .
Last edited by Georg on Thu Jun 21, 2018 5:01 pm, edited 1 time in total.

Georg
Posts: 3
Joined: Tue Jun 24, 2008 5:17 pm

Re: VTK input error

Post by Georg » Thu Jun 21, 2018 4:58 pm

here is a python script we used to create the featureprops (no warranty ;) )

# -*- coding: utf-8 -*-
"""
Created on Fri Sep 8 11:03:14 2017

@author: Youness (ACCESS)

###############################################################################
# Description:
Combine files for micress job
###############################################################################
# Usage as command line script:
combne.py <file1> <file2> ...
###############################################################################
"""
import sys

# Parse args
numArgs = len(sys.argv)
if len(sys.argv)<2:
print("# Missing parameters!\n"\
"# Usage as command line script:\n"\
"combine.py <file1> <file2> ...")
sys.exit(1)


Files = []
for counter in range(1,numArgs):
try:
fileData = open(sys.argv[counter], 'r').readlines()
Files.append(fileData)
except IOError:
print("# Wrong file or file path")

try:
micFile = open("FeaturesFile.txt","w")
except IOError:
print("# Wrong file or file path")

dataLenght = len(Files[0])
counter = 1
while counter < dataLenght:
for data in Files:
micFile.write(data[counter])
counter+=1

micFile.close()

ralph
Posts: 167
Joined: Wed Apr 27, 2011 4:42 pm
anti_bot: 333

Re: VTK input error

Post by ralph » Mon Jul 02, 2018 10:17 am

As far as I know, MICRESS can only read dataset of the type 'structered_points'.
If you change the dataset line, it should work.

Best,
Ralph

Post Reply