From: Pascale Noyret Date: Fri, 16 Jan 2009 10:26:34 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: V0_a1_SEPQT4~35 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=4b994e3a2d97191b4e5955a4ba145e1ebd7e7da5;p=modules%2Feficas.git *** empty log message *** --- diff --git a/Cuve2dg/Cuve2dg_Cata_V1.py b/Cuve2dg/Cuve2dg_Cata_V1.py new file mode 100644 index 00000000..61d9b721 --- /dev/null +++ b/Cuve2dg/Cuve2dg_Cata_V1.py @@ -0,0 +1,1428 @@ +# -*- coding: utf-8 -*- + +# -------------------------------------------------- +# debut entete +# -------------------------------------------------- + +import Accas +from Accas import * + +class loi ( ASSD ) : pass +class variable ( ASSD ) : pass + + +#CONTEXT.debug = 1 +JdC = JDC_CATA ( code = 'OPENTURNS_STUDY', + execmodul = None, + regles = ( AU_MOINS_UN ( 'CRITERIA' ), ), + ) # Fin JDC_CATA + +# -------------------------------------------------- +# fin entete +# -------------------------------------------------- + + + + + + +#================================ +# 1. Definition des LOIS +#================================ + +# Nota : les variables de type OPER doivent etre en majuscules ! +# Nota : les variables de type OPER doivent etre de premier niveau (pas imbriquees dans un autre type) +DISTRIBUTION = OPER ( nom = "DISTRIBUTION", + sd_prod = loi, + op = 68, + fr = "Definitions des lois marginales utilisees par les variables d'entree", + + +#==== +# Type de distribution +#==== + + Kind = SIMP ( statut = "o", typ = "TXM", + into = ( "Beta", + "Exponential", + "Gamma", + "Geometric", + "Gumbel", + "Histogram", + "Logistic", + "LogNormal", + "MultiNomial", + "Normal", + "TruncatedNormal", + "Poisson", + "Student", + "Triangular", + "Uniform", + "UserDefined", + "Weibull", + ), + fr = "Choix du type de la loi marginale", + ang = "1D marginal distribution", + ), + +#==== +# Definition des parametres selon le type de la loi +#==== + + BETA = BLOC ( condition = " Kind in ( 'Beta', ) ", + + Settings = SIMP ( statut = "o", + typ = "TXM", + max = 1, + into = ( "RT", "MuSigma" ), + defaut = "RT", + fr = "Parametrage de la loi beta", + ang = "Beta distribution parameter set", + ), + + RT_Parameters = BLOC ( condition = " Settings in ( 'RT', ) ", + + R = SIMP ( statut = "o", + typ = "R", + max = 1, + val_min = 0., + fr = "Parametre R de la loi", + ang = "R parameter", + ), + + # T > R + T = SIMP ( statut = "o", + typ = "R", + max = 1, + val_min = 0., + fr = "Parametre T de la loi | T > R", + ang = "T parameter | T > R", + ), + + ), # Fin BLOC RT_Parameters + + + MuSigma_Parameters = BLOC ( condition = " Settings in ( 'MuSigma', ) ", + + Mu = SIMP ( statut = "o", + typ = "R", + max = 1, + fr = "Parametre Mu de la loi", + ang = "Mu parameter", + ), + + Sigma = SIMP ( statut = "o", + typ = "R", + max = 1, + val_min = 0., + fr = "Parametre Sigma de la loi | Sigma > 0", + ang = "Sigma parameter | Sigma > 0", + ), + + ), # Fin BLOC MuSigma_Parameters + + + A = SIMP ( statut = "o", + typ = "R", + max = 1, + fr = "Parametre A de la loi", + ang = "A parameter", + ), + + # B > A + B = SIMP ( statut = "o", + typ = "R", + max = 1, + fr = "Parametre B de la loi | B > A", + ang = "B parameter | B > A", + ), + + ), # Fin BLOC BETA + + + + EXPONENTIAL = BLOC ( condition = " Kind in ( 'Exponential', ) ", + + Lambda = SIMP ( statut = "o", + typ = "R", + max = 1, + val_min = 0., + fr = "Parametre Lambda | Lambda > 0", + ang = "Lambda parameter | Lambda > 0", + ), + + Gamma = SIMP ( statut = "o", + typ = "R", + max = 1, + fr = "Parametre Gamma", + ang = "Gamma parameter", + ), + + ), # Fin BLOC EXPONENTIAL + + + + GAMMA = BLOC ( condition = " Kind in ( 'Gamma', ) ", + + Settings = SIMP ( statut = "o", + typ = "TXM", + max = 1, + into = ( "KLambda", "MuSigma" ), + defaut = "KLambda", + fr = "Parametrage de la loi gamma", + ang = "Gamma distribution parameter set", + ), + + KLambda_Parameters = BLOC ( condition = " Settings in ( 'KLambda', ) ", + + K = SIMP ( statut = "o", + typ = "R", + max = 1, + val_min = 0., + fr = "Parametre K de la loi | K > 0", + ang = "K parameter | K > 0", + ), + + Lambda = SIMP ( statut = "o", + typ = "R", + max = 1, + val_min = 0., + fr = "Parametre Lambda de la loi | Lambda > 0", + ang = "Lambda parameter | Lambda > 0", + ), + + ), # Fin BLOC KLambda_Parameters + + + MuSigma_Parameters = BLOC ( condition = " Settings in ( 'MuSigma', ) ", + + Mu = SIMP ( statut = "o", + typ = "R", + max = 1, + defaut = 0.0, + fr = "Parametre Mu de la loi", + ang = "Mu parameter", + ), + + Sigma = SIMP ( statut = "o", + typ = "R", + max = 1, + defaut = 1.0, + val_min = 0., + fr = "Parametre Sigma de la loi | Sigma > 0", + ang = "Sigma parameter | Sigma > 0", + ), + + ), # Fin BLOC MuSigma_Parameters + + Gamma = SIMP ( statut = "o", + typ = "R", + max = 1, + fr = "Parametre Gamma", + ang = "Gamma parameter", + ), + + + ), # Fin BLOC GAMMA + + + + GEOMETRIC = BLOC ( condition = " Kind in ( 'Geometric', ) ", + + P = SIMP ( statut = "o", + typ = "R", + max = 1, + val_min = 0., + val_max = 1., + fr = "Parametre P | 0 < P < 1", + ang = "P parameter | 0 < P < 1", + ), + + ), # Fin BLOC GEOMETRIC + + + + GUMBEL = BLOC ( condition = " Kind in ( 'Gumbel', ) ", + + Settings = SIMP ( statut = "o", + typ = "TXM", + max = 1, + into = ( "AlphaBeta", "MuSigma" ), + defaut = "AlphaBeta", + fr = "Parametrage de la loi gumbel", + ang = "Gumbel distribution parameter set", + ), + + AlphaBeta_Parameters = BLOC ( condition = " Settings in ( 'AlphaBeta', ) ", + + Alpha = SIMP ( statut = "o", + typ = "R", + max = 1, + val_min = 0., + fr = "Parametre Alpha de la loi | Alpha > 0", + ang = "Alpha parameter | Alpha > 0", + ), + + Beta = SIMP ( statut = "o", + typ = "R", + max = 1, + fr = "Parametre Beta de la loi", + ang = "Beta parameter", + ), + + ), # Fin BLOC AlphaBeta_Parameters + + + MuSigma_Parameters = BLOC ( condition = " Settings in ( 'MuSigma', ) ", + + Mu = SIMP ( statut = "o", + typ = "R", + max = 1, + fr = "Parametre Mu de la loi", + ang = "Mu parameter", + ), + + Sigma = SIMP ( statut = "o", + typ = "R", + max = 1, + val_min = 0., + fr = "Parametre Sigma de la loi | Sigma > 0", + ang = "Sigma parameter | Sigma > 0", + ), + + ), # Fin BLOC MuSigma_Parameters + + ), # Fin BLOC GUMBEL + + + + HISTOGRAM = BLOC ( condition = " Kind in ( 'Histogram', ) ", + + Sup = SIMP ( statut = "o", + typ = "R", + max = 1, + fr = "Borne superieure de la distribution", + ang = "Upper bound", + ), + + # Il faut definir une collection de couples ( x,p ) + Values = SIMP ( statut = 'o', + typ = 'R', + max = '**', + ), + + ), # Fin BLOC HISTOGRAM + + + + LOGNORMAL = BLOC ( condition = " Kind in ( 'LogNormal', ) ", + + Settings = SIMP ( statut = "o", + typ = "TXM", + max = 1, + into = ( "MuSigmaLog", "MuSigma", "MuSigmaOverMu" ), + defaut = "MuSigmaLog", + fr = "Parametrage de la loi lognormale", + ang = "Lognormal distribution parameter set", + ), + + MuSigma_Parameters = BLOC ( condition = " Settings in ( 'MuSigma', ) ", + + Mu = SIMP ( statut = "o", + typ = "R", + max = 1, + fr = "Parametre Mu de la loi | Mu > Gamma", + ang = "Mu parameter | Mu > Gamma", + ), + + Sigma = SIMP ( statut = "o", + typ = "R", + max = 1, + val_min = 0., + fr = "Parametre Sigma de la loi | Sigma > 0", + ang = "Sigma parameter | Sigma > 0", + ), + + ), # Fin BLOC MuSigma_Parameters + + MuSigmaOverMu_Parameters = BLOC ( condition = " Settings in ( 'MuSigmaOverMu', ) ", + + Mu = SIMP ( statut = "o", + typ = "R", + max = 1, + fr = "Parametre Mu de la loi | Mu > Gamma", + ang = "Mu parameter | Mu > Gamma", + ), + + SigmaOverMu = SIMP ( statut = "o", + typ = "R", + max = 1, + val_min = 0., + fr = "Parametre SigmaOverMu de la loi | SigmaOverMu > 0", + ang = "SigmaOverMu parameter | SigmaOverMu > 0", + ), + + ), # Fin BLOC MuSigmaOverMu_Parameters + + MuSigmaLog_Parameters = BLOC ( condition = " Settings in ( 'MuSigmaLog', ) ", + + MuLog = SIMP ( statut = "o", + typ = "R", + max = 1, + fr = "Parametre Mu log de la loi", + ang = "Mu log parameter", + ), + + SigmaLog = SIMP ( statut = "o", + typ = "R", + max = 1, + val_min = 0., + fr = "Parametre Sigma log de la loi | SigmaLog > 0", + ang = "Sigma log parameter | SigmaLog > 0", + ), + + ), # Fin BLOC MuSigmaLog_Parameters + + Gamma = SIMP ( statut = "o", + typ = "R", + max = 1, + fr = "Parametre Gamma", + ang = "Gamma parameter", + ), + + ), # Fin BLOC LOGNORMAL + + + + LOGISTIC = BLOC ( condition = " Kind in ( 'Logistic', ) ", + + Alpha = SIMP ( statut = "o", + typ = "R", + max = 1, + fr = "Parametre Alpha de la loi", + ang = "Alpha parameter", + ), + + Beta = SIMP ( statut = "o", + typ = "R", + max = 1, + val_min = 0., + fr = "Parametre Beta de la loi | Beta > = 0", + ang = "Beta parameter | Beta > = 0", + ), + + ), # Fin BLOC LOGISTIC + + + + MULTINOMIAL = BLOC ( condition = " Kind in ( 'MultiNomial', ) ", + + N = SIMP ( statut = "o", + typ = "I", + max = 1, + fr = "Dimension de la loi", + ang = "Distribution dimension", + ), + + # Il faut un vecteur P de taille N + Values = SIMP ( statut = 'o', + typ = 'R', + max = '**', + ), + + ), # Fin BLOC MULTINOMIAL + + + + NORMAL = BLOC ( condition = " Kind in ( 'Normal', ) ", + + Mu = SIMP ( statut = "o", + typ = "R", + max = 1, + fr = "Parametre Mu de la loi", + ang = "Mu parameter", + ), + + Sigma = SIMP ( statut = "o", + typ = "R", + max = 1, + val_min = 0., + fr = "Parametre Sigma de la loi | Sigma > 0", + ang = "Sigma parameter | Sigma > 0", + ), + + ), # Fin BLOC NORMAL + + + + POISSON = BLOC ( condition = " Kind in ( 'Poisson', ) ", + + Lambda = SIMP ( statut = "o", + typ = "R", + max = 1, + val_min = 0., + fr = "Parametre Lambda de la loi | Lambda > 0", + ang = "Lambda parameter | Lambda > 0", + ), + + ), # Fin BLOC POISSON + + + + STUDENT = BLOC ( condition = " Kind in ( 'Student', ) ", + + Mu = SIMP ( statut = "o", + typ = "R", + max = 1, + fr = "Parametre Mu de la loi", + ang = "Mu parameter", + ), + + Nu = SIMP ( statut = "o", + typ = "R", + max = 1, + val_min = 2., + fr = "Parametre Nu de la loi | V > = 2", + ang = "Nu parameter | V > = 2", + ), + + ), # Fin BLOC STUDENT + + + + TRIANGULAR = BLOC ( condition = " Kind in ( 'Triangular', ) ", + + A = SIMP ( statut = "o", + typ = "R", + max = 1, + fr = "Borne inferieure de la loi | A < = M < = B", + ang = "Lower bound | A < = M < = B", + ), + + M = SIMP ( statut = "o", + typ = "R", + max = 1, + fr = "Mode de la loi | A < = M < = B", + ang = "Mode | A < = M < = B", + ), + + B = SIMP ( statut = "o", + typ = "R", + max = 1, + fr = "Borne superieure de la loi | A < = M < = B", + ang = "Upper bound | A < = M < = B", + ), + + ), # Fin BLOC TRIANGULAR + + + + TRUNCATEDNORMAL = BLOC ( condition = " Kind in ( 'TruncatedNormal', ) ", + + MuN = SIMP ( statut = "o", + typ = "R", + max = 1, + fr = "Parametre Mu de la loi", + ang = "Mu parameter", + ), + + SigmaN = SIMP ( statut = "o", + typ = "R", + max = 1, + val_min = 0., + fr = "Parametre SigmaN de la loi | SigmaN > 0", + ang = "SigmaN parameter | SigmaN> 0", + ), + + A = SIMP ( statut = "o", + typ = "R", + max = 1, + fr = "Borne inferieure de la loi | A < = B", + ang = "Lower bound | A < = B", + ), + + B = SIMP ( statut = "o", + typ = "R", + max = 1, + fr = "Borne superieure de la loi | A < = B", + ang = "Upper bound | A < = B", + ), + + ), # Fin BLOC TRUNCATEDNORMAL + + + + UNIFORM = BLOC ( condition = " Kind in ( 'Uniform', ) ", + + A = SIMP ( statut = "o", + typ = "R", + max = 1, + fr = "Borne inferieure de la loi | A < = B", + ang = "Lower bound | A < = B", + ), + + B = SIMP ( statut = "o", + typ = "R", + max = 1, + fr = "Borne superieure de la loi | A < = B", + ang = "Upper bound | A < = B", + ), + + ), # Fin BLOC UNIFORM + + + + USERDEFINED = BLOC ( condition = " Kind in ( 'UserDefined', ) ", + + # Il faut definir une collection de couples ( x,p ) + Values = SIMP ( statut = 'o', + typ = 'R', + max = '**', + ), + + ), # Fin BLOC USERDEFINED + + + + WEIBULL = BLOC ( condition = " Kind in ( 'Weibull', ) ", + + Settings = SIMP ( statut = "o", + typ = "TXM", + max = 1, + into = ( "AlphaBeta", "MuSigma" ), + defaut = "AlphaBeta", + fr = "Parametrage de la loi weibull", + ang = "Weibull distribution parameter set", + ), + + AlphaBeta_Parameters = BLOC ( condition = " Settings in ( 'AlphaBeta', ) ", + + Alpha = SIMP ( statut = "o", + typ = "R", + max = 1, + val_min = 0., + fr = "Parametre Alpha de la loi | Alpha > 0", + ang = "Alpha parameter | Alpha > 0", + ), + + Beta = SIMP ( statut = "o", + typ = "R", + max = 1, + val_min = 0., + fr = "Parametre Beta de la loi | Beta > 0", + ang = "Beta parameter | Beta > 0", + ), + + ), # Fin BLOC AlphaBeta_Parameters + + + MuSigma_Parameters = BLOC ( condition = " Settings in ( 'MuSigma', ) ", + + Mu = SIMP ( statut = "o", + typ = "R", + max = 1, + fr = "Parametre Mu de la loi", + ang = "Mu parameter", + ), + + Sigma = SIMP ( statut = "o", + typ = "R", + max = 1, + val_min = 0., + fr = "Parametre Sigma de la loi | Sigma > 0", + ang = "Sigma parameter | Sigma > 0", + ), + + ), # Fin BLOC MuSigma_Parameters + + Gamma = SIMP ( statut = "o", + typ = "R", + max = 1, + fr = "Parametre Gamma", + ang = "Gamma parameter", + ), + + ), # Fin BLOC WEIBULL + +) # Fin OPER DISTRIBUTION + + + + + + +#================================ +# 3. Definition de l'etude +#================================ + +# Nota : les variables de type PROC doivent etre en majuscules ! +CRITERIA = PROC ( nom = "CRITERIA", + op = None, + docu = "", + fr = "Mise en donnee pour le fichier de configuration de OPENTURNS.", + ang = "Writes the configuration file for OPENTURNS.", + + + + Type = SIMP ( statut = "o", + typ = "TXM", + into = ( "Min/Max", "Central Uncertainty", "Threshold Exceedence" ), + fr = "Type d'Analyse", + ang = "Analysis", + ), + + + + + MinMax = BLOC ( condition = " Type in ( 'Min/Max', ) ", + + Method = SIMP ( statut = "o", + typ = "TXM", + into = ( "Experiment Plane", "Random Sampling" ), + fr = "Methode", + ang = "Method", + ), + # UC 3.1.1 + ExperimentPlaneSettings = BLOC ( condition = " Method in ( 'Experiment Plane', ) ", + + ExperimentPlane = SIMP ( statut = "o", + typ = "TXM", + into = ( "Axial", "Factorial", "Composite", ), + fr = "Methode", + ang = "Method", + ), + + Levels = SIMP ( statut = "o", + typ = "R", + val_min = 0.0, + max = '**', + fr = "Nombre de niveaux dans chaque direction", + ang = "Levels in each direction", + ), + + # Scaled Vector + UnitsPerDimension = SIMP ( statut = "o", + typ = "R", + max = '**', + fr = "Unite par dimension (autant que de variables declarees)", + ang = "Units per dimension (as much as declared variables)", + ), + + # Translation Vector + Center = SIMP ( statut = "o", + typ = "R", + max = '**', + fr = "Unite par dimension", + ang = "Units per dimension", + ), + + ), # Fin BLOC ExperimentPlaneSettings + + + + RandomSamplingSettings = BLOC ( condition = " Method in ( 'Random Sampling', ) ", + + PointsNumber = SIMP ( statut = "o", + typ = "I", + val_min = 1, + fr = "Nombre de points", + ang = "Points number", + ), + + ), # Fin BLOC RandomSamplingSettings + + Result = SIMP ( statut = "o", + typ = "TXM", + into = ( "Min/Max", ), + defaut = "Min/Max", + fr = "Le minimum et le maximum", + ang = "The min and max values", + ), + + + ), # Fin BLOC MinMax + + + + + CentralUncertainty = BLOC ( condition = " Type in ( 'Central Uncertainty', ) ", + + Method = SIMP ( statut = "o", + typ = "TXM", + into = ( "Taylor Variance Decomposition", "Random Sampling" ), + fr = "Methode", + ang = "Method", + ), + + # UC 3.2. + TaylorVarianceDecompositionSettings = BLOC ( condition = " Method in ( 'Taylor Variance Decomposition', ) ", + + Result = FACT ( statut = "o", + min = 1, + max = "**", + + MeanFirstOrder = SIMP ( statut = "o", + typ = 'TXM', + into = ( 'yes', 'no' ), + defaut = 'yes', + max = 1, + fr = "Moyenne au premier ordre", + ang = "MeanFirstOrder", + ), + + StandardDeviationFirstOrder = SIMP ( statut = "o", + typ = 'TXM', + into = ( 'yes', 'no' ), + defaut = 'yes', + max = 1, + fr = "Ecart-type au premier ordre", + ang = "StandardDeviationFirstOrder", + ), + + MeanSecondOrder = SIMP ( statut = "o", + typ = 'TXM', + into = ( 'yes', 'no' ), + defaut = 'yes', + max = 1, + fr = "Moyenne au second ordre", + ang = "MeanSecondOrder", + ), + + ImportanceFactor = SIMP ( statut = "o", + typ = 'TXM', + into = ( 'yes', 'no' ), + defaut = 'no', + max = 1, + fr = "Facteur d'importance pour variable de sortie scalaire", + ang = "ImportanceFactor", + ), + + ImportanceFactorSettings = BLOC ( condition = " ImportanceFactor in ( 'yes', ) ", + + NumericalResults = SIMP ( statut = "o", + typ = 'TXM', + into = ( 'yes', 'no' ), + defaut = 'yes', + max = 1, + fr = "Resultats numeriques", + ang = "NumericalResults", + ), + + GraphicalResults = SIMP ( statut = "o", + typ = 'TXM', + into = ( 'yes', 'no' ), + defaut = 'no', + max = 1, + fr = "Resultats graphiques", + ang = "GraphicalResults", + ), + + ), # Fin BLOC ImportanceFactorSettings + + ), # Fin FACT Result + + ), # Fin BLOC TaylorVarianceDecompositionSettings + + + + RandomSamplingSettings = BLOC ( condition = " Method in ( 'Random Sampling', ) ", + + PointsNumber = SIMP ( statut = "o", + typ = "I", + val_min = 1, + fr = "Nombre de points", + ang = "Points number", + ), + + Result = FACT ( statut = "o", + min = 1, + max = "**", + + EmpiricalMean = SIMP ( statut = "o", + typ = 'TXM', + into = ( 'yes', 'no' ), + defaut = 'yes', + max = 1, + fr = "Moyenne empirique", + ang = "Empirical mean", + ), + + EmpiricalStandardDeviation = SIMP ( statut = "o", + typ = 'TXM', + into = ( 'yes', 'no' ), + defaut = 'yes', + max = 1, + fr = "Ecart-type empirique", + ang = "Empirical standard deviation", + ), + + EmpiricalQuantile = SIMP ( statut = "o", + typ = 'R', + defaut = 0.0, + max = 1, + val_min = 0.0, + val_max = 1.0, + fr = "Quantile empirique", + ang = "Empirical quantile", + ), + + AnalysedCorrelations = SIMP ( statut = "o", + typ = 'TXM', + into = ( 'yes', 'no' ), + defaut = 'no', + max = 1, + fr = "Correlations analysees", + ang = "Analysed correlations", + ), + + KernelSmoothing = SIMP ( statut = "o", + typ = 'TXM', + into = ( 'yes', 'no' ), + defaut = 'no', + max = 1, + fr = "Kernel smoothing de l'echantillon", + ang = "Kernel smoothing of the sample", + ), + + ), # Fin FACT Result + + ), # Fin BLOC RandomSamplingSettings + + ), # Fin BLOC CentralUncertainty + + + + + ThresholdExceedence = BLOC ( condition = " Type in ( 'Threshold Exceedence', ) ", + + Event = FACT ( statut = "o", + min = 1, + max = 1, + + Threshold = SIMP ( statut = "o", + typ = "R", + max = 1, + fr = "Le seuil de defaillance", + ang = "Failure threshold", + ), + + ComparisonOperator = SIMP ( statut = "o", + typ = "TXM", + max = 1, + into = ( "Less", "LessOrEqual", "Equal", "GreaterOrEqual", "Greater" ), + fr = "Que faut-il ne pas depasser : un maximum ou un minimum", + ang = "What is the failure threshold : maximum or minimum", + ), + ), # Fin FACT Event + + + Method = SIMP ( statut = "o", + typ = "TXM", + into = ( "Simulation", "Analytical" ), + fr = "Methode", + ang = "Method", + ), + + SimulationSettings = BLOC ( condition = " Method in ( 'Simulation', ) ", + + Algorithm = SIMP ( statut = "o", + typ = "TXM", + into = ( "MonteCarlo", "LHS", "ImportanceSampling" ), + fr = "Algorithme de simulation", + ang = "Simulation algorithm", + ), + + + RandomGenerator = FACT ( statut = "o", + min = 1, + max = 1, + + SeedToBeSet = SIMP ( statut = "o", + typ = 'TXM', + into = ( 'yes', 'no' ), + defaut = 'no', + max = 1, + fr = "La racine du generateur aleatoire doit-elle etre positionnee ?", + ang = "Does the random generator seed need to be set ?", + ), + + SeedSettings = BLOC ( condition = " SeedToBeSet in ( 'yes', ) ", + + RandomGeneratorSeed = SIMP ( statut = "o", + typ = "I", + max = 1, + fr = "Racine du generateur aleatoire", + ang = "Random generator seed", + ), + + ), # Fin BLOC SeedSettings + + ), # Fin FACT RandomGenerator + + + BlockSize = SIMP ( statut = "f", + typ = "I", + max = 1, + val_min = 1, + defaut = 1, + fr = "Nombre de calculs realises en bloc", + ang = "Number of computations as a block", + ), + + MaximumOuterSampling = SIMP ( statut = "o", + typ = "I", + max = 1, + val_min = 1, + fr = "Maximum d'iterations externes", + ang = "Maximum outer Sampling value", + ), + + MaximumCoefficientOfVariation = SIMP ( statut = "f", + typ = "R", + max = 1, + defaut = 0.1, + val_min = 0.0, + fr = " maximum ...", + ang = "Absolute maximum ...." + ), + + ImportanceSamplingSettings = BLOC ( condition = " Algorithm in ( 'ImportanceSampling', ) ", + + MeanVector = SIMP ( statut = "o", + typ = "R", + max = "**", + fr = "Moyenne", + ang = "Mean vector", + ), + + Correlation = SIMP ( statut = "o", + typ = 'TXM', + into = ( 'Independent', 'Linear' ), + defaut = 'Linear', + max = 1, + fr = "Le type de correlation entre les variables", + ang = "Correlation between variables", + ), + + ), # Fin BLOC ImportanceSamplingSettings + + Result = FACT ( statut = "o", + min = 1, + max = "**", + + Probability = SIMP ( statut = "o", + typ = 'TXM', + into = ( 'yes', ), + defaut = 'yes', + max = 1, + fr = "Probabiblite", + ang = "Probability", + ), + + ConfidenceInterval = SIMP ( statut = "o", + typ = 'TXM', + into = ( 'yes', 'no' ), + defaut = 'yes', + max = 1, + fr = "Ecart-type empirique", + ang = "Empirical standard deviation", + ), + + ConfidenceIntervalSettings = BLOC ( condition = " ConfidenceInterval in ( 'yes', ) ", + + Level = SIMP ( statut = "o", + typ = 'R', + defaut = 0.0, + max = 1, + val_min = 0.0, + val_max = 1.0, + fr = "Niveau de confiance", + ang = "Confidence level", + ), + + ), # Fin BLOC ConfidenceIntervalSettings + + VariationCoefficient = SIMP ( statut = "o", + typ = 'TXM', + into = ( 'yes', 'no' ), + defaut = 'yes', + max = 1, + fr = "Coefficient de variation", + ang = "VariationCoefficient", + ), + + IterationNumber = SIMP ( statut = "o", + typ = 'TXM', + into = ( 'yes', 'no' ), + defaut = 'yes', + max = 1, + fr = "Nombre d'iterations", + ang = "Iteration number", + ), + + ConvergenceGraph = SIMP ( statut = "o", + typ = 'TXM', + into = ( 'yes', 'no' ), + defaut = 'yes', + max = 1, + fr = "Graphe de convergence", + ang = "Convergence graph", + ), + + ), # Fin FACT Result + + + + ), # Fin BLOC SimulationSettings + + + + AnalyticalSettings = BLOC ( condition = " Method in ( 'Analytical', ) ", + + Approximation = SIMP ( statut = "o", + typ = "TXM", + into = ( "FORM", "SORM" ), + fr = "Approximation", + ang = "Approximation", + ), + + OptimizationAlgorithm = SIMP ( statut = "o", + typ = "TXM", + into = ( "Cobyla", "AbdoRackwitz" ), + fr = "Methode d'optimisation", + ang = "Optimisation method", + ), + + + PhysicalStartingPoint = SIMP ( statut = "f", + typ = "R", + max = "**", + fr = "Point de demarrage de l'algorithme iteratif", + ang = "Initial point for iterative process", + ), + + MaximumIterationsNumber = SIMP ( statut = "f", + typ = "I", + max = 1, + val_min = 1, + fr = "Nombre maximum d iterations", + ang = "Maximum number of iterations", + ), + + regles = ( EXCLUS ( "MaximumAbsoluteError", "RelativeAbsoluteError" ), ), + + MaximumAbsoluteError = SIMP ( statut = "f", + typ = "R", + max = 1, + defaut = 1E-6, + val_min = 0.0, + fr = "Distance maximum absolue entre 2 iterations successifs", + ang = "Absolute maximum distance between 2 successive iterates", + ), + + RelativeAbsoluteError = SIMP ( statut = "f", + typ = "R", + max = 1, + defaut = 1E-6, + val_min = 0.0, + fr = "Distance maximum relative entre 2 iterations successives", + ang = "Relative maximum distance between 2 successive iterates", + ), + + MaximumConstraintError = SIMP ( statut = "f", + typ = "R", + max = 1, + val_min = 0.0, + fr = "Valeur maximum absolue de la fonction moins la valeur du niveau", + ang = "Maximum absolute value of the constraint function minus the level value", + ), + + ImportanceSampling = SIMP ( statut = "o", + typ = 'TXM', + into = ( 'yes', 'no' ), + defaut = 'no', + max = 1, + fr = "Tirage d'importance au point de conception", + ang = "Importance sampling at design point", + ), + + FORM = BLOC ( condition = " Approximation in ( 'FORM', ) ", + + Probability = SIMP ( statut = "o", + typ = 'TXM', + into = ( 'yes', ), + defaut = 'yes', + max = 1, + fr = "Probabiblite", + ang = "Probability", + ), + + DesignPoint = SIMP ( statut = "o", + typ = 'TXM', + into = ( 'yes', 'no' ), + defaut = 'yes', + max = 1, + fr = "Point de conception", + ang = "Design point", + ), + + HasReliabilityIndex = SIMP ( statut = "o", + typ = 'TXM', + into = ( 'yes', 'no' ), + defaut = 'yes', + max = 1, + fr = "Indice de fiabilite", + ang = "Reliability index", + ), + + ImportanceFactor = SIMP ( statut = "o", + typ = 'TXM', + into = ( 'yes', 'no' ), + defaut = 'no', + max = 1, + fr = "Facteur d'importance pour variable de sortie scalaire", + ang = "ImportanceFactor", + ), + + ImportanceFactorSettings = BLOC ( condition = " ImportanceFactor in ( 'yes', ) ", + + NumericalResults = SIMP ( statut = "o", + typ = 'TXM', + into = ( 'yes', 'no' ), + defaut = 'yes', + max = 1, + fr = "Resultats numeriques", + ang = "NumericalResults", + ), + + GraphicalResults = SIMP ( statut = "o", + typ = 'TXM', + into = ( 'yes', 'no' ), + defaut = 'no', + max = 1, + fr = "Resultats graphiques", + ang = "GraphicalResults", + ), + + ), # Fin BLOC ImportanceFactorSettings + + + SensitivityAnalysis = SIMP ( statut = "o", + typ = 'TXM', + into = ( 'yes', 'no' ), + defaut = 'no', + max = 1, + fr = "Analyse de sensibilite", + ang = "Sensitivity analysis", + ), + + SensitivityAnalysisSettings = BLOC ( condition = " SensitivityAnalysis in ( 'yes', ) ", + + HasoferReliabilityIndex = SIMP ( statut = "o", + typ = 'TXM', + into = ( 'yes', 'no' ), + defaut = 'no', + max = 1, + fr = "Indice de fiabilite de Hasofer", + ang = "Hasofer reliability index", + ), + + HasoferReliabilityIndexSettings = BLOC ( condition = " HasoferReliabilityIndex in ( 'yes', ) ", + + NumericalResults = SIMP ( statut = "o", + typ = 'TXM', + into = ( 'yes', 'no' ), + defaut = 'yes', + max = 1, + fr = "Resultats numeriques", + ang = "NumericalResults", + ), + + GraphicalResults = SIMP ( statut = "o", + typ = 'TXM', + into = ( 'yes', 'no' ), + defaut = 'no', + max = 1, + fr = "Resultats graphiques", + ang = "GraphicalResults", + ), + + ), # Fin BLOC HasoferReliabilityIndexSettings + + ), # Fin BLOC SensitivityAnalysisSettings + + FunctionCallsNumber = SIMP ( statut = "o", + typ = 'TXM', + into = ( 'yes', 'no' ), + defaut = 'no', + max = 1, + fr = "Nombre d'appels a la fonction", + ang = "Function calls number", + ), + + + ), # Fin BLOC FORM + + + SORM = BLOC ( condition = " Approximation in ( 'SORM', ) ", + + + TvedtApproximation = SIMP ( statut = "o", + typ = 'TXM', + into = ( 'yes', 'no' ), + defaut = 'no', + max = 1, + fr = "Approximation de Tvedt", + ang = "Tvedt approximation", + ), + + HohenBichlerApproximation = SIMP ( statut = "o", + typ = 'TXM', + into = ( 'yes', 'no' ), + defaut = 'no', + max = 1, + fr = "Approximation de HohenBichler", + ang = "HohenBichler approximation", + ), + + BreitungApproximation = SIMP ( statut = "o", + typ = 'TXM', + into = ( 'yes', 'no' ), + defaut = 'no', + max = 1, + fr = "Approximation de Breitung", + ang = "Breitung approximation", + ), + + DesignPoint = SIMP ( statut = "o", + typ = 'TXM', + into = ( 'yes', 'no' ), + defaut = 'yes', + max = 1, + fr = "Point de conception", + ang = "Design point", + ), + + ImportanceFactor = SIMP ( statut = "o", + typ = 'TXM', + into = ( 'yes', 'no' ), + defaut = 'no', + max = 1, + fr = "Facteur d'importance pour variable de sortie scalaire", + ang = "ImportanceFactor", + ), + + ImportanceFactorSettings = BLOC ( condition = " ImportanceFactor in ( 'yes', ) ", + + NumericalResults = SIMP ( statut = "o", + typ = 'TXM', + into = ( 'yes', 'no' ), + defaut = 'yes', + max = 1, + fr = "Resultats numeriques", + ang = "NumericalResults", + ), + + GraphicalResults = SIMP ( statut = "o", + typ = 'TXM', + into = ( 'yes', 'no' ), + defaut = 'no', + max = 1, + fr = "Resultats graphiques", + ang = "GraphicalResults", + ), + + ), # Fin BLOC ImportanceFactorSettings + + + SensitivityAnalysis = SIMP ( statut = "o", + typ = 'TXM', + into = ( 'yes', 'no' ), + defaut = 'no', + max = 1, + fr = "Analyse de sensibilite", + ang = "Sensitivity analysis", + ), + + SensitivityAnalysisSettings = BLOC ( condition = " SensitivityAnalysis in ( 'yes', ) ", + + HasoferReliabilityIndex = SIMP ( statut = "o", + typ = 'TXM', + into = ( 'yes', 'no' ), + defaut = 'no', + max = 1, + fr = "Indice de fiabilite de Hasofer", + ang = "Hasofer reliability index", + ), + + HasoferReliabilityIndexSettings = BLOC ( condition = " HasoferReliabilityIndex in ( 'yes', ) ", + + NumericalResults = SIMP ( statut = "o", + typ = 'TXM', + into = ( 'yes', 'no' ), + defaut = 'yes', + max = 1, + fr = "Resultats numeriques", + ang = "NumericalResults", + ), + + GraphicalResults = SIMP ( statut = "o", + typ = 'TXM', + into = ( 'yes', 'no' ), + defaut = 'no', + max = 1, + fr = "Resultats graphiques", + ang = "GraphicalResults", + ), + + ), # Fin BLOC HasoferReliabilityIndexSettings + + ), # Fin BLOC SensitivityAnalysisSettings + + FunctionCallsNumber = SIMP ( statut = "o", + typ = 'TXM', + into = ( 'yes', 'no' ), + defaut = 'no', + max = 1, + fr = "Nombre d'appels a la fonction", + ang = "Function calls number", + ), + + + ), # Fin BLOC SORM + + + + ), # Fin BLOC AnalyticalSettings + + + + ), # Fin BLOC ThresholdExceedence + + + +) # Fin PROC CRITERIA + + +#=============================== +# 5. Definition des parametres +#=============================== +VARI = OPER ( nom = "VARI", + sd_prod = variable, + op = None, + fr = "Definitions des lois marginales utilisees par les variables d'entree", + type=SIMP(statut='f',defaut="IN",into=("IN","OUT"), typ = "TXM",) + ) + +ESSAI=PROC(nom="ESSAI", + op=None, + fr="Essai", + ang = "Test", + + MALOI = SIMP(statut='o',typ=(loi,),), + MAVARIABLE = SIMP(statut='o',typ=(variable,),), +) ; + + + + diff --git a/Cuve2dg/catalogues_cuve2dg.ini b/Cuve2dg/catalogues_cuve2dg.ini new file mode 100644 index 00000000..ac75b5ba --- /dev/null +++ b/Cuve2dg/catalogues_cuve2dg.ini @@ -0,0 +1,11 @@ +# Choix des catalogues +import os +#rep_cata=os.path.dirname(os.path.abspath(__file__)) +rep_cata=os.getcwd() + +catalogues = ( +# (code,version,catalogue,formatIn,formatOut) + ('CUVE2DG','V1',os.path.join(rep_cata,'Cuve2dg_Cata_V1.py'),'python','cuve2dg'), + #('CUVE2DG','V2',os.path.join(rep_cata,'Cuve2dg_Cata_V2.py'),'python','cuve2dg'), +) + diff --git a/Cuve2dg/configuration.py b/Cuve2dg/configuration.py new file mode 100644 index 00000000..32de01ba --- /dev/null +++ b/Cuve2dg/configuration.py @@ -0,0 +1,194 @@ +# -*- coding: utf-8 -*- +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== +""" + Ce module sert pour charger les paramètres de configuration d'EFICAS +""" +# Modules Python +print "passage dans la surcharge de configuration pour Cuve2dg" +import os, sys, string, types, re +import traceback +from PyQt4.QtGui import * + +# Modules Eficas +from Editeur import utils + +class CONFIG: + + #----------------------------------- + def __init__(self,appli,repIni): + #----------------------------------- + + # Classe de base permettant de lire, afficher + # et sauvegarder les fichiers utilisateurs + # On a deux directories : la directory generale (Repertoire d instal + Nom du code + # Par exemple : ~/Install_Eficas/EficasV1_14/Openturns_Wrapper + # et la directorie de l utilisateur + # HOME/.Eficas_Openturns + # Le fichier prefs.py va etre lu dans la directory generale puis surcharge eventuellement + # par celui de l utilisateur + # le fichier de catalogue va etre lu dans la directory de l utilisateur s il exite + # dans le fichier general sinon + self.appli = appli + self.code = appli.code + self.salome = appli.salome + self.repIni = repIni + self.fic_prefs ="prefs.py" + + if self.appli: + self.parent=appli.top + #self.appli.format_fichier="openturns_study" + else: self.parent=None + + + self.labels=("rep_user","INSTALLDIR","path_doc","exec_acrobat","rep_cata","initialdir","savedir") + + # Valeurs par defaut + self.rep_user = os.path.join(os.environ['HOME'],'.Eficas_Cuve2dg') + self.initialdir = self.rep_user + self.path_doc = self.rep_user + self.savedir = self.rep_user + self.exec_acrobat = self.rep_user + + #Lecture des fichiers utilisateurs + self.lecture_fichier_ini_standard() + self.lecture_fichier_ini_utilisateur() + self.lecture_catalogues() + print self.initialdir + + #-------------------------------------- + def lecture_fichier_ini_standard(self): + #-------------------------------------- + # Verifie l'existence du fichier "standard" + # appelle la lecture de ce fichier + self.fic_ini = os.path.join(self.repIni,self.fic_prefs) + if not os.path.isfile(self.fic_ini): + QMessageBox.critical( None, "Import du fichier de Configuration", + "Erreur à la lecture du fichier de configuration "+self.fic_ini+".py" ) + sys.exit(0) + import prefs + for k in self.labels : + try : + valeur=getattr(prefs,k) + setattr(self,k,valeur) + except : + pass + + + #-------------------------------------- + def lecture_fichier_ini_utilisateur(self): + #-------------------------------------- + # Surcharge les paramètres standards par les paramètres utilisateur s'ils existent + self.fic_ini_utilisateur = os.path.join(self.rep_user,self.fic_prefs) + #if not os.path.isfile(self.fic_ini_utilisateur+".py"): + if not os.path.isfile(self.fic_ini_utilisateur): + return + from utils import read_file + txt = utils.read_file(self.fic_ini_utilisateur) + from styles import style + d=locals() + try: + exec txt in d + except : + l=traceback.format_exception(sys.exc_info()[0],sys.exc_info()[1],sys.exc_info()[2]) + QMessageBox.critical( None, "Import du fichier de Configuration", + "Erreur à la lecture du fichier de configuration " + self.fic_ini_utilisateur ) + sys.exit(0) + for k in self.labels : + try : + setattr(self,k,d[k]) + except : + pass + + + + #-------------------------------------- + def lecture_catalogues(self): + #-------------------------------------- + rep_mat=" " # Compatbilite Aster + fic_cata ="catalogues_cuve2dg.ini" + fic_ini = os.path.join(self.repIni,fic_cata) + fic_user= os.path.join(self.rep_user,fic_cata) + if os.path.isfile(fic_user): + fichier = fic_user + else : + fichier = fic_ini + if not os.path.isfile(fic_ini) : + QMessageBox.critical( None, "Erreur a l'import du fichier des Catalogues", + "Le fichier de configuration des catalogues "+fic_ini+" n a pas été trouvé" ) + sys.exit(0) + + from utils import read_file + txt = utils.read_file(fichier) + d=locals() + try: + exec txt in d + self.catalogues=d["catalogues"] + except : + l=traceback.format_exception(sys.exc_info()[0],sys.exc_info()[1],sys.exc_info()[2]) + QMessageBox.critical( None, "Import du fichier de Configuration", + "Erreur à la lecture du fichier de configuration " + fichier ) + sys.exit(0) + + + + #-------------------------------------- + def save_params(self): + #-------------------------------------- + # sauvegarde + # les nouveaux paramètres dans le fichier de configuration utilisateur + # + print "a ecrire PNPNPN" +# l_param=('exec_acrobat', 'repIni','catalogues','rep_travail','rep_mat','path_doc') +# texte="" +# for clef in l_param : +# if hasattr(self,clef): +# valeur=getattr(self,clef) +# texte= texte + clef+" = " + repr(valeur) +"\n" +# +# +# # recuperation des repertoires materiaux +# try : +# for item in self.catalogues : +# try : +# (code,version,cata,format,defaut)=item +# except : +# (code,version,cata,format)=item +# codeSansPoint=re.sub("\.","",version) +# chaine="rep_mat_"+codeSansPoint +# if hasattr(self,chaine): +# valeur=getattr(self,chaine) +# texte= texte + chaine+" = '" + str(valeur) +"'\n" +# except : +# pass +# +# f=open(self.fic_ini_utilisateur,'w+') +# f.write(texte) +# f.close() +# + + +def make_config(appli,rep): + return CONFIG(appli,rep) + +def make_config_style(appli,rep): + return None + + diff --git a/Cuve2dg/prefs.py b/Cuve2dg/prefs.py new file mode 100644 index 00000000..b62522cf --- /dev/null +++ b/Cuve2dg/prefs.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== + +import os, sys +# Les variables pouvant positionnees sont : +# "rep_user","INSTALLDIR","path_doc","exec_acrobat","rep_cata" +print "import des prefs de CUVE2DG" + +code = "CUVE2DG" + +# REPINI sert à localiser le fichier +# initialdir sert comme directory initial des QFileDialog +# positionnee a repin au debut mise a jour dans configuration +REPINI=os.path.dirname(os.path.abspath(__file__)) +initialdir=REPINI + +# INSTALLDIR sert à localiser l'installation d'Eficas +INSTALLDIR=os.path.join(REPINI,'..') + + +# Codage des strings qui accepte les accents (en remplacement de 'ascii') +# lang indique la langue utilisée pour les chaines d'aide : fr ou ang +lang='fr' +encoding='iso-8859-1' + +# Acces a la documentation +rep_cata = INSTALLDIR +path_doc = os.path.join(rep_cata,'Doc') +exec_acrobat = "/usr/bin/xpdf" + + +# Choix des catalogues +sys.path[:0]=[INSTALLDIR] + diff --git a/Cuve2dg/properties.py b/Cuve2dg/properties.py new file mode 100644 index 00000000..8ba0ed7e --- /dev/null +++ b/Cuve2dg/properties.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +#@ MODIF properties Accas DATE 10/10/2002 AUTEUR gcbhhhh M.ADMINISTRATEUR +# CONFIGURATION MANAGEMENT OF EDF VERSION +# RESPONSABLE D6BHHHH J-P.LEFEBVRE +# ====================================================================== +# COPYRIGHT (C) 1991 - 2001 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# ====================================================================== +# IDENTIFICATION DU GESTIONNAIRE DE COMMANDE ACCAS A PARTIR +# DE LA VERSION DU CODE_ASTER ASSOCIE +#---------------------------------------------------------------------- +version = "7.1.0" +date = "23/04/2003" diff --git a/Cuve2dg/qtEficas_cuve2dg.py b/Cuve2dg/qtEficas_cuve2dg.py new file mode 100755 index 00000000..f4fd01d4 --- /dev/null +++ b/Cuve2dg/qtEficas_cuve2dg.py @@ -0,0 +1,33 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== + +""" + Ce module sert à lancer EFICAS configuré pour Openturns +""" +# Modules Python + +# Modules Eficas +import prefs +prefs.code="CUVE2DG" +from InterfaceQT4 import eficas_go + +eficas_go.lance_eficas(code=prefs.code) diff --git a/Cuve2dg/sdistCuveqt.py b/Cuve2dg/sdistCuveqt.py new file mode 100644 index 00000000..5ec24523 --- /dev/null +++ b/Cuve2dg/sdistCuveqt.py @@ -0,0 +1,102 @@ +# -*- coding: utf-8 -*- +""" + Ce module sert à construire les distributions d'EFICAS pour Openturns + en fonction du tag CVS courant + Les distributions sont : + - un tar.gz pour UNIX ne contenant pas mxTextTools + L'utilisation de ce module est la suivante : + 1- Se mettre dans un répertoire de travail + 2- Configurer son environnement pour utiliser le référentiel CVS EFICAS + 3- Exporter les sources d'EficasV1 par la commande : + cvs export -r TAG -d Eficas_export EficasV1 + ou TAG est le tag CVS de la version que l'on veut distribuer (par exemple V1_1p1) + 5- Aller dans le répertoire Eficas_export + 6- Executer le script sdist.py + python sdist.py + Ce qui a pour effet de creer un repertoire dist contenant la distribution + et de la copier dans le répertoire indiqué par dir_download s'il est accessible + +""" +import os,shutil,glob,sys +import types + +nom_distrib="QTEficasOpenturns_V1_0" +path_distrib=os.path.join("dist",nom_distrib) +path_TextTools="/home/eficas/pkg/mxTools/egenix2.0.2pourWindows/mx/TextTools" +dir_download= "/home/eficas/WWW/telechargement/eficas" + +def main(): + if os.path.isdir('dist'):shutil.rmtree('dist') + + copyfiles('.',path_distrib,['LICENSE.TERMS','INSTALL','NEWS']) + + copyfiles('../Editeur',os.path.join(path_distrib,'Editeur'),['*.py','faqs.txt']) + copyfiles('../InterfaceQT4',os.path.join(path_distrib,'InterfaceQT4'),['*.py','faqs.txt']) + copyfiles('../UiQT4',os.path.join(path_distrib,'UiQT4'),['*.ui','makefile']) + copyfiles('../Cuve2dg',os.path.join(path_distrib,'Cuve2dg'),['*.py','*.ini']) + copyfiles('../Ihm',os.path.join(path_distrib,'Ihm'),['*.py']) + copyfiles('../Extensions',os.path.join(path_distrib,'Extensions'),['*.py']) + copyfiles('../Misc',os.path.join(path_distrib,'Misc'),['*.py']) + copyfiles('../Accas',os.path.join(path_distrib,'Accas'),['*.py']) + copyfiles('../Accas',os.path.join(path_distrib,'Noyau'),['*.py']) + copyfiles('../Accas',os.path.join(path_distrib,'Validation'),['*.py']) + # AIDE + copyfiles('../AIDE',os.path.join(path_distrib,'AIDE'),['*.py']) + copyfiles('../AIDE/fichiers',os.path.join(path_distrib,'AIDE','fichiers'),['*']) + copyfiles('.',os.path.join(path_distrib,'AIDE','fichiers'),['INSTALL','NEWS']) + copyfiles('../Editeur',os.path.join(path_distrib,'AIDE','fichiers'),['faqs.txt']) + # ______________________ + + copyfiles('../convert',os.path.join(path_distrib,'convert'),['*.py']) + copyfiles('../convert/Parserv5',os.path.join(path_distrib,'convert','Parserv5'),['*.py']) + copyfiles('../generator',os.path.join(path_distrib,'generator'),['*.py']) + copyfiles('../Editeur/icons',os.path.join(path_distrib,'Editeur','icons'),['*.gif']) + copyfiles('../Editeur/icons',os.path.join(path_distrib,'Editeur','icons'),['*.png']) + copyfiles('../Editeur/Patrons/',os.path.join(path_distrib,'Editeur','Patrons'),['*.com*']) + copyfiles('../Editeur/Patrons/CUVE2DG',os.path.join(path_distrib,'Editeur','Patrons','CUVE2DG'),['*.com*']) + + copyfiles('../Noyau',os.path.join(path_distrib,'Noyau'),['*.py']) + copyfiles('../Validation',os.path.join(path_distrib,'Validation'),['*.py']) + + + tarball= maketarball('dist',nom_distrib,nom_distrib) + try: + shutil.copy(tarball,dir_download) + except: + print "Repertoire de download inconnu : ",dir_download + + + +def make_dir(dir_cible): + if type(dir_cible) is not types.StringType: + raise "make_dir : dir_cible doit etre une string (%s)" % `dir_cible` + head,tail=os.path.split(dir_cible) + tails=[tail] + while head and tail and not os.path.isdir(head): + head,tail=os.path.split(head) + tails.insert(0, tail) + + for d in tails: + head = os.path.join(head, d) + if not os.path.isdir(head):os.mkdir(head) + + +def copyfiles(dir_origin,dir_cible,listfiles): + if not os.path.isdir(dir_cible):make_dir(dir_cible) + for glob_files in listfiles: + for file in glob.glob(os.path.join(dir_origin,glob_files)): + shutil.copy(file,dir_cible) + + +def maketarball(dir_trav,dir_cible,nom_tar): + prev=os.getcwd() + print prev + os.chdir(dir_trav) + os.system("tar -cf "+nom_tar+".tar "+dir_cible) + os.system("gzip -f9 "+nom_tar+".tar ") + os.chdir(prev) + return os.path.join(dir_trav,nom_tar+".tar.gz") + + +main() + diff --git a/Cuve2dg/style.py b/Cuve2dg/style.py new file mode 100644 index 00000000..7da9d534 --- /dev/null +++ b/Cuve2dg/style.py @@ -0,0 +1 @@ +# Necessaire pour compatibilite avec Aster