diff --git a/code/plastic_phenopowerlaw.f90 b/code/plastic_phenopowerlaw.f90 index 63e078329..262934273 100644 --- a/code/plastic_phenopowerlaw.f90 +++ b/code/plastic_phenopowerlaw.f90 @@ -1,4 +1,3 @@ -!-------------------------------------------------------------------------------------------------- !> @author Franz Roters, Max-Planck-Institut für Eisenforschung GmbH !> @author Philip Eisenlohr, Max-Planck-Institut für Eisenforschung GmbH !> @brief material subroutine for phenomenological crystal plasticity formulation using a powerlaw @@ -60,6 +59,7 @@ module plastic_phenopowerlaw plastic_phenopowerlaw_tau0_slip, & !< initial critical shear stress for slip (input parameter, per family) plastic_phenopowerlaw_tau0_twin, & !< initial critical shear stress for twin (input parameter, per family) plastic_phenopowerlaw_tausat_slip, & !< maximum critical shear stress for slip (input parameter, per family) + plastic_phenopowerlaw_H_int, & !< per family hardening activity(input parameter(optional), per family) plastic_phenopowerlaw_nonSchmidCoeff, & plastic_phenopowerlaw_interaction_SlipSlip, & !< interaction factors slip - slip (input parameter) @@ -197,29 +197,30 @@ subroutine plastic_phenopowerlaw_init(fileUnit) source=0_pInt) allocate(plastic_phenopowerlaw_output(maxval(phase_Noutput),maxNinstance)) plastic_phenopowerlaw_output = '' - allocate(plastic_phenopowerlaw_outputID(maxval(phase_Noutput),maxNinstance), source=undefined_ID) - allocate(plastic_phenopowerlaw_Noutput(maxNinstance), source=0_pInt) - allocate(plastic_phenopowerlaw_Nslip(lattice_maxNslipFamily,maxNinstance), source=0_pInt) - allocate(plastic_phenopowerlaw_Ntwin(lattice_maxNtwinFamily,maxNinstance), source=0_pInt) - allocate(plastic_phenopowerlaw_Ntrans(lattice_maxNtransFamily,maxNinstance), source=0_pInt) - allocate(plastic_phenopowerlaw_totalNslip(maxNinstance), source=0_pInt) - allocate(plastic_phenopowerlaw_totalNtwin(maxNinstance), source=0_pInt) - allocate(plastic_phenopowerlaw_totalNtrans(maxNinstance), source=0_pInt) - allocate(plastic_phenopowerlaw_gdot0_slip(maxNinstance), source=0.0_pReal) - allocate(plastic_phenopowerlaw_n_slip(maxNinstance), source=0.0_pReal) - allocate(plastic_phenopowerlaw_tau0_slip(lattice_maxNslipFamily,maxNinstance), source=0.0_pReal) + allocate(plastic_phenopowerlaw_outputID(maxval(phase_Noutput),maxNinstance),source=undefined_ID) + allocate(plastic_phenopowerlaw_Noutput(maxNinstance), source=0_pInt) + allocate(plastic_phenopowerlaw_Nslip(lattice_maxNslipFamily,maxNinstance), source=0_pInt) + allocate(plastic_phenopowerlaw_Ntwin(lattice_maxNtwinFamily,maxNinstance), source=0_pInt) + allocate(plastic_phenopowerlaw_Ntrans(lattice_maxNtransFamily,maxNinstance),source=0_pInt) + allocate(plastic_phenopowerlaw_totalNslip(maxNinstance), source=0_pInt) + allocate(plastic_phenopowerlaw_totalNtwin(maxNinstance), source=0_pInt) + allocate(plastic_phenopowerlaw_totalNtrans(maxNinstance), source=0_pInt) + allocate(plastic_phenopowerlaw_gdot0_slip(maxNinstance), source=0.0_pReal) + allocate(plastic_phenopowerlaw_n_slip(maxNinstance), source=0.0_pReal) + allocate(plastic_phenopowerlaw_tau0_slip(lattice_maxNslipFamily,maxNinstance),source=0.0_pReal) allocate(plastic_phenopowerlaw_tausat_slip(lattice_maxNslipFamily,maxNinstance),source=0.0_pReal) - allocate(plastic_phenopowerlaw_gdot0_twin(maxNinstance), source=0.0_pReal) - allocate(plastic_phenopowerlaw_n_twin(maxNinstance), source=0.0_pReal) - allocate(plastic_phenopowerlaw_tau0_twin(lattice_maxNtwinFamily,maxNinstance), source=0.0_pReal) - allocate(plastic_phenopowerlaw_spr(maxNinstance), source=0.0_pReal) - allocate(plastic_phenopowerlaw_twinB(maxNinstance), source=0.0_pReal) - allocate(plastic_phenopowerlaw_twinC(maxNinstance), source=0.0_pReal) - allocate(plastic_phenopowerlaw_twinD(maxNinstance), source=0.0_pReal) - allocate(plastic_phenopowerlaw_twinE(maxNinstance), source=0.0_pReal) - allocate(plastic_phenopowerlaw_h0_SlipSlip(maxNinstance), source=0.0_pReal) - allocate(plastic_phenopowerlaw_h0_TwinSlip(maxNinstance), source=0.0_pReal) - allocate(plastic_phenopowerlaw_h0_TwinTwin(maxNinstance), source=0.0_pReal) + allocate(plastic_phenopowerlaw_H_int(lattice_maxNslipFamily,maxNinstance),source=0.0_pReal) + allocate(plastic_phenopowerlaw_gdot0_twin(maxNinstance), source=0.0_pReal) + allocate(plastic_phenopowerlaw_n_twin(maxNinstance), source=0.0_pReal) + allocate(plastic_phenopowerlaw_tau0_twin(lattice_maxNtwinFamily,maxNinstance), source=0.0_pReal) + allocate(plastic_phenopowerlaw_spr(maxNinstance), source=0.0_pReal) + allocate(plastic_phenopowerlaw_twinB(maxNinstance), source=0.0_pReal) + allocate(plastic_phenopowerlaw_twinC(maxNinstance), source=0.0_pReal) + allocate(plastic_phenopowerlaw_twinD(maxNinstance), source=0.0_pReal) + allocate(plastic_phenopowerlaw_twinE(maxNinstance), source=0.0_pReal) + allocate(plastic_phenopowerlaw_h0_SlipSlip(maxNinstance), source=0.0_pReal) + allocate(plastic_phenopowerlaw_h0_TwinSlip(maxNinstance), source=0.0_pReal) + allocate(plastic_phenopowerlaw_h0_TwinTwin(maxNinstance), source=0.0_pReal) allocate(plastic_phenopowerlaw_interaction_SlipSlip(lattice_maxNinteraction,maxNinstance), & source=0.0_pReal) allocate(plastic_phenopowerlaw_interaction_SlipTwin(lattice_maxNinteraction,maxNinstance), & @@ -340,7 +341,7 @@ subroutine plastic_phenopowerlaw_init(fileUnit) do j = 1_pInt, Nchunks_SlipFamilies plastic_phenopowerlaw_Nslip(j,instance) = IO_intValue(line,chunkPos,1_pInt+j) enddo - case ('tausat_slip','tau0_slip') + case ('tausat_slip','tau0_slip','H_int') tempPerSlip = 0.0_pReal do j = 1_pInt, Nchunks_SlipFamilies if (plastic_phenopowerlaw_Nslip(j,instance) > 0_pInt) & @@ -351,6 +352,8 @@ subroutine plastic_phenopowerlaw_init(fileUnit) plastic_phenopowerlaw_tausat_slip(1:Nchunks_SlipFamilies,instance) = tempPerSlip(1:Nchunks_SlipFamilies) case ('tau0_slip') plastic_phenopowerlaw_tau0_slip(1:Nchunks_SlipFamilies,instance) = tempPerSlip(1:Nchunks_SlipFamilies) + case ('H_int') + plastic_phenopowerlaw_H_int(1:Nchunks_SlipFamilies,instance) = tempPerSlip(1:Nchunks_SlipFamilies) end select !-------------------------------------------------------------------------------------------------- ! parameters depending on number of twin families @@ -967,7 +970,6 @@ subroutine plastic_phenopowerlaw_dotState(Tstar_v,ipc,ip,el) offset_accshear_twin = nSlip + nTwin + 2_pInt + nSlip plasticState(ph)%dotState(:,of) = 0.0_pReal - !-------------------------------------------------------------------------------------------------- ! system-independent (nonlinear) prefactors to M_Xx (X influenced by x) matrices c_SlipSlip = plastic_phenopowerlaw_h0_SlipSlip(instance)*& @@ -986,7 +988,7 @@ subroutine plastic_phenopowerlaw_dotState(Tstar_v,ipc,ip,el) index_myFamily = sum(lattice_NslipSystem(1:f-1_pInt,ph)) ! at which index starts my family slipSystems1: do i = 1_pInt,plastic_phenopowerlaw_Nslip(f,instance) j = j+1_pInt - left_SlipSlip(j) = 1.0_pReal ! no system-dependent left part + left_SlipSlip(j) = 1.0_pReal + plastic_phenopowerlaw_H_int(f,instance) ! modified no system-dependent left part left_SlipTwin(j) = 1.0_pReal ! no system-dependent left part right_SlipSlip(j) = abs(1.0_pReal-plasticState(ph)%state(j,of) / & (plastic_phenopowerlaw_tausat_slip(f,instance)+ssat_offset)) & @@ -1013,6 +1015,7 @@ subroutine plastic_phenopowerlaw_dotState(Tstar_v,ipc,ip,el) enddo slipFamilies1 + j = 0_pInt twinFamilies1: do f = 1_pInt,lattice_maxNtwinFamily index_myFamily = sum(lattice_NtwinSystem(1:f-1_pInt,ph)) ! at which index starts my family diff --git a/config/Crystallite_All.config b/config/Crystallite_All.config index bf75ac8fb..761380fcd 100644 --- a/config/Crystallite_All.config +++ b/config/Crystallite_All.config @@ -1,4 +1,3 @@ -### $Id$ ### [all] (output) phase (output) texture diff --git a/config/Crystallite_None.config b/config/Crystallite_None.config index f434de150..3ddfe1586 100644 --- a/config/Crystallite_None.config +++ b/config/Crystallite_None.config @@ -1,2 +1 @@ -### $Id$ ### [none] \ No newline at end of file diff --git a/config/Crystallite_aLittleSomething.config b/config/Crystallite_aLittleSomething.config index 23a42ee03..50b0ff5e8 100644 --- a/config/Crystallite_aLittleSomething.config +++ b/config/Crystallite_aLittleSomething.config @@ -1,4 +1,3 @@ -### $Id$ ### [aLittleSomething] (output) f (output) p \ No newline at end of file diff --git a/config/Homogenization_Damage_NonLocal.config b/config/Homogenization_Damage_NonLocal.config index b8f9f855e..13eb0135e 100644 --- a/config/Homogenization_Damage_NonLocal.config +++ b/config/Homogenization_Damage_NonLocal.config @@ -1,4 +1,3 @@ -### $Id$ ### damage nonlocal initialDamage 1.0 (output) damage diff --git a/config/Homogenization_HydrogenFlux_CahnHilliard.config b/config/Homogenization_HydrogenFlux_CahnHilliard.config index f748eb573..62e1d2505 100644 --- a/config/Homogenization_HydrogenFlux_CahnHilliard.config +++ b/config/Homogenization_HydrogenFlux_CahnHilliard.config @@ -1,4 +1,3 @@ -### $Id$ ### hydrogenflux cahnhilliard initialHydrogenConc 0.0 (output) hydrogenconc diff --git a/config/Homogenization_Isostrain_Parallel3.config b/config/Homogenization_Isostrain_Parallel3.config index 7c7e80ea2..8e60a7b72 100644 --- a/config/Homogenization_Isostrain_Parallel3.config +++ b/config/Homogenization_Isostrain_Parallel3.config @@ -1,4 +1,3 @@ -### $Id$ ### [Parallel3] type isostrain Ngrains 3 diff --git a/config/Homogenization_Isostrain_SX.config b/config/Homogenization_Isostrain_SX.config index b63ff26e4..7eb1e3c87 100644 --- a/config/Homogenization_Isostrain_SX.config +++ b/config/Homogenization_Isostrain_SX.config @@ -1,4 +1,3 @@ -### $Id$ ### [SX] type isostrain Ngrains 1 diff --git a/config/Homogenization_Isostrain_Taylor2.config b/config/Homogenization_Isostrain_Taylor2.config index becc307fe..12dfa774e 100644 --- a/config/Homogenization_Isostrain_Taylor2.config +++ b/config/Homogenization_Isostrain_Taylor2.config @@ -1,4 +1,3 @@ -### $Id$ ### [Taylor2] type isostrain Ngrains 2 \ No newline at end of file diff --git a/config/Homogenization_None_Dummy.config b/config/Homogenization_None_Dummy.config index b6da22c79..47ffc0afd 100644 --- a/config/Homogenization_None_Dummy.config +++ b/config/Homogenization_None_Dummy.config @@ -1,4 +1,3 @@ -### $Id$ ### [directSX] type none diff --git a/config/Homogenization_Porosity_PhaseField.config b/config/Homogenization_Porosity_PhaseField.config index 38a618ceb..6e9bb53a3 100644 --- a/config/Homogenization_Porosity_PhaseField.config +++ b/config/Homogenization_Porosity_PhaseField.config @@ -1,3 +1,2 @@ -### $Id$ ### porosity phasefield (output) porosity diff --git a/config/Homogenization_RGC_8Grains.config b/config/Homogenization_RGC_8Grains.config index 5147582c4..bbe9fb6a4 100644 --- a/config/Homogenization_RGC_8Grains.config +++ b/config/Homogenization_RGC_8Grains.config @@ -1,4 +1,3 @@ -### $Id$ ### [8Grains] type RGC Ngrains 8 diff --git a/config/Homogenization_Thermal_Conduction.config b/config/Homogenization_Thermal_Conduction.config index 2d52aa9ef..48ad9ddc6 100644 --- a/config/Homogenization_Thermal_Conduction.config +++ b/config/Homogenization_Thermal_Conduction.config @@ -1,4 +1,3 @@ -### $Id$ ### thermal conduction initialT 300.0 (output) temperature diff --git a/config/Homogenization_VacancyFlux_CahnHilliard.config b/config/Homogenization_VacancyFlux_CahnHilliard.config index 0f76bec05..d7bc6189e 100644 --- a/config/Homogenization_VacancyFlux_CahnHilliard.config +++ b/config/Homogenization_VacancyFlux_CahnHilliard.config @@ -1,4 +1,3 @@ -### $Id$ ### vacancyflux cahnhilliard initialVacancyConc 1e-6 (output) vacancyconc diff --git a/config/Homogenization_multiField.config b/config/Homogenization_multiField.config index 926737ff9..7dd63cc73 100644 --- a/config/Homogenization_multiField.config +++ b/config/Homogenization_multiField.config @@ -1,4 +1,3 @@ -### $Id$ ### [SX] type isostrain Ngrains 1 diff --git a/config/Kinematics_Hydrogen_Strain.config b/config/Kinematics_Hydrogen_Strain.config index f4a999038..d32c90437 100644 --- a/config/Kinematics_Hydrogen_Strain.config +++ b/config/Kinematics_Hydrogen_Strain.config @@ -1,3 +1,2 @@ -### $Id$ ### (kinematics) vacancy_strain vacancy_strain_coeff 0.006 diff --git a/config/Kinematics_Thermal_Expansion.config b/config/Kinematics_Thermal_Expansion.config index 5376dadfe..6c778136f 100644 --- a/config/Kinematics_Thermal_Expansion.config +++ b/config/Kinematics_Thermal_Expansion.config @@ -1,3 +1,2 @@ -### $Id$ ### (kinematics) thermal_expansion thermal_expansion11 0.00231 diff --git a/config/Kinematics_Vacancy_Strain.config b/config/Kinematics_Vacancy_Strain.config index cfb75ed0d..1033b1bf9 100644 --- a/config/Kinematics_Vacancy_Strain.config +++ b/config/Kinematics_Vacancy_Strain.config @@ -1,3 +1,2 @@ -### $Id$ ### (kinematics) hydrogen_strain hydrogen_strain_coeff 0.06 diff --git a/config/Microstructure_DP_Steel.config b/config/Microstructure_DP_Steel.config index c20072a0d..7d619d705 100644 --- a/config/Microstructure_DP_Steel.config +++ b/config/Microstructure_DP_Steel.config @@ -1,4 +1,3 @@ -### $Id$ ### [DP_Steel] /elementhomogeneous/ crystallite 1 diff --git a/config/Microstructure_ElementHomogeneous.config b/config/Microstructure_ElementHomogeneous.config index 6fab42744..774403aff 100644 --- a/config/Microstructure_ElementHomogeneous.config +++ b/config/Microstructure_ElementHomogeneous.config @@ -1,4 +1,3 @@ -### $Id$ ### [ElementHomogeneous] /elementhomogeneous/ # put this flag to set ips identical in one element (something like reduced integration) crystallite 1 diff --git a/config/Phase_Damage.config b/config/Phase_Damage.config index 67c70a987..f34a78627 100644 --- a/config/Phase_Damage.config +++ b/config/Phase_Damage.config @@ -1,3 +1,2 @@ -### $Id$ ### damage_diffusion11 1.0 damage_mobility 0.001 diff --git a/config/Phase_Dislotwin_TWIP-Steel-FeMnC.config b/config/Phase_Dislotwin_TWIP-Steel-FeMnC.config index cabe881fb..2570b1b95 100644 --- a/config/Phase_Dislotwin_TWIP-Steel-FeMnC.config +++ b/config/Phase_Dislotwin_TWIP-Steel-FeMnC.config @@ -1,4 +1,3 @@ -### $Id$ ### [TWIP_Steel_FeMnC] elasticity hooke diff --git a/config/Phase_Dislotwin_Tungsten.config b/config/Phase_Dislotwin_Tungsten.config index 7190cdd94..b780f5c59 100644 --- a/config/Phase_Dislotwin_Tungsten.config +++ b/config/Phase_Dislotwin_Tungsten.config @@ -1,4 +1,3 @@ -### $Id$ ### [Tungsten] elasticity hooke diff --git a/config/Phase_Hydrogen.config b/config/Phase_Hydrogen.config index e3797df52..c9ccfdc86 100644 --- a/config/Phase_Hydrogen.config +++ b/config/Phase_Hydrogen.config @@ -1,4 +1,3 @@ -### $Id$ ### hydrogenflux_diffusion11 1.0 hydrogenflux_mobility11 1.0 hydrogenVolume 1e-28 diff --git a/config/Phase_Isotropic_AluminumIsotropic.config b/config/Phase_Isotropic_AluminumIsotropic.config index 88a8ad579..1f78a8856 100644 --- a/config/Phase_Isotropic_AluminumIsotropic.config +++ b/config/Phase_Isotropic_AluminumIsotropic.config @@ -1,4 +1,3 @@ -### $Id$ ### [Aluminum_Isotropic] # Kuo, J. C., Mikrostrukturmechanik von Bikristallen mit Kippkorngrenzen. Shaker-Verlag 2004. http://edoc.mpg.de/204079 diff --git a/config/Phase_None_IsotropicVolumePreservation.config b/config/Phase_None_IsotropicVolumePreservation.config index c39c6aef0..6da2ad826 100644 --- a/config/Phase_None_IsotropicVolumePreservation.config +++ b/config/Phase_None_IsotropicVolumePreservation.config @@ -1,4 +1,3 @@ -### $Id$ ### [IsotropicVolumePreservation] elasticity hooke diff --git a/config/Phase_None_Orthorombic.config b/config/Phase_None_Orthorombic.config index aad9f85c3..006b0e048 100644 --- a/config/Phase_None_Orthorombic.config +++ b/config/Phase_None_Orthorombic.config @@ -1,4 +1,3 @@ -### $Id$ ### [Orthorombic] elasticity hooke diff --git a/config/Phase_Nonlocal_Aluminum.config b/config/Phase_Nonlocal_Aluminum.config index 09c41d4c4..b805f09be 100644 --- a/config/Phase_Nonlocal_Aluminum.config +++ b/config/Phase_Nonlocal_Aluminum.config @@ -1,4 +1,3 @@ -### $Id$ ### [Aluminum] elasticity hooke diff --git a/config/Phase_Phenopowerlaw_Aluminum.config b/config/Phase_Phenopowerlaw_Aluminum.config index 78972cfb4..8fa58557a 100644 --- a/config/Phase_Phenopowerlaw_Aluminum.config +++ b/config/Phase_Phenopowerlaw_Aluminum.config @@ -1,4 +1,3 @@ -### $Id$ ### [Aluminum] elasticity hooke plasticity phenopowerlaw diff --git a/config/Phase_Phenopowerlaw_BCC-Ferrite.config b/config/Phase_Phenopowerlaw_BCC-Ferrite.config index 2d699f0ab..7344ef455 100644 --- a/config/Phase_Phenopowerlaw_BCC-Ferrite.config +++ b/config/Phase_Phenopowerlaw_BCC-Ferrite.config @@ -1,4 +1,3 @@ -### $Id$ ### # Tasan et.al. 2015 Acta Materalia # Tasan et.al. 2015 International Journal of Plasticity # Diehl et.al. 2015 Meccanica diff --git a/config/Phase_Phenopowerlaw_BCC-Martensite.config b/config/Phase_Phenopowerlaw_BCC-Martensite.config index fe7c85296..b9960d325 100644 --- a/config/Phase_Phenopowerlaw_BCC-Martensite.config +++ b/config/Phase_Phenopowerlaw_BCC-Martensite.config @@ -1,4 +1,3 @@ -### $Id$ ### # Tasan et.al. 2015 Acta Materalia # Tasan et.al. 2015 International Journal of Plasticity # Diehl et.al. 2015 Meccanica diff --git a/config/Phase_Phenopowerlaw_Gold.config b/config/Phase_Phenopowerlaw_Gold.config index 7d9270c9f..fdae9c8e7 100644 --- a/config/Phase_Phenopowerlaw_Gold.config +++ b/config/Phase_Phenopowerlaw_Gold.config @@ -1,4 +1,3 @@ -### $Id$ ### # parameters fitted by D. Ma to: diff --git a/config/Phase_Phenopowerlaw_cpTi-alpha.config b/config/Phase_Phenopowerlaw_cpTi-alpha.config index 5cd215fc0..64ecbca25 100644 --- a/config/Phase_Phenopowerlaw_cpTi-alpha.config +++ b/config/Phase_Phenopowerlaw_cpTi-alpha.config @@ -1,4 +1,3 @@ -### $Id$ ### [cpTi-alpha] plasticity phenopowerlaw elasticity hooke diff --git a/config/Phase_Phenopowerlaw_multiField.config b/config/Phase_Phenopowerlaw_multiField.config index 3de057f3f..4436564cc 100644 --- a/config/Phase_Phenopowerlaw_multiField.config +++ b/config/Phase_Phenopowerlaw_multiField.config @@ -1,4 +1,3 @@ -### $Id$ ### [Aluminum] elasticity hooke plasticity phenopowerlaw diff --git a/config/Phase_Porosity.config b/config/Phase_Porosity.config index 3f1ba52ce..fc1b0f834 100644 --- a/config/Phase_Porosity.config +++ b/config/Phase_Porosity.config @@ -1,3 +1,2 @@ -### $Id$ ### porosity_diffusion11 1.0 porosity_mobility 0.001 diff --git a/config/Phase_Thermal.config b/config/Phase_Thermal.config index 5b6cb94d1..9c8baafa9 100644 --- a/config/Phase_Thermal.config +++ b/config/Phase_Thermal.config @@ -1,4 +1,3 @@ -### $Id$ ### thermal_conductivity11 237.0 specific_heat 910.0 mass_density 2700.0 diff --git a/config/Phase_Vacancy.config b/config/Phase_Vacancy.config index 2905913f6..075a0a6ec 100644 --- a/config/Phase_Vacancy.config +++ b/config/Phase_Vacancy.config @@ -1,4 +1,3 @@ -### $Id$ ### vacancyflux_diffusion11 1.0 vacancyflux_mobility11 1.0 vacancyFormationEnergy 1e-19 diff --git a/config/Source_Damage_IsoBrittle.config b/config/Source_Damage_IsoBrittle.config index 154aea36a..b248bb8fc 100644 --- a/config/Source_Damage_IsoBrittle.config +++ b/config/Source_Damage_IsoBrittle.config @@ -1,4 +1,3 @@ -### $Id$ ### (source) damage_isoBrittle isobrittle_criticalStrainEnergy 1400000.0 isobrittle_atol 0.01 diff --git a/config/Source_Thermal_Dissipation.config b/config/Source_Thermal_Dissipation.config index 218c5a4b5..6d7647410 100644 --- a/config/Source_Thermal_Dissipation.config +++ b/config/Source_Thermal_Dissipation.config @@ -1,3 +1,2 @@ -### $Id$ ### (source) thermal_dissipation dissipation_ColdWorkCoeff 0.95 diff --git a/config/Source_Vacancy_Irradiation.config b/config/Source_Vacancy_Irradiation.config index a346d73d4..df88119ea 100644 --- a/config/Source_Vacancy_Irradiation.config +++ b/config/Source_Vacancy_Irradiation.config @@ -1,4 +1,3 @@ -### $Id$ ### (source) vacancy_irradiation irradiation_cascadeprobability 0.00001 irradiation_cascadevolume 1000.0 diff --git a/config/Source_Vacancy_PhenoPlasticity.config b/config/Source_Vacancy_PhenoPlasticity.config index 634b39134..d46acc990 100644 --- a/config/Source_Vacancy_PhenoPlasticity.config +++ b/config/Source_Vacancy_PhenoPlasticity.config @@ -1,3 +1,2 @@ -### $Id$ ### (source) vacancy_phenoplasticity phenoplasticity_ratecoeff 0.01 diff --git a/config/Texture_FiberExample.config b/config/Texture_FiberExample.config index def483b16..74ddec9a6 100644 --- a/config/Texture_FiberExample.config +++ b/config/Texture_FiberExample.config @@ -1,4 +1,3 @@ -### $Id$ ### [FiberExample] axes x y -z # model coordinate x-, y-, z-axes correspond to which axes during texture measurement? this was a left handed coordinate system! # fiber axis in spherical coordinates: alpha crystal system, beta sample system diff --git a/config/Texture_Gauss_001.config b/config/Texture_Gauss_001.config index 4504432b0..153fab381 100644 --- a/config/Texture_Gauss_001.config +++ b/config/Texture_Gauss_001.config @@ -1,3 +1,2 @@ -### $Id$ ### [001] (gauss) phi1 0.000 Phi 0.000 phi2 0.000 scatter 0.000 fraction 1.000 \ No newline at end of file diff --git a/config/Texture_Gauss_101.config b/config/Texture_Gauss_101.config index 12e2c2733..28351eece 100644 --- a/config/Texture_Gauss_101.config +++ b/config/Texture_Gauss_101.config @@ -1,3 +1,2 @@ -### $Id$ ### [101] (gauss) phi1 0.000 Phi 45.000 phi2 90.000 scatter 0.000 fraction 1.000 \ No newline at end of file diff --git a/config/Texture_Gauss_111.config b/config/Texture_Gauss_111.config index 7fbc0ea2e..e4dc139f8 100644 --- a/config/Texture_Gauss_111.config +++ b/config/Texture_Gauss_111.config @@ -1,3 +1,2 @@ -### $Id$ ### [111] (gauss) phi1 0.000 Phi 54.7356 phi2 45.000 scatter 0.000 fraction 1.000 \ No newline at end of file diff --git a/config/Texture_Gauss_123.config b/config/Texture_Gauss_123.config index f366c114f..374674e09 100644 --- a/config/Texture_Gauss_123.config +++ b/config/Texture_Gauss_123.config @@ -1,3 +1,2 @@ -### $Id$ ### [123] (gauss) phi1 209.805 Phi 29.206 phi2 63.435 scatter 0.000 fraction 1.000 \ No newline at end of file diff --git a/config/Texture_RandomSingleCrystals.config b/config/Texture_RandomSingleCrystals.config index 92a3c0ed0..fac65ae20 100644 --- a/config/Texture_RandomSingleCrystals.config +++ b/config/Texture_RandomSingleCrystals.config @@ -1,3 +1,2 @@ -### $Id$ ### [RandomSingleCrystals] (random) scatter 0.000 fraction 1.000 \ No newline at end of file diff --git a/config/Texture_Rolling.config b/config/Texture_Rolling.config index 00d68e049..867abd2ab 100644 --- a/config/Texture_Rolling.config +++ b/config/Texture_Rolling.config @@ -1,4 +1,3 @@ -### $Id$ ### [Rolling] hybridIA rollingTexture.linearODF symmetry orthotropic # or monoclinic diff --git a/config/debug.config b/config/debug.config index d30659835..57349580a 100644 --- a/config/debug.config +++ b/config/debug.config @@ -1,4 +1,3 @@ -### $Id$ ### ### debugging parameters ### # example: diff --git a/config/material.config b/config/material.config index afef835b3..044de5674 100644 --- a/config/material.config +++ b/config/material.config @@ -1,4 +1,3 @@ -### $Id$ ### ### numerical parameters ### # The material.config file needs to specify five parts: diff --git a/config/numerics.config b/config/numerics.config index 24241b8c4..85e3592b4 100644 --- a/config/numerics.config +++ b/config/numerics.config @@ -1,4 +1,3 @@ -### $Id$ ### ### numerical parameters ### relevantStrain 1.0e-7 # strain increment considered significant (used by crystallite to determine whether strain inc is considered significant) diff --git a/examples/AbaqusStandard/material.config b/examples/AbaqusStandard/material.config index 9df0e3cf4..3c2cda56a 100644 --- a/examples/AbaqusStandard/material.config +++ b/examples/AbaqusStandard/material.config @@ -1,7 +1,3 @@ -##################### -# $Id$ -##################### - #-------------------# #-------------------# diff --git a/examples/MSC.Marc/material.config b/examples/MSC.Marc/material.config index a9c1b9219..c9c23ba84 100644 --- a/examples/MSC.Marc/material.config +++ b/examples/MSC.Marc/material.config @@ -1,7 +1,3 @@ -##################### -# $Id$ -##################### - #-------------------# #-------------------# diff --git a/installation/compile_CoreModule.py b/installation/compile_CoreModule.py index 0d85c3b0f..8772c4cd6 100755 --- a/installation/compile_CoreModule.py +++ b/installation/compile_CoreModule.py @@ -1,7 +1,7 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # -*- coding: UTF-8 no BOM -*- -import os,sys,glob,string,subprocess,shlex +import os,sys,glob,subprocess,shlex from damask import Environment from damask import version as DAMASKVERSION @@ -47,9 +47,13 @@ compileOptions = ' -DSpectral -DFLOAT=8 -DINT=4 -I%s/lib -DDAMASKVERSION=\\\\\"\ #--- this saves the path of libraries to core.so, hence it is known during runtime ---------------- if options['F90'] == 'gfortran': - LDFLAGS = '-shared -Wl,-undefined,dynamic_lookup' # solved error: Undefined symbols for architecture x86_64: "_PyArg_ParseTupleAndKeywords" as found on https://lists.macosforge.org/pipermail/macports-dev/2013-May/022735.html + # solved error: Undefined symbols for architecture x86_64: "_PyArg_ParseTupleAndKeywords" + # as found on https://lists.macosforge.org/pipermail/macports-dev/2013-May/022735.html + LDFLAGS = '-shared -Wl,-undefined,dynamic_lookup' else: - LDFLAGS = ' -openmp -Wl' # some f2py versions/configurations compile with openMP, so linking against openMP is needed to prevent errors during loading of core module + # some f2py versions/configurations compile with openMP, so linking against openMP is needed + # to prevent errors during loading of core module + LDFLAGS = ' -openmp -Wl' #--- run path of for fftw during runtime ---------------------------------------------------------- LDFLAGS += ',-rpath,%s/lib,-rpath,%s/lib64'%(options['FFTW_ROOT'],options['FFTW_ROOT']) diff --git a/installation/mods_Abaqus/abaqus_v6.env b/installation/mods_Abaqus/abaqus_v6.env index ac205d5c7..fd9f2ed51 100644 --- a/installation/mods_Abaqus/abaqus_v6.env +++ b/installation/mods_Abaqus/abaqus_v6.env @@ -1,7 +1,6 @@ # # DAMASK Abaqus Environment File # -# $Id$ # ------------------------------------ # originally taken from Abaqus ver. 6.11.1 # diff --git a/installation/mods_Abaqus/abaqus_v6_serial.env b/installation/mods_Abaqus/abaqus_v6_serial.env index 94e065e08..f1a6b2208 100644 --- a/installation/mods_Abaqus/abaqus_v6_serial.env +++ b/installation/mods_Abaqus/abaqus_v6_serial.env @@ -1,7 +1,6 @@ # # DAMASK Abaqus Environment File # -# $Id$ # ------------------------------------ # originally taken from Abaqus ver. 6.11.1 # diff --git a/installation/symlink_Code.py b/installation/symlink_Code.py index b68a2ea42..f0fea41e3 100755 --- a/installation/symlink_Code.py +++ b/installation/symlink_Code.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # -*- coding: UTF-8 no BOM -*- import os,sys diff --git a/installation/symlink_Processing.py b/installation/symlink_Processing.py index 8bd520267..0ca4f8ba4 100755 --- a/installation/symlink_Processing.py +++ b/installation/symlink_Processing.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # -*- coding: UTF-8 no BOM -*- # Makes postprocessing routines acessible from everywhere. diff --git a/lib/damask/asciitable.py b/lib/damask/asciitable.py index 3a0b36a8c..4fe4f9156 100644 --- a/lib/damask/asciitable.py +++ b/lib/damask/asciitable.py @@ -1,7 +1,5 @@ # -*- coding: UTF-8 no BOM -*- -# $Id$ - import os,sys import numpy as np @@ -27,7 +25,7 @@ class ASCIItable(): self.__IO__ = {'output': [], 'buffered': buffered, 'labeled': labeled, # header contains labels - 'labels': [], # labels according to file info + 'tags': [], # labels according to file info 'readBuffer': [], # buffer to hold non-advancing reads 'dataStart': 0, } @@ -51,7 +49,7 @@ class ASCIItable(): self.__IO__['out'] = outname self.info = [] - self.labels = [] + self.tags = [] self.data = [] self.line = '' @@ -141,10 +139,10 @@ class ASCIItable(): # ------------------------------------------------------------------ def head_read(self): """ - get column labels by either reading - - the first row or, if keyword "head[*]" is present, - the last line of the header + get column labels + + by either reading the first row or, + if keyword "head[*]" is present, the last line of the header """ import re,shlex @@ -161,7 +159,7 @@ class ASCIItable(): if self.__IO__['labeled']: # table features labels self.info = [self.__IO__['in'].readline().strip() for i in xrange(1,int(m.group(1)))] - self.labels = shlex.split(self.__IO__['in'].readline()) # store labels found in last line + self.tags = shlex.split(self.__IO__['in'].readline()) # store tags found in last line else: @@ -180,11 +178,11 @@ class ASCIItable(): else: break # last line of comments if self.__IO__['labeled']: # table features labels - self.labels = self.data # get labels from last line in "header"... + self.tags = self.data # get tags from last line in "header"... self.data_read() # ...and remove from buffer - if self.__IO__['labeled']: # table features labels - self.__IO__['labels'] = list(self.labels) # backup labels (make COPY, not link) + if self.__IO__['labeled']: # table features tags + self.__IO__['tags'] = list(self.tags) # backup tags (make COPY, not link) try: self.__IO__['dataStart'] = self.__IO__['in'].tell() # current file position is at start of data @@ -197,7 +195,7 @@ class ASCIItable(): """write current header information (info + labels)""" head = ['{}\theader'.format(len(self.info)+self.__IO__['labeled'])] if header else [] head.append(self.info) - if self.__IO__['labeled']: head.append('\t'.join(map(self._quote,self.labels))) + if self.__IO__['labeled']: head.append('\t'.join(map(self._quote,self.tags))) return self.output_write(head) @@ -261,19 +259,57 @@ class ASCIItable(): try: for item in what: self.labels_append(item) except: - self.labels += [self._removeCRLF(str(what))] + self.tags += [self._removeCRLF(str(what))] else: - self.labels += [self._removeCRLF(what)] + self.tags += [self._removeCRLF(what)] - self.__IO__['labeled'] = True # switch on processing (in particular writing) of labels - if reset: self.__IO__['labels'] = list(self.labels) # subsequent data_read uses current labels as data size + self.__IO__['labeled'] = True # switch on processing (in particular writing) of tags + if reset: self.__IO__['tags'] = list(self.tags) # subsequent data_read uses current tags as data size # ------------------------------------------------------------------ def labels_clear(self): """delete existing labels and switch to no labeling""" - self.labels = [] + self.tags = [] self.__IO__['labeled'] = False +# ------------------------------------------------------------------ + def labels(self, + tags = None, + raw = False): + """ + tell abstract labels. + + "x" for "1_x","2_x",... unless raw output is requested. + operates on object tags or given list. + """ + from collections import Iterable + + if tags is None: tags = self.tags + + if isinstance(tags, Iterable) and not raw: # check whether list of tags is requested + id = 0 + dim = 1 + labelList = [] + + while id < len(tags): + if not tags[id].startswith('1_'): + labelList.append(tags[id]) + else: + label = tags[id][2:] # get label + while id < len(tags) and tags[id] == '{}_{}'.format(dim,label): # check successors + id += 1 # next label... + dim += 1 # ...should be one higher dimension + labelList.append(label) # reached end --> store + id -= 1 # rewind one to consider again + + id += 1 + dim = 1 + + else: + labelList = self.tags + + return labelList + # ------------------------------------------------------------------ def label_index(self, labels): @@ -293,10 +329,10 @@ class ASCIItable(): idx.append(int(label)-1) # column given as integer number? except ValueError: try: - idx.append(self.labels.index(label)) # locate string in label list + idx.append(self.tags.index(label)) # locate string in label list except ValueError: try: - idx.append(self.labels.index('1_'+label)) # locate '1_'+string in label list + idx.append(self.tags.index('1_'+label)) # locate '1_'+string in label list except ValueError: idx.append(-1) # not found... else: @@ -304,10 +340,10 @@ class ASCIItable(): idx = int(labels)-1 # offset for python array indexing except ValueError: try: - idx = self.labels.index(labels) + idx = self.tags.index(labels) except ValueError: try: - idx = self.labels.index('1_'+labels) # locate '1_'+string in label list + idx = self.tags.index('1_'+labels) # locate '1_'+string in label list except ValueError: idx = None if labels is None else -1 @@ -332,16 +368,16 @@ class ASCIItable(): try: # column given as number? idx = int(label)-1 myDim = 1 # if found has at least dimension 1 - if self.labels[idx].startswith('1_'): # column has multidim indicator? - while idx+myDim < len(self.labels) and self.labels[idx+myDim].startswith("%i_"%(myDim+1)): + if self.tags[idx].startswith('1_'): # column has multidim indicator? + while idx+myDim < len(self.tags) and self.tags[idx+myDim].startswith("%i_"%(myDim+1)): myDim += 1 # add while found except ValueError: # column has string label - if label in self.labels: # can be directly found? + if label in self.tags: # can be directly found? myDim = 1 # scalar by definition - elif '1_'+label in self.labels: # look for first entry of possible multidim object - idx = self.labels.index('1_'+label) # get starting column + elif '1_'+label in self.tags: # look for first entry of possible multidim object + idx = self.tags.index('1_'+label) # get starting column myDim = 1 # (at least) one-dimensional - while idx+myDim < len(self.labels) and self.labels[idx+myDim].startswith("%i_"%(myDim+1)): + while idx+myDim < len(self.tags) and self.tags[idx+myDim].startswith("%i_"%(myDim+1)): myDim += 1 # keep adding while going through object dim.append(myDim) @@ -351,16 +387,16 @@ class ASCIItable(): try: # column given as number? idx = int(labels)-1 dim = 1 # if found has at least dimension 1 - if self.labels[idx].startswith('1_'): # column has multidim indicator? - while idx+dim < len(self.labels) and self.labels[idx+dim].startswith("%i_"%(dim+1)): + if self.tags[idx].startswith('1_'): # column has multidim indicator? + while idx+dim < len(self.tags) and self.tags[idx+dim].startswith("%i_"%(dim+1)): dim += 1 # add as long as found except ValueError: # column has string label - if labels in self.labels: # can be directly found? + if labels in self.tags: # can be directly found? dim = 1 # scalar by definition - elif '1_'+labels in self.labels: # look for first entry of possible multidim object - idx = self.labels.index('1_'+labels) # get starting column + elif '1_'+labels in self.tags: # look for first entry of possible multidim object + idx = self.tags.index('1_'+labels) # get starting column dim = 1 # is (at least) one-dimensional - while idx+dim < len(self.labels) and self.labels[idx+dim].startswith("%i_"%(dim+1)): + while idx+dim < len(self.tags) and self.tags[idx+dim].startswith("%i_"%(dim+1)): dim += 1 # keep adding while going through object return np.array(dim) if isinstance(dim,Iterable) else dim @@ -404,8 +440,8 @@ class ASCIItable(): def data_rewind(self): self.__IO__['in'].seek(self.__IO__['dataStart']) # position file to start of data section self.__IO__['readBuffer'] = [] # delete any non-advancing data reads - self.labels = list(self.__IO__['labels']) # restore label info found in header (as COPY, not link) - self.__IO__['labeled'] = len(self.labels) > 0 + self.tags = list(self.__IO__['tags']) # restore label info found in header (as COPY, not link) + self.__IO__['labeled'] = len(self.tags) > 0 # ------------------------------------------------------------------ def data_skipLines(self, @@ -432,8 +468,8 @@ class ASCIItable(): self.line = self.line.rstrip('\n') if self.__IO__['labeled'] and respectLabels: # if table has labels - items = shlex.split(self.line)[:len(self.__IO__['labels'])] # use up to label count (from original file info) - self.data = items if len(items) == len(self.__IO__['labels']) else [] # take entries if label count matches + items = shlex.split(self.line)[:len(self.__IO__['tags'])] # use up to label count (from original file info) + self.data = items if len(items) == len(self.__IO__['tags']) else [] # take entries if label count matches else: self.data = shlex.split(self.line) # otherwise take all @@ -470,7 +506,7 @@ class ASCIItable(): 1)) use = np.array(columns) - self.labels = list(np.array(self.labels)[use]) # update labels with valid subset + self.tags = list(np.array(self.tags)[use]) # update labels with valid subset self.data = np.loadtxt(self.__IO__['in'],usecols=use,ndmin=2) @@ -545,8 +581,8 @@ class ASCIItable(): def datatype(item): return int(item) if type.lower() == 'i' else float(item) - N = grid.prod() # expected number of microstructure indices in data - microstructure = np.zeros(N,type) # initialize as flat array + N = grid.prod() # expected number of microstructure indices in data + microstructure = np.zeros(N,type) # initialize as flat array i = 0 while i < N and self.data_read(): @@ -557,7 +593,7 @@ class ASCIItable(): else: items = map(datatype,items) else: items = map(datatype,items) - s = min(len(items), N-i) # prevent overflow of microstructure array + s = min(len(items), N-i) # prevent overflow of microstructure array microstructure[i:i+s] = items[:s] i += len(items) diff --git a/lib/damask/config/material.py b/lib/damask/config/material.py index bca005e0e..c1c3ad6b4 100644 --- a/lib/damask/config/material.py +++ b/lib/damask/config/material.py @@ -1,6 +1,5 @@ # -*- coding: UTF-8 no BOM -*- -# $Id$ import re class Section(): diff --git a/lib/damask/environment.py b/lib/damask/environment.py index cd9b247e8..8ceb093dd 100644 --- a/lib/damask/environment.py +++ b/lib/damask/environment.py @@ -1,6 +1,5 @@ # -*- coding: UTF-8 no BOM -*- -# $Id$ import os,subprocess,shlex diff --git a/lib/damask/geometry/geometry.py b/lib/damask/geometry/geometry.py index 25a676b83..cfefa51aa 100644 --- a/lib/damask/geometry/geometry.py +++ b/lib/damask/geometry/geometry.py @@ -1,6 +1,5 @@ # -*- coding: UTF-8 no BOM -*- -# $Id$ import damask.geometry diff --git a/lib/damask/geometry/marc.py b/lib/damask/geometry/marc.py index 3fed41990..405227664 100644 --- a/lib/damask/geometry/marc.py +++ b/lib/damask/geometry/marc.py @@ -1,6 +1,5 @@ # -*- coding: UTF-8 no BOM -*- -# $Id$ from .geometry import Geometry diff --git a/lib/damask/geometry/spectral.py b/lib/damask/geometry/spectral.py index f7c52079f..0e4f19399 100644 --- a/lib/damask/geometry/spectral.py +++ b/lib/damask/geometry/spectral.py @@ -1,6 +1,5 @@ # -*- coding: UTF-8 no BOM -*- -# $Id$ from .geometry import Geometry diff --git a/lib/damask/result.py b/lib/damask/result.py index bb68c3ac5..acd207d84 100644 --- a/lib/damask/result.py +++ b/lib/damask/result.py @@ -1,6 +1,5 @@ # -*- coding: UTF-8 no BOM -*- -# $Id$ import numpy as np import sys diff --git a/lib/damask/setup_corientation.py b/lib/damask/setup_corientation.py index 3bc186233..2cf0be196 100755 --- a/lib/damask/setup_corientation.py +++ b/lib/damask/setup_corientation.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # -*- coding: UTF-8 no BOM -*- from distutils.core import setup diff --git a/lib/damask/solver/abaqus.py b/lib/damask/solver/abaqus.py index 7a8321a9c..0a872bc7a 100644 --- a/lib/damask/solver/abaqus.py +++ b/lib/damask/solver/abaqus.py @@ -1,6 +1,5 @@ # -*- coding: UTF-8 no BOM -*- -# $Id$ from .solver import Solver diff --git a/lib/damask/solver/marc.py b/lib/damask/solver/marc.py index 660f2f6ef..e693783f6 100644 --- a/lib/damask/solver/marc.py +++ b/lib/damask/solver/marc.py @@ -1,6 +1,5 @@ # -*- coding: UTF-8 no BOM -*- -# $Id$ from .solver import Solver diff --git a/lib/damask/solver/solver.py b/lib/damask/solver/solver.py index 53c055f05..175a86cd6 100644 --- a/lib/damask/solver/solver.py +++ b/lib/damask/solver/solver.py @@ -1,6 +1,5 @@ # -*- coding: UTF-8 no BOM -*- -# $Id$ import damask.solver diff --git a/lib/damask/solver/spectral.py b/lib/damask/solver/spectral.py index d83ea8da9..7d40c1ec3 100644 --- a/lib/damask/solver/spectral.py +++ b/lib/damask/solver/spectral.py @@ -1,6 +1,5 @@ # -*- coding: UTF-8 no BOM -*- -# $Id$ from .solver import Solver diff --git a/lib/damask/test/test.py b/lib/damask/test/test.py index 826b190c1..e617568f8 100644 --- a/lib/damask/test/test.py +++ b/lib/damask/test/test.py @@ -1,6 +1,5 @@ # -*- coding: UTF-8 no BOM -*- -# $Id$ import os,sys,shutil import logging,logging.config @@ -41,7 +40,7 @@ class Test(): +'----------------------------------------------------------------') self.dirBase = os.path.dirname(os.path.realpath(sys.modules[self.__class__.__module__].__file__)) self.parser = OptionParser( - description = test_description+' (using class: $Id$)', + description = test_description+' (using class: {})'.format(damask.version), usage='./test.py [options]') self.updateRequested = False self.parser.add_option("-d", "--debug", action="store_true",\ diff --git a/processing/misc/ang_toTable.py b/processing/misc/ang_toTable.py index 48b38f0b0..110ea6ddf 100755 --- a/processing/misc/ang_toTable.py +++ b/processing/misc/ang_toTable.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # -*- coding: UTF-8 no BOM -*- import os diff --git a/processing/misc/calculateAnisotropy.py b/processing/misc/calculateAnisotropy.py index c390926bb..a88b39b74 100644 --- a/processing/misc/calculateAnisotropy.py +++ b/processing/misc/calculateAnisotropy.py @@ -1,4 +1,3 @@ -#!/usr/bin/python # -*- coding: UTF-8 no BOM -*- import threading,os,string diff --git a/processing/misc/gwyddion_filter.py b/processing/misc/gwyddion_filter.py index 7748b101f..fd4df19a0 100755 --- a/processing/misc/gwyddion_filter.py +++ b/processing/misc/gwyddion_filter.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # -*- coding: UTF-8 no BOM -*- import os,string,scipy diff --git a/processing/misc/vtk_fromGwyddion.py b/processing/misc/vtk_fromGwyddion.py index 6f13a2e0f..8fa206074 100755 --- a/processing/misc/vtk_fromGwyddion.py +++ b/processing/misc/vtk_fromGwyddion.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # -*- coding: UTF-8 no BOM -*- import os,string,vtk diff --git a/processing/misc/yieldSurface.py b/processing/misc/yieldSurface.py index 44777bf52..e7e6b473b 100755 --- a/processing/misc/yieldSurface.py +++ b/processing/misc/yieldSurface.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python2 # -*- coding: UTF-8 no BOM -*- import threading,time,os diff --git a/processing/post/3Dvisualize.py b/processing/post/3Dvisualize.py index c18fbb694..e29a761df 100755 --- a/processing/post/3Dvisualize.py +++ b/processing/post/3Dvisualize.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # -*- coding: UTF-8 no BOM -*- import os,sys,re,fnmatch,vtk @@ -227,7 +227,7 @@ for filename in args: locol = -1 for col,head in enumerate(headings): - if head == {True:'1_ipinitialcoord',False:'1_nodeinitialcoord'}[options.cell]: + if head == {True:'1_pos',False:'1_nodeinitialcoord'}[options.cell]: locol = col maxcol = max(maxcol,col+3) break @@ -430,4 +430,4 @@ for filename in args: vtk = open(os.path.join(head,what+'_'+os.path.splitext(tail)[0]+'.vtk'), 'w') output(out[what],{'filepointer':vtk},'File') vtk.close() - print \ No newline at end of file + print diff --git a/processing/post/addAPS34IDEstrainCoords.py b/processing/post/addAPS34IDEstrainCoords.py index 0258606ca..4c01c55e7 100755 --- a/processing/post/addAPS34IDEstrainCoords.py +++ b/processing/post/addAPS34IDEstrainCoords.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # -*- coding: UTF-8 no BOM -*- import os,sys diff --git a/processing/post/addCalculation.py b/processing/post/addCalculation.py index 7d7727a18..124949623 100755 --- a/processing/post/addCalculation.py +++ b/processing/post/addCalculation.py @@ -10,16 +10,12 @@ import damask scriptName = os.path.splitext(os.path.basename(__file__))[0] scriptID = ' '.join([scriptName,damask.version]) -def unravel(item): - if hasattr(item,'__contains__'): return ' '.join(map(unravel,item)) - else: return str(item) - # -------------------------------------------------------------------- # MAIN # -------------------------------------------------------------------- parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [file[s]]', description = """ -Add column(s) with derived values according to user-defined arithmetic operation between column(s). +Add or alter column(s) with derived values according to user-defined arithmetic operation between column(s). Column labels are tagged by '#label#' in formulas. Use ';' for ',' in functions. Numpy is available as np. @@ -37,6 +33,13 @@ parser.add_option('-f','--formula', action = 'extend', metavar = '', help = '(list of) formulas corresponding to labels') +parser.add_option('-c','--condition', + dest = 'condition', metavar='string', + help = 'condition to filter rows') + +parser.set_defaults(condition = None, + ) + (options,filenames) = parser.parse_args() if options.labels is None or options.formulas is None: @@ -53,7 +56,10 @@ if filenames == []: filenames = [None] for name in filenames: try: - table = damask.ASCIItable(name = name, buffered = False) + table = damask.ASCIItable(name = name, + buffered = False) + output = damask.ASCIItable(name = name, + buffered = False) except: continue damask.util.report(scriptName,name) @@ -62,14 +68,41 @@ for name in filenames: table.head_read() -# ------------------------------------------ build formulae ---------------------------------------- - +# ----------------------------------------------------------------------------------------------------- specials = { \ '_row_': 0, } +# ------------------------------------------ Evaluate condition --------------------------------------- + if options.condition: + interpolator = [] + condition = options.condition # copy per file, since might be altered inline + breaker = False + + for position,operand in enumerate(set(re.findall(r'#(([s]#)?(.+?))#',condition))): # find three groups + condition = condition.replace('#'+operand[0]+'#', + { '': '{%i}'%position, + 's#':'"{%i}"'%position}[operand[1]]) + if operand[2] in specials: # special label + interpolator += ['specials["%s"]'%operand[2]] + else: + try: + interpolator += ['%s(table.data[%i])'%({ '':'float', + 's#':'str'}[operand[1]], + table.label_index(operand[2]))] # ccould be generalized to indexrange as array lookup + except: + damask.util.croak('column "{}" not found.'.format(operand[2])) + breaker = True + + if breaker: continue # found mistake in condition evaluation --> next file + + evaluator_condition = "'" + condition + "'.format(" + ','.join(interpolator) + ")" + + else: condition = '' + +# ------------------------------------------ build formulae ---------------------------------------- + evaluator = {} - brokenFormula = {} for label,formula in zip(options.labels,options.formulas): for column in re.findall(r'#(.+?)#',formula): # loop over column labels in formula @@ -82,15 +115,15 @@ for name in filenames: elif dim > 1: # multidimensional input (vector, tensor, etc.) replacement = 'np.array(table.data[{}:{}],dtype=float)'.format(idx,idx+dim) # use (flat) array representation else: - damask.util.croak('column {} not found...'.format(column)) - brokenFormula[label] = True + damask.util.croak('column {} not found, skipping {}...'.format(column,label)) + options.labels.remove(label) break formula = formula.replace('#'+column+'#',replacement) - - if label not in brokenFormula: - evaluator[label] = formula + evaluator[label] = formula + + # ------------------------------------------ process data ------------------------------------------ firstLine = True @@ -98,32 +131,53 @@ for name in filenames: while outputAlive and table.data_read(): # read next data line of ASCII table specials['_row_'] += 1 # count row - + output.data_clear() + # ------------------------------------------ calculate one result to get length of labels --------- if firstLine: firstLine = False labelDim = {} - for label in [x for x in options.labels if x not in set(brokenFormula)]: + for label in [x for x in options.labels]: labelDim[label] = np.size(eval(evaluator[label])) - if labelDim[label] == 0: brokenFormula[label] = True + if labelDim[label] == 0: options.labels.remove(label) # ------------------------------------------ assemble header --------------------------------------- - if label not in brokenFormula: - table.labels_append(['{}_{}'.format(i+1,label) for i in xrange(labelDim[label])] if labelDim[label] > 1 - else label) + output.labels_clear() + tabLabels = table.labels() + for label in tabLabels: + dim = labelDim[label] if label in options.labels \ + else table.label_dimension(label) + output.labels_append(['{}_{}'.format(i+1,label) for i in xrange(dim)] if dim > 1 else label) - table.info_append(scriptID + '\t' + ' '.join(sys.argv[1:])) - table.head_write() + for label in options.labels: + if label in tabLabels: continue + output.labels_append(['{}_{}'.format(i+1,label) for i in xrange(labelDim[label])] + if labelDim[label] > 1 + else label) + + output.info = table.info + output.info_append(scriptID + '\t' + ' '.join(sys.argv[1:])) + output.head_write() # ------------------------------------------ process data ------------------------------------------ - for label in [x for x in options.labels if x not in set(brokenFormula)]: - table.data_append(unravel(eval(evaluator[label]))) + for label in output.labels(): + oldIndices = table.label_indexrange(label) + Nold = max(1,len(oldIndices)) # Nold could be zero for new columns + Nnew = len(output.label_indexrange(label)) + output.data_append(eval(evaluator[label]) if label in options.labels and + (condition == '' or eval(eval(evaluator_condition))) + else np.tile([table.data[i] for i in oldIndices] + if label in tabLabels + else np.nan, + np.ceil(float(Nnew)/Nold))[:Nnew]) # spread formula result into given number of columns - outputAlive = table.data_write() # output processed line + outputAlive = output.data_write() # output processed line -# ------------------------------------------ output finalization ----------------------------------- +# ------------------------------------------ output finalization ----------------------------------- - table.close() # close ASCII tables \ No newline at end of file + table.input_close() # close ASCII tables + output.close() # close ASCII tables + \ No newline at end of file diff --git a/processing/post/addCauchy.py b/processing/post/addCauchy.py index 3fb889eec..beebb0422 100755 --- a/processing/post/addCauchy.py +++ b/processing/post/addCauchy.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # -*- coding: UTF-8 no BOM -*- import os,sys diff --git a/processing/post/addCompatibilityMismatch.py b/processing/post/addCompatibilityMismatch.py index 3a73859e1..e4fc4a145 100755 --- a/processing/post/addCompatibilityMismatch.py +++ b/processing/post/addCompatibilityMismatch.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # -*- coding: UTF-8 no BOM -*- import os,sys @@ -64,10 +64,12 @@ for name in filenames: errors = [] remarks = [] - if table.label_dimension(options.pos) != 3: errors.append('coordinates {} are not a vector.'.format(options.pos)) + if table.label_dimension(options.pos) != 3: + errors.append('coordinates "{}" are not a vector.'.format(options.pos)) else: colCoord = table.label_index(options.pos) - if table.label_dimension(options.defgrad) != 9: errors.append('deformation gradient {} is not a tensor.'.format(options.defgrad)) + if table.label_dimension(options.defgrad) != 9: + errors.append('deformation gradient "{}" is not a tensor.'.format(options.defgrad)) else: colF = table.label_index(options.defgrad) if remarks != []: damask.util.croak(remarks) @@ -91,21 +93,21 @@ for name in filenames: maxcorner = np.array(map(max,coords)) grid = np.array(map(len,coords),'i') size = grid/np.maximum(np.ones(3,'d'), grid-1.0) * (maxcorner-mincorner) # size from edge to edge = dim * n/(n-1) - size = np.where(grid > 1, size, min(size[grid > 1]/grid[grid > 1])) # spacing for grid==1 set to smallest among other spacings + size = np.where(grid > 1, size, min(size[grid > 1]/grid[grid > 1])) # grid==1 spacing set to smallest among other ones N = grid.prod() # --------------- figure out columns to process --------------------------------------------------- - key = '1_%s'%options.defgrad - if key not in table.labels: - file['croak'].write('column %s not found...\n'%key) + key = '1_'+options.defgrad + if table.label_index(key) == -1: + damask.util.croak('column "{}" not found...'.format(key)) continue else: - column = table.labels.index(key) # remember columns of requested data + column = table.label_index(key) # remember columns of requested data # ------------------------------------------ assemble header --------------------------------------- - if options.shape: table.labels_append(['shapeMismatch(%s)' %options.defgrad]) - if options.volume: table.labels_append(['volMismatch(%s)'%options.defgrad]) + if options.shape: table.labels_append(['shapeMismatch({})'.format(options.defgrad)]) + if options.volume: table.labels_append(['volMismatch({})'.format(options.defgrad)]) table.head_write() # ------------------------------------------ read deformation gradient field ----------------------- diff --git a/processing/post/addCumulative.py b/processing/post/addCumulative.py index a65677883..a577b68fe 100755 --- a/processing/post/addCumulative.py +++ b/processing/post/addCumulative.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # -*- coding: UTF-8 no BOM -*- import os,sys diff --git a/processing/post/addCurl.py b/processing/post/addCurl.py index 5c9a4b411..3afec570a 100755 --- a/processing/post/addCurl.py +++ b/processing/post/addCurl.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # -*- coding: UTF-8 no BOM -*- import os,sys,math diff --git a/processing/post/addDeterminant.py b/processing/post/addDeterminant.py index c537e5bd0..dc04dd8ff 100755 --- a/processing/post/addDeterminant.py +++ b/processing/post/addDeterminant.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # -*- coding: UTF-8 no BOM -*- import os,sys diff --git a/processing/post/addDeviator.py b/processing/post/addDeviator.py index 492f44c70..d96564d4c 100755 --- a/processing/post/addDeviator.py +++ b/processing/post/addDeviator.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # -*- coding: UTF-8 no BOM -*- import os,sys diff --git a/processing/post/addDisplacement.py b/processing/post/addDisplacement.py index 782a7c24b..c53f1ba61 100755 --- a/processing/post/addDisplacement.py +++ b/processing/post/addDisplacement.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # -*- coding: UTF-8 no BOM -*- import os,sys,math diff --git a/processing/post/addDivergence.py b/processing/post/addDivergence.py index f13cb3a89..56ccb1b07 100755 --- a/processing/post/addDivergence.py +++ b/processing/post/addDivergence.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # -*- coding: UTF-8 no BOM -*- import os,sys,math diff --git a/processing/post/addEhkl.py b/processing/post/addEhkl.py index 96ec79a96..7b745526a 100755 --- a/processing/post/addEhkl.py +++ b/processing/post/addEhkl.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # -*- coding: UTF-8 no BOM -*- import os,sys diff --git a/processing/post/addEuclideanDistance.py b/processing/post/addEuclideanDistance.py index 4b3f518d5..8cb6c3b83 100755 --- a/processing/post/addEuclideanDistance.py +++ b/processing/post/addEuclideanDistance.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # -*- coding: UTF-8 no BOM -*- import os,sys,itertools diff --git a/processing/post/addGradient.py b/processing/post/addGradient.py index 12ecf218d..66018a890 100755 --- a/processing/post/addGradient.py +++ b/processing/post/addGradient.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # -*- coding: UTF-8 no BOM -*- import os,sys,math diff --git a/processing/post/addGrainID.py b/processing/post/addGrainID.py index b7d9a2274..d3c2dd14d 100755 --- a/processing/post/addGrainID.py +++ b/processing/post/addGrainID.py @@ -1,4 +1,5 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 +# -*- coding: UTF-8 no BOM -*- import os,sys,time,copy import numpy as np diff --git a/processing/post/addIPFcolor.py b/processing/post/addIPFcolor.py index 2a1a3581a..6a9e39e18 100755 --- a/processing/post/addIPFcolor.py +++ b/processing/post/addIPFcolor.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # -*- coding: UTF-8 no BOM -*- import os,sys,math diff --git a/processing/post/addInfo.py b/processing/post/addInfo.py index 5d48c25df..2c8749d0c 100755 --- a/processing/post/addInfo.py +++ b/processing/post/addInfo.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # -*- coding: UTF-8 no BOM -*- import os diff --git a/processing/post/addMapped.py b/processing/post/addMapped.py index 2ce84959c..503b0a1f3 100755 --- a/processing/post/addMapped.py +++ b/processing/post/addMapped.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # -*- coding: UTF-8 no BOM -*- import os,sys diff --git a/processing/post/addMises.py b/processing/post/addMises.py index 771cb7bc4..9d6a9f9db 100755 --- a/processing/post/addMises.py +++ b/processing/post/addMises.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # -*- coding: UTF-8 no BOM -*- import os,sys,math diff --git a/processing/post/addNorm.py b/processing/post/addNorm.py index 3aa9e8c04..0911e5784 100755 --- a/processing/post/addNorm.py +++ b/processing/post/addNorm.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # -*- coding: UTF-8 no BOM -*- import os,sys,math diff --git a/processing/post/addOrientations.py b/processing/post/addOrientations.py index f7519d92c..2f88107df 100755 --- a/processing/post/addOrientations.py +++ b/processing/post/addOrientations.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # -*- coding: UTF-8 no BOM -*- import os,sys,math diff --git a/processing/post/addPK2.py b/processing/post/addPK2.py index 349b9e106..59084a88c 100755 --- a/processing/post/addPK2.py +++ b/processing/post/addPK2.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # -*- coding: UTF-8 no BOM -*- import os,sys diff --git a/processing/post/addPole.py b/processing/post/addPole.py index a57fef9eb..6cbd26880 100755 --- a/processing/post/addPole.py +++ b/processing/post/addPole.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # -*- coding: UTF-8 no BOM -*- import os,sys,math diff --git a/processing/post/addSchmidfactors.py b/processing/post/addSchmidfactors.py index 5a08024fc..828132471 100755 --- a/processing/post/addSchmidfactors.py +++ b/processing/post/addSchmidfactors.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # -*- coding: UTF-8 no BOM -*- import os,sys,math diff --git a/processing/post/addSpectralDecomposition.py b/processing/post/addSpectralDecomposition.py index 0555bb5bc..2f8f32fd7 100755 --- a/processing/post/addSpectralDecomposition.py +++ b/processing/post/addSpectralDecomposition.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # -*- coding: UTF-8 no BOM -*- import os,sys diff --git a/processing/post/addStrainTensors.py b/processing/post/addStrainTensors.py index bd5d7fccf..654d7583a 100755 --- a/processing/post/addStrainTensors.py +++ b/processing/post/addStrainTensors.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # -*- coding: UTF-8 no BOM -*- import os,sys diff --git a/processing/post/addTable.py b/processing/post/addTable.py index a0055e0b6..df47b6c55 100755 --- a/processing/post/addTable.py +++ b/processing/post/addTable.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # -*- coding: UTF-8 no BOM -*- import os,sys diff --git a/processing/post/averageDown.py b/processing/post/averageDown.py index 808ed28bb..ec8e6e8ed 100755 --- a/processing/post/averageDown.py +++ b/processing/post/averageDown.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # -*- coding: UTF-8 no BOM -*- import os,sys diff --git a/processing/post/averageTable.py b/processing/post/averageTable.py index aaa4ea88d..b059404c9 100755 --- a/processing/post/averageTable.py +++ b/processing/post/averageTable.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # -*- coding: UTF-8 no BOM -*- import os,sys diff --git a/processing/post/binXY.py b/processing/post/binXY.py index c44d60de2..693b71e59 100755 --- a/processing/post/binXY.py +++ b/processing/post/binXY.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # -*- coding: UTF-8 no BOM -*- import os,sys @@ -165,7 +165,8 @@ for name in filenames: table.info_clear() table.info_append(scriptID + '\t' + ' '.join(sys.argv[1:])) - table.labels = ['bin_%s'%options.data[0],'bin_%s'%options.data[1],'z'] + table.labels_clear() + table.labels_append(['bin_%s'%options.data[0],'bin_%s'%options.data[1],'z']) table.head_write() # --- output result --------------------------------------------------------------------------------- diff --git a/processing/post/blowUp.py b/processing/post/blowUp.py index 6a73fe15a..430a4f388 100755 --- a/processing/post/blowUp.py +++ b/processing/post/blowUp.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # -*- coding: UTF-8 no BOM -*- import os,sys @@ -63,7 +63,7 @@ for name in filenames: errors = [] remarks = [] - if table.label_dimension(options.pos) != 3: errors.append('coordinates {} are not a vector.'.format(options.pos)) + if table.label_dimension(options.pos) != 3: errors.append('coordinates "{}" are not a vector.'.format(options.pos)) else: colCoord = table.label_index(options.pos) colElem = table.label_index('elem') @@ -96,7 +96,7 @@ for name in filenames: # ------------------------------------------ process data ------------------------------------------- - data = np.zeros(outSize.tolist()+[len(table.labels)]) + data = np.zeros(outSize.tolist()+[len(table.labels(raw = True))]) p = np.zeros(3,'i') for p[2] in xrange(grid[2]): diff --git a/processing/post/fillTable.py b/processing/post/fillTable.py deleted file mode 100755 index fc40eed8f..000000000 --- a/processing/post/fillTable.py +++ /dev/null @@ -1,143 +0,0 @@ -#!/usr/bin/env python -# -*- coding: UTF-8 no BOM -*- - -import os,re,sys -import math # noqa -import numpy as np -from optparse import OptionParser -import damask - -scriptName = os.path.splitext(os.path.basename(__file__))[0] -scriptID = ' '.join([scriptName,damask.version]) - -def unravel(item): - if hasattr(item,'__contains__'): return ' '.join(map(unravel,item)) - else: return str(item) - -# -------------------------------------------------------------------- -# MAIN -# -------------------------------------------------------------------- - -parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [file[s]]', description = """ -Update existing value(s) to expression(s) respecting condition. - -Examples: -Replace the 2nd value of column x by value "z - y" --> fillTable -l x -c "#_row_#==2" -f "#z#-#y#" - -""", version = scriptID) - -parser.add_option('-l','--label', - dest = 'labels', - action = 'extend', metavar = '', - help = '(list) of columns to be filled with formula(e)') -parser.add_option('-f','--formula', - dest = 'formulae', - action = 'extend', metavar = '', - help = '(list of) formulae corresponding to labels') -parser.add_option('-c','--condition', - dest = 'condition', metavar='string', - help = 'condition to filter rows') - -parser.set_defaults(condition = '', - ) - -(options,filenames) = parser.parse_args() - -if options.labels is None or options.formulae is None: - parser.error('no formulae specified.') -if len(options.labels) != len(options.formulae): - parser.error('number of labels ({}) and formulae ({}) do not match.'.format(len(options.labels),len(options.formulae))) - -for i in xrange(len(options.formulae)): - options.formulae[i] = options.formulae[i].replace(';',',') - -# --- loop over input files ------------------------------------------------------------------------- - -if filenames == []: filenames = [None] - -for name in filenames: - try: - table = damask.ASCIItable(name = name, - buffered = False) - except: continue - damask.util.report(scriptName,name) - -# ------------------------------------------ assemble info ----------------------------------------- - - table.head_read() -# ------------------------------------------ Evaluate condition --------------------------------------- - - specials = { \ - '_row_': 0, - } - - interpolator = [] - condition = options.condition # copy per file, since might be altered inline - breaker = False - - for position,operand in enumerate(set(re.findall(r'#(([s]#)?(.+?))#',condition))): # find three groups - condition = condition.replace('#'+operand[0]+'#', - { '': '{%i}'%position, - 's#':'"{%i}"'%position}[operand[1]]) - if operand[2] in specials: # special label - interpolator += ['specials["%s"]'%operand[2]] - else: - try: - interpolator += ['%s(table.data[%i])'%({ '':'float', - 's#':'str'}[operand[1]], - table.labels.index(operand[2]))] # ccould be generalized to indexrange as array lookup - except: - damask.util.croak('column %s not found.'%operand[2]) - breaker = True - - if breaker: continue # found mistake in condition evaluation --> next file - - evaluator_condition = "'" + condition + "'.format(" + ','.join(interpolator) + ")" - -#----------------------------------- Formula ------------------------------------------------------- - - evaluator = {} - brokenFormula = {} - for label,formula in zip(options.labels,options.formulae): - for column in re.findall(r'#(.+?)#',formula): # loop over column labels in formula - idx = table.label_index(column) - dim = table.label_dimension(column) - if column in specials: - replacement = 'specials["{}"]'.format(column) - elif dim == 1: # scalar input - replacement = 'float(table.data[{}])'.format(idx) # take float value of data column - elif dim > 1: # multidimensional input (vector, tensor, etc.) - replacement = 'np.array(table.data[{}:{}],dtype=float)'.format(idx,idx+dim) # use (flat) array representation - else: - damask.util.croak('column {} not found...'.format(column)) - brokenFormula[label] = True - break - formula = formula.replace('#'+column+'#',replacement) - if label not in brokenFormula: - evaluator[label] = formula - -# ------------------------------------------ assemble header --------------------------------------- - - table.info_append(scriptID + '\t' + ' '.join(sys.argv[1:])) # read ASCII header info - table.labels # update with label set - table.head_write() - -# ------------------------------------------ process data ------------------------------------------ - - outputAlive = True - while outputAlive and table.data_read(): # read next data line of ASCII table - specials['_row_'] += 1 - if condition == '' or eval(eval(evaluator_condition)): # test row for condition - for label in [x for x in options.labels if x not in set(brokenFormula)]: - indices = table.label_indexrange(label) # affected columns - probe = np.array(eval(evaluator[label])) # get formula result (scalar, array, etc.) - container = np.tile(probe,np.ceil(float(len(indices))/probe.size))[:len(indices)] # spread formula result into given number of columns - for i,ind in enumerate(indices): # copy one by one as table.data is NOT a numpy array - table.data[ind] = container[i] - - outputAlive = table.data_write() # output processed line - -# ------------------------------------------ output finalization ----------------------------------- - - table.close() # close ASCII tables - diff --git a/processing/post/filterTable.py b/processing/post/filterTable.py index 6723d9faf..41a0634f3 100755 --- a/processing/post/filterTable.py +++ b/processing/post/filterTable.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # -*- coding: UTF-8 no BOM -*- import os,re,sys,fnmatch @@ -79,7 +79,7 @@ for name in filenames: labels = [] positions = [] - for position,label in enumerate(table.labels): + for position,label in enumerate(table.labels(raw = True)): if (options.whitelist is None or any([ position in table.label_indexrange(needle) \ or fnmatch.fnmatch(label,needle) for needle in options.whitelist])) \ and (options.blacklist is None or not any([ position in table.label_indexrange(needle) \ @@ -103,17 +103,17 @@ for name in filenames: condition = options.condition # copy per file, might be altered for position,operand in enumerate(set(re.findall(r'#(([s]#)?(.+?))#',condition))): # find three groups condition = condition.replace('#'+operand[0]+'#', - { '': '{%i}'%position, - 's#':'"{%i}"'%position}[operand[1]]) + { '': '{{{}}}' .format(position), + 's#':'"{{{}}}"'.format(position)}[operand[1]]) if operand[2] in specials: # special label ? - interpolator += ['specials["%s"]'%operand[2]] + interpolator += ['specials["{}"]'.format(operand[2])] else: try: - interpolator += ['%s(table.data[%i])'%({ '':'float', - 's#':'str'}[operand[1]], - table.labels.index(operand[2]))] + interpolator += ['{}(table.data[{}])'.format({ '':'float', + 's#':'str'}[operand[1]], + table.label_index(operand[2]))] except: - parser.error('column %s not found...\n'%operand[2]) + parser.error('column "{}" not found...\n'.format(operand[2])) evaluator = "'" + condition + "'.format(" + ','.join(interpolator) + ")" diff --git a/processing/post/histogram.py b/processing/post/histogram.py index d5d4cd185..ea67aa770 100755 --- a/processing/post/histogram.py +++ b/processing/post/histogram.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # -*- coding: UTF-8 no BOM -*- import os,sys diff --git a/processing/post/imageData.py b/processing/post/imageData.py index e2c6658dd..b1afcb3de 100755 --- a/processing/post/imageData.py +++ b/processing/post/imageData.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # -*- coding: UTF-8 no BOM -*- import os,sys diff --git a/processing/post/imageDataDeformed.py b/processing/post/imageDataDeformed.py index 71086cf72..a15839b22 100755 --- a/processing/post/imageDataDeformed.py +++ b/processing/post/imageDataDeformed.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # -*- coding: UTF-8 no BOM -*- import os,sys diff --git a/processing/post/imageDataRGB.py b/processing/post/imageDataRGB.py index f706cb100..4d4aa1f8d 100755 --- a/processing/post/imageDataRGB.py +++ b/processing/post/imageDataRGB.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # -*- coding: UTF-8 no BOM -*- import os,sys diff --git a/processing/post/mentat_colorMap.py b/processing/post/mentat_colorMap.py index c2ce63238..79ea35a39 100755 --- a/processing/post/mentat_colorMap.py +++ b/processing/post/mentat_colorMap.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # -*- coding: UTF-8 no BOM -*- import os,sys @@ -68,26 +68,29 @@ Interpolates colors between "lower_hsl" and "upper_hsl". """, version = scriptID) parser.add_option("-i","--inverse", action = "store_true", - dest = "inverse", \ - help = "invert legend [%default]") + dest = "inverse", + help = "invert legend") parser.add_option( "--palette", action = "store_true", - dest = "palette", \ - help = "output plain rgb palette integer values (0-255) [%default]") + dest = "palette", + help = "output plain rgb palette integer values (0-255)") parser.add_option( "--palettef", action = "store_true", - dest = "palettef", \ - help = "output plain rgb palette float values (0.0-1.0) [%default]") -parser.add_option("-p", "--port", type = "int",\ - dest = "port",\ + dest = "palettef", + help = "output plain rgb palette float values (0.0-1.0)") +parser.add_option("-p", "--port", type = "int", + dest = "port", + metavar ='int', help = "Mentat connection port [%default]") -parser.add_option("-b", "--baseindex", type = "int",\ - dest = "baseIdx",\ +parser.add_option("-b", "--baseindex", type = "int", + metavar ='int', + dest = "baseIdx", help = "base index of colormap [%default]") -parser.add_option("-n", "--colorcount", type = "int",\ - dest = "colorcount",\ +parser.add_option("-n", "--colorcount", type = "int", + metavar ='int', + dest = "colorcount", help = "number of colors [%default]") -parser.add_option("-v", "--verbose", action="store_true",\ - dest = "verbose",\ - help = "write Mentat command stream also to STDOUT [%default]") +parser.add_option("-v", "--verbose", action="store_true", + dest = "verbose", + help = "write Mentat command stream also to STDOUT") parser.set_defaults(port = 40007) parser.set_defaults(baseIdx = 32) diff --git a/processing/post/perceptualUniformColorMap.py b/processing/post/perceptualUniformColorMap.py index bef6a2187..0bf655f2a 100755 --- a/processing/post/perceptualUniformColorMap.py +++ b/processing/post/perceptualUniformColorMap.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # -*- coding: UTF-8 no BOM -*- import sys,os diff --git a/processing/post/permuteData.py b/processing/post/permuteData.py index 9669f1b20..54a18576f 100755 --- a/processing/post/permuteData.py +++ b/processing/post/permuteData.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # -*- coding: UTF-8 no BOM -*- import os,sys diff --git a/processing/post/postResults.py b/processing/post/postResults.py index 072146165..28a2b40ac 100755 --- a/processing/post/postResults.py +++ b/processing/post/postResults.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # -*- coding: UTF-8 no BOM -*- import os,sys,math,re,time,struct,string @@ -643,63 +643,69 @@ of already processed data points for evaluation. """, version = scriptID) -parser.add_option('-i','--info', action='store_true', dest='info', \ - help='list contents of resultfile [%default]') -parser.add_option('-l','--legacy', action='store_true', dest='legacy', \ +parser.add_option('-i','--info', action='store_true', dest='info', + help='list contents of resultfile') +parser.add_option('-l','--legacy', action='store_true', dest='legacy', help='data format of spectral solver is in legacy format (no MPI out)') -parser.add_option('-n','--nodal', action='store_true', dest='nodal', \ - help='data is extrapolated to nodal value [%default]') -parser.add_option( '--prefix', dest='prefix', \ - help='prefix to result file name [%default]') -parser.add_option( '--suffix', dest='suffix', \ - help='suffix to result file name [%default]') -parser.add_option('-d','--dir', dest='dir', \ +parser.add_option('-n','--nodal', action='store_true', dest='nodal', + help='data is extrapolated to nodal value') +parser.add_option( '--prefix', dest='prefix', + metavar='string', + help='prefix to result file name') +parser.add_option( '--suffix', dest='suffix', + metavar='string', + help='suffix to result file name') +parser.add_option('-d','--dir', dest='dir', + metavar='string', help='name of subdirectory to hold output [%default]') -parser.add_option('-s','--split', action='store_true', dest='separateFiles', \ - help='split output per increment [%default]') -parser.add_option('-r','--range', dest='range', type='int', nargs=3, \ +parser.add_option('-s','--split', action='store_true', dest='separateFiles', + help='split output per increment') +parser.add_option('-r','--range', dest='range', type='int', nargs=3, + metavar='int int int', help='range of positions (or increments) to output (start, end, step) [all]') -parser.add_option('--increments', action='store_true', dest='getIncrements', \ - help='switch to increment range [%default]') -parser.add_option('-m','--map', dest='func', \ +parser.add_option('--increments', action='store_true', dest='getIncrements', + help='switch to increment range') +parser.add_option('-m','--map', dest='func', + metavar='string', help='data reduction mapping [%default] out of min, max, avg, avgabs, sum, sumabs or user-lambda') -parser.add_option('-p','--type', dest='filetype', \ +parser.add_option('-p','--type', dest='filetype', + metavar = 'string', help = 'type of result file [auto]') group_material = OptionGroup(parser,'Material identifier') -group_material.add_option('--homogenization', dest='homog', \ - help='homogenization identifier (as string or integer [%default])', metavar='') -group_material.add_option('--crystallite', dest='cryst', \ - help='crystallite identifier (as string or integer [%default])', metavar='') -group_material.add_option('--phase', dest='phase', \ - help='phase identifier (as string or integer [%default])', metavar='') +group_material.add_option('--homogenization', dest='homog', + help='homogenization identifier (as string or integer [%default])', metavar='string') +group_material.add_option('--crystallite', dest='cryst', + help='crystallite identifier (as string or integer [%default])', metavar='string') +group_material.add_option('--phase', dest='phase', + help='phase identifier (as string or integer [%default])', metavar='string') group_special = OptionGroup(parser,'Special outputs') -group_special.add_option('-t','--time', action='store_true', dest='time', \ +group_special.add_option('-t','--time', action='store_true', dest='time', help='output time of increment [%default]') -group_special.add_option('-f','--filter', dest='filter', \ - help='condition(s) to filter results [%default]', metavar='') -group_special.add_option('--separation', action='extend', dest='sep', \ - help='properties to separate results [%default]', metavar='') -group_special.add_option('--sort', action='extend', dest='sort', \ - help='properties to sort results [%default]', metavar='') +group_special.add_option('-f','--filter', dest='filter', + help='condition(s) to filter results [%default]', metavar='string') +group_special.add_option('--separation', action='extend', dest='sep', + help='properties to separate results [%default]', metavar='') +group_special.add_option('--sort', action='extend', dest='sort', + help='properties to sort results [%default]', metavar='') group_general = OptionGroup(parser,'General outputs') -group_general.add_option('--ns', action='extend', dest='nodalScalar', \ - help='nodal scalars to extract', metavar='') -group_general.add_option('--es', action='extend', dest='elemScalar', \ - help='elemental scalars to extract', metavar='') -group_general.add_option('--et', action='extend', dest='elemTensor', \ - help='elemental tensors to extract', metavar='') -group_general.add_option('--ho', action='extend', dest='homogenizationResult', \ - help='homogenization results to extract', metavar='') -group_general.add_option('--cr', action='extend', dest='crystalliteResult', \ - help='crystallite results to extract', metavar='') -group_general.add_option('--co', action='extend', dest='constitutiveResult', \ - help='constitutive results to extract', metavar='') +group_general.add_option('--ns', action='extend', dest='nodalScalar', + help='nodal scalars to extract', metavar='') +group_general.add_option('--es', action='extend', dest='elemScalar', + help='elemental scalars to extract', metavar='') +group_general.add_option('--et', action='extend', dest='elemTensor', + help='elemental tensors to extract', metavar='') +group_general.add_option('--ho', action='extend', dest='homogenizationResult', + help='homogenization results to extract', metavar='') +group_general.add_option('--cr', action='extend', dest='crystalliteResult', + help='crystallite results to extract', metavar='') +group_general.add_option('--co', action='extend', dest='constitutiveResult', + help='constitutive results to extract', metavar='') parser.add_option_group(group_material) parser.add_option_group(group_general) diff --git a/processing/post/reLabel.py b/processing/post/reLabel.py index e70a1166e..b704a2ee5 100755 --- a/processing/post/reLabel.py +++ b/processing/post/reLabel.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # -*- coding: UTF-8 no BOM -*- import os,sys,re @@ -64,11 +64,11 @@ for name in filenames: indices = table.label_index (options.label) dimensions = table.label_dimension(options.label) for i,index in enumerate(indices): - if index == -1: remarks.append('label {} not present...'.format(options.label[i])) + if index == -1: remarks.append('label "{}" not present...'.format(options.label[i])) else: - m = pattern[dimensions[i]>1].match(table.labels[index]) # isolate label name + m = pattern[dimensions[i]>1].match(table.tags[index]) # isolate label name for j in xrange(dimensions[i]): - table.labels[index+j] = table.labels[index+j].replace(m.group(2),options.substitute[i]) # replace name with substitute + table.tags[index+j] = table.tags[index+j].replace(m.group(2),options.substitute[i]) # replace name with substitute if remarks != []: damask.util.croak(remarks) if errors != []: diff --git a/processing/post/rotateData.py b/processing/post/rotateData.py index 36bda7761..32eaaad13 100755 --- a/processing/post/rotateData.py +++ b/processing/post/rotateData.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # -*- coding: UTF-8 no BOM -*- import os,sys,math diff --git a/processing/post/scaleData.py b/processing/post/scaleData.py index 0b1a48553..18883eb0b 100755 --- a/processing/post/scaleData.py +++ b/processing/post/scaleData.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # -*- coding: UTF-8 no BOM -*- import os,sys diff --git a/processing/post/shiftData.py b/processing/post/shiftData.py index 22b76f7d1..4052d83d9 100755 --- a/processing/post/shiftData.py +++ b/processing/post/shiftData.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # -*- coding: UTF-8 no BOM -*- import os,sys diff --git a/processing/post/showTable.py b/processing/post/showTable.py index 02946437b..c65b4519f 100755 --- a/processing/post/showTable.py +++ b/processing/post/showTable.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # -*- coding: UTF-8 no BOM -*- import os diff --git a/processing/post/sortTable.py b/processing/post/sortTable.py index e4f3c8dd0..f1298af86 100755 --- a/processing/post/sortTable.py +++ b/processing/post/sortTable.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # -*- coding: UTF-8 no BOM -*- import os,sys @@ -56,7 +56,7 @@ for name in filenames: table.data_readArray() - keys = table.labels[::-1] if options.keys is None else options.keys[::-1] # numpy sorts with most significant column as last + keys = table.labels(raw = True)[::-1] if options.keys is None else options.keys[::-1] # numpy sorts with most significant column as last cols = [] remarks = [] diff --git a/processing/post/stddevDown.py b/processing/post/stddevDown.py deleted file mode 100755 index f4fdf5a90..000000000 --- a/processing/post/stddevDown.py +++ /dev/null @@ -1,163 +0,0 @@ -#!/usr/bin/env python -# -*- coding: UTF-8 no BOM -*- - -import os,sys,string -import numpy as np -import damask -from optparse import OptionParser - -scriptName = os.path.splitext(os.path.basename(__file__))[0] -scriptID = ' '.join([scriptName,damask.version]) - -# -------------------------------------------------------------------- -# MAIN -# -------------------------------------------------------------------- - -parser = OptionParser(option_class=damask.extendableOption, usage='%prog [options] datafile[s]', description = """ -Calculates the standard deviation of data in blocks of size 'packing' thus reducing the former resolution -to resolution/packing. - -""", version = scriptID) - -parser.add_option('-c','--coordinates', dest='pos', type='string',\ - help='column heading for coordinates [%default]') -parser.add_option('-p','--packing', dest='packing', type='int', nargs=3, \ - help='dimension of packed group %default') -parser.add_option('-s','--shift', dest='shift', type='int', nargs=3, \ - help='shift vector of packing stencil %default') -parser.add_option('-r','--resolution', dest='resolution', type='int', nargs=3, \ - help='resolution in x,y,z [autodetect]') -parser.add_option('-d','--dimension', dest='dimension', type='float', nargs=3, \ - help='dimension in x,y,z [autodetect]') -parser.set_defaults(coords = 'pos') -parser.set_defaults(packing = [2,2,2]) -parser.set_defaults(shift = [0,0,0]) -parser.set_defaults(resolution = [0,0,0]) -parser.set_defaults(dimension = [0.0,0.0,0.0]) - -(options,filenames) = parser.parse_args() - -if len(options.packing) < 3: - parser.error('packing needs three parameters...') -if len(options.shift) < 3: - parser.error('shift needs three parameters...') - -options.packing = np.array(options.packing) -options.shift = np.array(options.shift) - -prefix = 'stddevDown%ix%ix%i_'%(options.packing[0],options.packing[1],options.packing[2]) -if np.any(options.shift != 0): - prefix += 'shift%+i%+i%+i_'%(options.shift[0],options.shift[1],options.shift[2]) - -# ------------------------------------------ setup file handles --------------------------------------- - -files = [] -if filenames == []: - files.append({'name':'STDIN', 'input':sys.stdin, 'output':sys.stdout}) -else: - for name in filenames: - name = os.path.relpath(name) - if os.path.exists(name): - files.append({'name':name, 'input':open(name), - 'output':open(os.path.join(os.path.dirname(name),prefix+os.path.basename(name)),'w')}) - - -# ------------------------------------------ loop over input files --------------------------------------- - -for file in files: - if file['name'] != 'STDIN': print file['name'], - - table = damask.ASCIItable(file['input'],file['output'],False) # make unbuffered ASCII_table - table.head_read() # read ASCII header info - table.info_append(string.replace('$Id$','\n','\\n') + \ - '\t' + ' '.join(sys.argv[1:])) - - -# --------------- figure out size and grid --------------------------------------------------------- - try: - locationCol = table.labels.index('1_%s'%options.pos) # columns containing location data - except ValueError: - try: - locationCol = table.labels.index('%s.x'%options.pos) # columns containing location data (legacy naming scheme) - except ValueError: - file['croak'].write('no coordinate data (1_%s/%s.x) found...\n'%(options.pos,options.pos)) - continue - - if (any(options.resolution)==0 or any(options.dimension)==0.0): - grid = [{},{},{}] - while table.data_read(): # read next data line of ASCII table - for j in xrange(3): - grid[j][str(table.data[locationCol+j])] = True # remember coordinate along x,y,z - resolution = np.array([len(grid[0]),\ - len(grid[1]),\ - len(grid[2]),],'i') # resolution is number of distinct coordinates found - dimension = resolution/np.maximum(np.ones(3,'d'),resolution-1.0)* \ - np.array([max(map(float,grid[0].keys()))-min(map(float,grid[0].keys())),\ - max(map(float,grid[1].keys()))-min(map(float,grid[1].keys())),\ - max(map(float,grid[2].keys()))-min(map(float,grid[2].keys())),\ - ],'d') # dimension from bounding box, corrected for cell-centeredness - else: - resolution = np.array(options.resolution,'i') - dimension = np.array(options.dimension,'d') - - if resolution[2] == 1: - options.packing[2] = 1 - options.shift[2] = 0 - dimension[2] = min(dimension[:2]/resolution[:2]) # z spacing equal to smaller of x or y spacing - - packing = np.array(options.packing,'i') - shift = np.array(options.shift,'i') - downSized = np.maximum(np.ones(3,'i'),resolution//packing) - outSize = np.ceil(np.array(resolution,'d')/np.array(packing,'d')) - - print '\t%s @ %s --> %s'%(dimension,resolution,downSized) - -# ------------------------------------------ assemble header --------------------------------------- - - table.head_write() - -# ------------------------------------------ process data --------------------------------------- - - dataavg = np.zeros(outSize.tolist()+[len(table.labels)]) - datavar = np.zeros(outSize.tolist()+[len(table.labels)]) - p = np.zeros(3,'i') - - table.data_rewind() - for p[2] in xrange(resolution[2]): - for p[1] in xrange(resolution[1]): - for p[0] in xrange(resolution[0]): - d = ((p-shift)%resolution)//packing - table.data_read() - dataavg[d[0],d[1],d[2],:] += np.array(table.data_asFloat(),'d') # convert to np array - - dataavg /= packing.prod() - - table.data_rewind() - for p[2] in xrange(resolution[2]): - for p[1] in xrange(resolution[1]): - for p[0] in xrange(resolution[0]): - d = ((p-shift)%resolution)//packing - table.data_read() - datavar[d[0],d[1],d[2],:] += (np.array(table.data_asFloat(),'d') - dataavg[d[0],d[1],d[2],:])**2 - - datavar = np.sqrt(datavar/packing.prod()) - - posOffset = (shift+[0.5,0.5,0.5])*dimension/resolution - elementSize = dimension/resolution*packing - for c in xrange(downSized[2]): - for b in xrange(downSized[1]): - for a in xrange(downSized[0]): - datavar[a,b,c,locationCol:locationCol+3] = posOffset + [a,b,c]*elementSize - table.data = datavar[a,b,c,:].tolist() - table.data_write() # output processed line - -# ------------------------------------------ output result --------------------------------------- - - table.output_flush() # just in case of buffered ASCII table - -# ------------------------------------------ close file handles --------------------------------------- - -for file in files: - table.input_close() # close input ASCII table - if file['name'] != 'STDIN': - table.output_close() # close output ASCII table diff --git a/processing/post/vtk2ang.py b/processing/post/vtk2ang.py index 40b06e41d..bc8e23097 100755 --- a/processing/post/vtk2ang.py +++ b/processing/post/vtk2ang.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # -*- coding: UTF-8 no BOM -*- import os,string,math,sys @@ -81,30 +81,39 @@ Builds a ang files from a vtk file. """, version = scriptID) -parser.add_option('--disp','--displacement',dest='dispLabel', \ +parser.add_option('--disp','--displacement',dest='dispLabel', + metavar ='string', help='label of displacements [%default]') -parser.add_option('--euler', dest='eulerLabel', nargs=3, \ +parser.add_option('--euler', dest='eulerLabel', nargs=3, + metavar ='string string string', help='labels of euler angles [%default]') -parser.add_option('-n','--normal', dest='normal', type='float', nargs=3, \ +parser.add_option('-n','--normal', dest='normal', type='float', nargs=3, + metavar ='float float float', help='normal of slices in direction of increasing slice numbers [%default]') parser.add_option('-u','--up', dest='up', type='float', nargs=3, + metavar ='float float float', help='up direction of slices [%default]') -parser.add_option('-i','--slices', dest='Nslices', type='int', \ +parser.add_option('-i','--slices', dest='Nslices', type='int', + metavar ='int', help='number of slices [%default]') -parser.add_option('-d','--distance', dest='distance', type='float', \ +parser.add_option('-d','--distance', dest='distance', type='float', + metavar ='float', help='slice distance [%default]') -parser.add_option('-s','--scale', dest='scale', type='float', \ +parser.add_option('-s','--scale', dest='scale', type='float', + metavar ='float', help='scale length from vtk file [%default]') parser.add_option('-r','--resolution', dest='resolution', type='float', + metavar ='float', help='scaling factor for resolution [%default]') parser.add_option('--hex','--hexagonal', dest='hexagonal', action='store_true', - help='use in plane hexagonal grid [%default]') -parser.add_option('--interpolation', dest='interpolation', type='int', \ + help='use in plane hexagonal grid') +parser.add_option('--interpolation', dest='interpolation', type='int', + metavar='float', help='number of points for linear interpolation [%default]') parser.add_option('--verbose', dest='verbose', action='store_true', - help='verbose mode [%default]') + help='verbose mode') parser.add_option('--visualize', dest='visualize', action='store_true', - help='visualize geometry [%default]') + help='visualize geometry') parser.set_defaults(dispLabel = 'displacement') parser.set_defaults(eulerLabel = ['1_1_eulerangles','1_2_eulerangles','1_3_eulerangles']) diff --git a/processing/post/vtk_addPointcloudData.py b/processing/post/vtk_addPointcloudData.py index 419995949..3590a436e 100755 --- a/processing/post/vtk_addPointcloudData.py +++ b/processing/post/vtk_addPointcloudData.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # -*- coding: UTF-8 no BOM -*- import os,vtk @@ -30,13 +30,15 @@ parser.add_option('-r', '--render', dest = 'render', action = 'store_true', help = 'open output in VTK render window') -parser.add_option('-s', '--scalar', dest='scalar', action='extend', \ +parser.add_option('-s', '--scalar', dest='scalar', action='extend', + metavar ='', help = 'scalar values') parser.add_option('-v', '--vector', dest = 'vector', action = 'extend', metavar = '', help = 'vector value label(s)') -parser.add_option('-c', '--color', dest='color', action='extend', \ +parser.add_option('-c', '--color', dest='color', action='extend', + metavar ='', help = 'RGB color tuples') parser.set_defaults(scalar = [], diff --git a/processing/post/vtk_addRectilinearGridData.py b/processing/post/vtk_addRectilinearGridData.py index d54bb4cf4..76eed6aec 100755 --- a/processing/post/vtk_addRectilinearGridData.py +++ b/processing/post/vtk_addRectilinearGridData.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # -*- coding: UTF-8 no BOM -*- import os,vtk diff --git a/processing/post/vtk_pointcloud.py b/processing/post/vtk_pointcloud.py index 1c3694662..995f5a216 100755 --- a/processing/post/vtk_pointcloud.py +++ b/processing/post/vtk_pointcloud.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # -*- coding: UTF-8 no BOM -*- import os,sys,vtk diff --git a/processing/post/vtk_rectilinearGrid.py b/processing/post/vtk_rectilinearGrid.py index 42b3186a7..32ea2c11c 100755 --- a/processing/post/vtk_rectilinearGrid.py +++ b/processing/post/vtk_rectilinearGrid.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # -*- coding: UTF-8 no BOM -*- import os,sys,vtk @@ -21,6 +21,7 @@ Create regular voxel grid from points in an ASCIItable. parser.add_option('-m', '--mode', dest = 'mode', + metavar='string', type = 'choice', choices = ['cell','point'], help = 'cell-centered or point-centered coordinates') parser.add_option('-p', diff --git a/processing/pre/OIMlinear2linearODF.py b/processing/pre/OIMlinear2linearODF.py index 280457be4..cbcbcc7ec 100755 --- a/processing/pre/OIMlinear2linearODF.py +++ b/processing/pre/OIMlinear2linearODF.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python2 # -*- coding: UTF-8 no BOM -*- import os,sys @@ -23,7 +23,8 @@ Transform the binned texture data from "TSL OIM Analysis" into linear ODF data, """, version = scriptID) parser.add_option('-s', '--symmetry', dest='symmetry', choices=sampleSym.keys(), - help='Sample symmetry {%s} [Triclinic]'%(' '.join(sampleSym.keys()))) + metavar = 'string', + help='Sample symmetry {%s} [Triclinic]'%(' '.join(sampleSym.keys()))) parser.set_defaults(symmetry = 'Triclinic') diff --git a/processing/pre/abq_addUserOutput.py b/processing/pre/abq_addUserOutput.py index 1e0614c21..4528537d9 100755 --- a/processing/pre/abq_addUserOutput.py +++ b/processing/pre/abq_addUserOutput.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # -*- coding: UTF-8 no BOM -*- import sys,os,re @@ -49,7 +49,7 @@ def ParseOutputFormat(filename,what,me): return format -parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [file[s]]', description = """ +parser = OptionParser(option_class=damask.extendableOption, usage='%prog [option(s)] Abaqus.Inputfile(s)', description = """ Transfer the output variables requested in the material.config to properly labelled user defined variables within the Abaqus input file (*.inp). diff --git a/processing/pre/geom_addPrimitive.py b/processing/pre/geom_addPrimitive.py index 3dd60bc24..8976a9e3d 100755 --- a/processing/pre/geom_addPrimitive.py +++ b/processing/pre/geom_addPrimitive.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # -*- coding: UTF-8 no BOM -*- import os,sys,math @@ -27,7 +27,7 @@ mappings = { 'microstructures': lambda x: int(x), } -parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [file[s]]', description = """ +parser = OptionParser(option_class=damask.extendableOption, usage='%prog option(s) [geomfile(s)]', description = """ Positions a geometric object within the (three-dimensional) canvas of a spectral geometry description. Depending on the sign of the dimension parameters, these objects can be boxes, cylinders, or ellipsoids. diff --git a/processing/pre/geom_canvas.py b/processing/pre/geom_canvas.py index 6ffae3cb9..4b482d641 100755 --- a/processing/pre/geom_canvas.py +++ b/processing/pre/geom_canvas.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # -*- coding: UTF-8 no BOM -*- import os,sys,math @@ -13,7 +13,7 @@ scriptID = ' '.join([scriptName,damask.version]) # MAIN # -------------------------------------------------------------------- -parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [file[s]]', description = """ +parser = OptionParser(option_class=damask.extendableOption, usage='%prog option(s) [geomfile(s)]', description = """ Changes the (three-dimensional) canvas of a spectral geometry description. Grid can be given as absolute or relative values, e.g. 16 16 16 or 2x 0.5x 32. diff --git a/processing/pre/geom_check.sh b/processing/pre/geom_check.sh index e640a8906..1eb85913c 100755 --- a/processing/pre/geom_check.sh +++ b/processing/pre/geom_check.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash for geom in "$@" do diff --git a/processing/pre/geom_clean.py b/processing/pre/geom_clean.py index 2bef9dc08..1409a1366 100755 --- a/processing/pre/geom_clean.py +++ b/processing/pre/geom_clean.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # -*- coding: UTF-8 no BOM -*- import os,sys,math @@ -18,7 +18,7 @@ def mostFrequent(arr): # MAIN #-------------------------------------------------------------------------------------------------- -parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [file[s]]', description = """ +parser = OptionParser(option_class=damask.extendableOption, usage='%prog option(s) [geomfile(s)]', description = """ Smooth geometry by selecting most frequent microstructure index within given stencil at each location. """, version=scriptID) diff --git a/processing/pre/geom_fromMinimalSurface.py b/processing/pre/geom_fromMinimalSurface.py index a3729dc30..1c4fc2eaa 100755 --- a/processing/pre/geom_fromMinimalSurface.py +++ b/processing/pre/geom_fromMinimalSurface.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # -*- coding: UTF-8 no BOM -*- import os,sys,math @@ -21,7 +21,7 @@ surface = { 'diamond': lambda x,y,z: math.cos(x-y)*math.cos(z)+math.sin(x+y)*math.sin(z), } -parser = OptionParser(option_class=damask.extendableOption, usage='%prog', description = """ +parser = OptionParser(option_class=damask.extendableOption, usage='%prog [option(s)] [geomfile]', description = """ Generate a geometry file of a bicontinuous structure of given type. """, version = scriptID) diff --git a/processing/pre/geom_fromOsteonGeometry.py b/processing/pre/geom_fromOsteonGeometry.py index bc49b9dca..9a24b3e2d 100755 --- a/processing/pre/geom_fromOsteonGeometry.py +++ b/processing/pre/geom_fromOsteonGeometry.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # -*- coding: UTF-8 no BOM -*- import os,sys,math @@ -13,7 +13,7 @@ scriptID = ' '.join([scriptName,damask.version]) # MAIN # -------------------------------------------------------------------- -parser = OptionParser(option_class=damask.extendableOption, usage='%prog [options]', description = """ +parser = OptionParser(option_class=damask.extendableOption, usage='%prog [option(s)] [geomfile]', description = """ Generate a geometry file of an osteon enclosing the Harvesian canal and separated by interstitial tissue. The osteon phase is lamellar with a twisted plywood structure. Its fiber orientation is oscillating by +/- amplitude within one period. diff --git a/processing/pre/geom_fromTable.py b/processing/pre/geom_fromTable.py index 5466236e8..91b4c2670 100755 --- a/processing/pre/geom_fromTable.py +++ b/processing/pre/geom_fromTable.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # -*- coding: UTF-8 no BOM -*- import os,sys,math,types,time @@ -15,7 +15,7 @@ scriptID = ' '.join([scriptName,damask.version]) # MAIN # -------------------------------------------------------------------- -parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [file[s]]', description = """ +parser = OptionParser(option_class=damask.extendableOption, usage='%prog option(s) [ASCIItable(s)]', description = """ Generate geometry description and material configuration from position, phase, and orientation (or microstructure) data. """, version = scriptID) diff --git a/processing/pre/geom_fromVPSC.py b/processing/pre/geom_fromVPSC.py index a555f6d07..3f76ffe2e 100755 --- a/processing/pre/geom_fromVPSC.py +++ b/processing/pre/geom_fromVPSC.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # -*- coding: UTF-8 no BOM -*- import os,sys,math diff --git a/processing/pre/geom_fromVoronoiTessellation.py b/processing/pre/geom_fromVoronoiTessellation.py index f6bdb8a57..903124385 100755 --- a/processing/pre/geom_fromVoronoiTessellation.py +++ b/processing/pre/geom_fromVoronoiTessellation.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # -*- coding: UTF-8 no BOM -*- import os,sys,math @@ -104,8 +104,8 @@ def laguerreTessellation(undeformed, coords, weights, grains, nonperiodic = Fals # MAIN # -------------------------------------------------------------------- -parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [file[s]]', description = """ -Generate geometry description and material configuration by standard Voronoi tessellation of given seeds file. +parser = OptionParser(option_class=damask.extendableOption, usage='%prog option(s) [seedfile(s)]', description = """ +Generate geometry description and material configuration by tessellation of given seeds file. """, version = scriptID) diff --git a/processing/pre/geom_grainGrowth.py b/processing/pre/geom_grainGrowth.py index 0f72a3589..9184bd226 100755 --- a/processing/pre/geom_grainGrowth.py +++ b/processing/pre/geom_grainGrowth.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # -*- coding: UTF-8 no BOM -*- import os,sys,math @@ -14,7 +14,7 @@ scriptID = ' '.join([scriptName,damask.version]) # MAIN #-------------------------------------------------------------------------------------------------- -parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [file[s]]', description = """ +parser = OptionParser(option_class=damask.extendableOption, usage='%prog [option(s)] [geomfile(s)]', description = """ Smoothens out interface roughness by simulated curvature flow. This is achieved by the diffusion of each initially sharply bounded grain volume within the periodic domain up to a given distance 'd' voxels. @@ -28,7 +28,7 @@ parser.add_option('-N', '--smooth', dest='N', type='int', metavar='int', help='N for curvature flow [%default]') parser.add_option('-r', '--renumber', dest='renumber', action='store_true', help='renumber microstructure indices from 1...N [%default]') -parser.add_option('-i', '--immutable', action='extend', dest='immutable', metavar = '', +parser.add_option('-i', '--immutable', action='extend', dest='immutable', metavar = '', help='list of immutable microstructures') parser.set_defaults(d = 1) diff --git a/processing/pre/geom_pack.py b/processing/pre/geom_pack.py index 17d1cb63c..324141aaa 100755 --- a/processing/pre/geom_pack.py +++ b/processing/pre/geom_pack.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # -*- coding: UTF-8 no BOM -*- import os,sys @@ -13,7 +13,7 @@ scriptID = ' '.join([scriptName,damask.version]) # MAIN #-------------------------------------------------------------------------------------------------- -parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [file[s]]', description = """ +parser = OptionParser(option_class=damask.extendableOption, usage='%prog [geomfile(s)]', description = """ compress geometry files with ranges "a to b" and/or multiples "n of x". """, version = scriptID) diff --git a/processing/pre/geom_rescale.py b/processing/pre/geom_rescale.py index e005e41a9..2c779f3d3 100755 --- a/processing/pre/geom_rescale.py +++ b/processing/pre/geom_rescale.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # -*- coding: UTF-8 no BOM -*- import os,sys,math @@ -13,7 +13,7 @@ scriptID = ' '.join([scriptName,damask.version]) # MAIN #-------------------------------------------------------------------------------------------------- -parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [file[s]]', description = """ +parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [geomfile(s)]', description = """ Scales a geometry description independently in x, y, and z direction in terms of grid and/or size. Either absolute values or relative factors (like "0.25x") can be used. diff --git a/processing/pre/geom_rotate.py b/processing/pre/geom_rotate.py index 7ae47f894..bb6acd35c 100755 --- a/processing/pre/geom_rotate.py +++ b/processing/pre/geom_rotate.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # -*- coding: UTF-8 no BOM -*- import os,sys,math @@ -14,7 +14,7 @@ scriptID = ' '.join([scriptName,damask.version]) # MAIN #-------------------------------------------------------------------------------------------------- -parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [file[s]]', description = """ +parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [geomfile(s)]', description = """ Rotates spectral geometry description. """, version=scriptID) diff --git a/processing/pre/geom_toTable.py b/processing/pre/geom_toTable.py index 2a0498a6e..e858049d1 100755 --- a/processing/pre/geom_toTable.py +++ b/processing/pre/geom_toTable.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # -*- coding: UTF-8 no BOM -*- import os,sys @@ -14,7 +14,7 @@ scriptID = ' '.join([scriptName,damask.version]) # MAIN #-------------------------------------------------------------------------------------------------- -parser = OptionParser(option_class=damask.extendableOption, usage='%prog [geomfile[s]]', description = """ +parser = OptionParser(option_class=damask.extendableOption, usage='%prog [geomfile(s)]', description = """ Translate geom description into ASCIItable containing 1/2/3_pos and microstructure. """, version = scriptID) diff --git a/processing/pre/geom_translate.py b/processing/pre/geom_translate.py index 13f4ef592..6c5eb5391 100755 --- a/processing/pre/geom_translate.py +++ b/processing/pre/geom_translate.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # -*- coding: UTF-8 no BOM -*- import os,sys,math diff --git a/processing/pre/geom_unpack.py b/processing/pre/geom_unpack.py index 85c60d6e5..508946d4e 100755 --- a/processing/pre/geom_unpack.py +++ b/processing/pre/geom_unpack.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # -*- coding: UTF-8 no BOM -*- import os,sys,math diff --git a/processing/pre/geom_vicinityOffset.py b/processing/pre/geom_vicinityOffset.py index 8a2a0c912..8ef96608e 100755 --- a/processing/pre/geom_vicinityOffset.py +++ b/processing/pre/geom_vicinityOffset.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # -*- coding: UTF-8 no BOM -*- import os,sys,math diff --git a/processing/pre/gmsh_identifySurfaces.py b/processing/pre/gmsh_identifySurfaces.py index 71c80a1dc..e42e352c8 100755 --- a/processing/pre/gmsh_identifySurfaces.py +++ b/processing/pre/gmsh_identifySurfaces.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # -*- coding: UTF-8 no BOM -*- import os,re diff --git a/processing/pre/hybridIA_linODFsampling.py b/processing/pre/hybridIA_linODFsampling.py index a16c0db09..9ee4470b9 100755 --- a/processing/pre/hybridIA_linODFsampling.py +++ b/processing/pre/hybridIA_linODFsampling.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python2 # -*- coding: UTF-8 no BOM -*- from optparse import OptionParser diff --git a/processing/pre/marc_addUserOutput.py b/processing/pre/marc_addUserOutput.py index c453be63f..6f61b2d26 100755 --- a/processing/pre/marc_addUserOutput.py +++ b/processing/pre/marc_addUserOutput.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # -*- coding: UTF-8 no BOM -*- """ @@ -55,7 +55,7 @@ def ParseOutputFormat(filename,what,me): format['outputs'].append([output,length]) return format -parser = OptionParser(option_class=damask.extendableOption, usage='%prog [options] Marc.inputfile(s)', description=""" +parser = OptionParser(option_class=damask.extendableOption, usage='%prog [option(s)] Marc.Inputfile(s)', description=""" Transfer the output variables requested in the material.config to properly labelled user defined variables within the Marc input file (*.dat). @@ -70,20 +70,26 @@ Or have an existing set of user variables copied over from another *.dat file. parser.add_option('-n','--number', dest='number', type='int', \ + metavar='int', help='maximum requested User Defined Variable [%default]') parser.add_option('--homogenization', dest='homog', \ + metavar='string', help='homogenization identifier (as string or integer [%default])') parser.add_option('--crystallite', dest='cryst', \ + metavar='string', help='crystallite identifier (as string or integer [%default])') parser.add_option('--phase', dest='phase', \ + metavar='string', help='phase identifier (as string or integer [%default])') parser.add_option('--use', dest='useFile', \ + metavar='string', help='Optionally parse output descriptors from '+ 'different .outputZZZ file. Saves the effort '+ - 'to start a calculation for each job [%default])') + 'to start a calculation for each job)') parser.add_option('--option', dest='damaskOption', \ + metavar='string', help='Add damask option to input file '+ - 'for example: "periodic x z" [%default]') + 'for example: "periodic x z"') parser.set_defaults(number = 0) parser.set_defaults(homog = '1') parser.set_defaults(cryst = '1') diff --git a/processing/pre/mentat_pbcOnBoxMesh.py b/processing/pre/mentat_pbcOnBoxMesh.py index 7213bbd42..d355639e2 100755 --- a/processing/pre/mentat_pbcOnBoxMesh.py +++ b/processing/pre/mentat_pbcOnBoxMesh.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # -*- coding: UTF-8 no BOM -*- import sys,os @@ -74,7 +74,7 @@ def servoLink(): baseNode = {} linkNodes = [] -#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +#------------------------------------------------------------------------------------------------- # loop over all nodes for node in xrange(Nnodes): key = {} diff --git a/processing/pre/mentat_spectralBox.py b/processing/pre/mentat_spectralBox.py index 07154ea42..770db1279 100755 --- a/processing/pre/mentat_spectralBox.py +++ b/processing/pre/mentat_spectralBox.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # -*- coding: UTF-8 no BOM -*- import os,sys diff --git a/processing/pre/patchFromReconstructedBoundaries.py b/processing/pre/patchFromReconstructedBoundaries.py index 31d8a7461..f0c68b5f7 100755 --- a/processing/pre/patchFromReconstructedBoundaries.py +++ b/processing/pre/patchFromReconstructedBoundaries.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # -*- coding: UTF-8 no BOM -*- import sys,os,math,re diff --git a/processing/pre/seeds_check.sh b/processing/pre/seeds_check.sh index 9a783e95d..a7d7f76ce 100755 --- a/processing/pre/seeds_check.sh +++ b/processing/pre/seeds_check.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash for seeds in "$@" do diff --git a/processing/pre/seeds_fromDistribution.py b/processing/pre/seeds_fromDistribution.py index d2b51519d..096fbdfd8 100755 --- a/processing/pre/seeds_fromDistribution.py +++ b/processing/pre/seeds_fromDistribution.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python2 # -*- coding: UTF-8 no BOM -*- import threading,time,os,sys,random diff --git a/processing/pre/seeds_fromGeom.py b/processing/pre/seeds_fromGeom.py index 41c357323..1f1c2aeed 100755 --- a/processing/pre/seeds_fromGeom.py +++ b/processing/pre/seeds_fromGeom.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # -*- coding: UTF-8 no BOM -*- import os,sys diff --git a/processing/pre/seeds_fromPokes.py b/processing/pre/seeds_fromPokes.py index 7915e8951..bf26591c1 100755 --- a/processing/pre/seeds_fromPokes.py +++ b/processing/pre/seeds_fromPokes.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # -*- coding: UTF-8 no BOM -*- import os,math,sys diff --git a/processing/pre/seeds_fromRandom.py b/processing/pre/seeds_fromRandom.py index 10d9988c6..cf3db1b36 100755 --- a/processing/pre/seeds_fromRandom.py +++ b/processing/pre/seeds_fromRandom.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # -*- coding: UTF-8 no BOM -*- import os,sys,math,random diff --git a/processing/pre/table_fromOIMgrainFile.py b/processing/pre/table_fromOIMgrainFile.py index d448ba896..30cfee2f4 100755 --- a/processing/pre/table_fromOIMgrainFile.py +++ b/processing/pre/table_fromOIMgrainFile.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # -*- coding: UTF-8 no BOM -*- import os,sys @@ -19,6 +19,7 @@ Adds header to OIM grain file to make it accesible as ASCII table parser.add_option('-l', '--labels', dest = 'labels', + action = 'extend', metavar = '', help = 'lables of requested columns') parser.set_defaults(labels = ['1_euler','2_euler','3_euler',