|
From: <de...@us...> - 2003-09-02 08:42:51
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/reflux/io
In directory sc8-pr-cvs1:/tmp/cvs-serv9006/reflux/io
Modified Files:
INPAdapter.java INPFileFormat.java INPReader.java
INPWriter.java
Log Message:
Correction bug 797184
Amelioration lecture format reflux/telemac
Index: INPAdapter.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/reflux/io/INPAdapter.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** INPAdapter.java 22 Aug 2003 15:51:12 -0000 1.5
--- INPAdapter.java 2 Sep 2003 08:41:24 -0000 1.6
***************
*** 34,39 ****
private boolean isVentLecturePasDeTemps_;
private boolean isRadiationsLecturePasDeTemps_;
! private int nbPNTransitoires_;
! private int nbCLTransitoires_;
private String version_;
// public H2dParametresCalculReflux parametresCalcul_;
--- 34,39 ----
private boolean isVentLecturePasDeTemps_;
private boolean isRadiationsLecturePasDeTemps_;
! // private int nbPNTransitoires_;
! // private int nbCLTransitoires_;
private String version_;
// public H2dParametresCalculReflux parametresCalcul_;
***************
*** 56,71 ****
! public void setNbPNTransitoires(int _i)
! {
! if(_i>0)
! nbPNTransitoires_=_i;
! }
!
! public void setNbCLTransitoires(int _i)
! {
! if(_i>0)
! nbCLTransitoires_=_i;
! }
!
--- 56,71 ----
! // public void setNbPNTransitoires(int _i)
! // {
! // if(_i>0)
! // nbPNTransitoires_=_i;
! // }
! //
! // public void setNbCLTransitoires(int _i)
! // {
! // if(_i>0)
! // nbCLTransitoires_=_i;
! // }
! //
***************
*** 175,190 ****
* @return
*/
! public int getNbCLTransitoires()
! {
! return nbCLTransitoires_;
! }
!
! /**
! * @return
! */
! public int getNbPNTransitoires()
! {
! return nbPNTransitoires_;
! }
/**
--- 175,190 ----
* @return
*/
! // public int getNbCLTransitoires()
! // {
! // return nbCLTransitoires_;
! // }
! //
! // /**
! // * @return
! // */
! // public int getNbPNTransitoires()
! // {
! // return nbPNTransitoires_;
! // }
/**
Index: INPFileFormat.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/reflux/io/INPFileFormat.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** INPFileFormat.java 22 Aug 2003 15:51:12 -0000 1.5
--- INPFileFormat.java 2 Sep 2003 08:41:24 -0000 1.6
***************
*** 18,21 ****
--- 18,22 ----
import org.fudaa.dodico.corba.tr.LTrSchemaResolution;
+ import org.fudaa.dodico.commun.DodicoLib;
import org.fudaa.dodico.commun.ProgressionInterface;
import org.fudaa.dodico.dico.DicoCasFileFormat;
***************
*** 28,39 ****
import org.fudaa.dodico.dico.DicoManager;
import org.fudaa.dodico.fichiers.FileFormatSoftware;
- import org.fudaa.dodico.fichiers.FileFormatVersion;
import org.fudaa.dodico.fichiers.FileOperationSynthese;
import org.fudaa.dodico.fichiers.FileReadOperationAbstract;
import org.fudaa.dodico.fichiers.FileWriteOperationAbstract;
import org.fudaa.dodico.h2d.type.H2dBordType;
import org.fudaa.dodico.h2d.type.H2dClType;
import org.fudaa.dodico.h2d.type.H2dFileFormatType;
! import org.fudaa.dodico.h2d.reflux.H2dRefluxDicoModel;
/**
--- 29,40 ----
import org.fudaa.dodico.dico.DicoManager;
import org.fudaa.dodico.fichiers.FileFormatSoftware;
import org.fudaa.dodico.fichiers.FileOperationSynthese;
import org.fudaa.dodico.fichiers.FileReadOperationAbstract;
import org.fudaa.dodico.fichiers.FileWriteOperationAbstract;
+ import org.fudaa.dodico.h2d.reflux.H2dRefluxDicoModel;
import org.fudaa.dodico.h2d.type.H2dBordType;
import org.fudaa.dodico.h2d.type.H2dClType;
import org.fudaa.dodico.h2d.type.H2dFileFormatType;
! import org.fudaa.dodico.h2d.type.H2dVariableType;
/**
***************
*** 73,87 ****
}
! private String[] schemaResolution_=
! { "STATIONNAIRE", "EULER", "LAXWEN", "SELUMP" };
! private String[] methodeResolution_=
! {
! "LINEAIRE",
! "NEWTON",
! "NEWTON_BCD",
! "NEWTON_LMG",
! "SELUMP",
! "SELUMP_BCD",
! "LAXWEN" };
public H2dClType getClType(int _id) {
--- 74,104 ----
}
! public String getClTransitoireFileExtension() {
! return CLTransitoireFileFormat.getInstance().getExtensions()[0];
! }
!
! public String getPnTransitoireFileExtension() {
! return PnTransitoireFileFormat.getInstance().getExtensions()[0];
! }
!
! public String getSolutionInitFileExtension() {
! return ".siv";
! }
!
! public String getSolutionFileExtension() {
! return ".sov";
! }
!
! public String getSolutionFinaleExtension() {
! return ".sfv";
! }
!
! public String getCLTransitoireFichier(String[] _f) {
! return DodicoLib.findStringEndWith(_f, getClTransitoireFileExtension());
! }
!
! public String getPnTransitoireFichier(String[] _f) {
! return DodicoLib.findStringEndWith(_f, getPnTransitoireFileExtension());
! }
public H2dClType getClType(int _id) {
***************
*** 95,98 ****
--- 112,135 ----
}
+ public int getCode(H2dClType _t) {
+ if (_t == H2dClType.LIBRE)
+ return getCodeLibre();
+ else if (_t == H2dClType.PERMANENT)
+ return getCodePermanent();
+ else if (_t == H2dClType.TRANSITOIRE)
+ return getCodeTransitoire();
+ return -1;
+ }
+
+ public int getPositionForCond(H2dVariableType _v) {
+ if (_v == H2dVariableType.VITESSE_U)
+ return 0;
+ else if (_v == H2dVariableType.VITESSE_V)
+ return 1;
+ else if (_v == H2dVariableType.COTE_EAU)
+ return 2;
+ return -1;
+ }
+
public H2dBordType getBordType(int _id) {
if (_id == getCodeBordLiquide())
***************
*** 105,108 ****
--- 142,156 ----
}
+ public int getBordTypeId(H2dBordType _id) {
+ if (_id == H2dBordType.LIQUIDE)
+ return getCodeBordLiquide();
+ else if (_id == H2dBordType.LIQUIDE_DEBIT_IMPOSE)
+ return getCodeBordLiquideDebit();
+ else if (
+ (_id == H2dBordType.SOLIDE) || (_id == H2dBordType.SOLIDE_FROTTEMENT))
+ return getCodeBordSolideFrottement();
+ return -1;
+ }
+
/**
* Renvoie, a partir de la chaine _s lue dans un fichier inp, le
***************
*** 160,163 ****
--- 208,215 ----
}
+ public int[] getFLUTNBPasTemps() {
+ return new int[] { 10 };
+ }
+
public int[] getFLUTSchemaResolutionFormat() {
return new int[] { 20, 10, 10 };
***************
*** 175,178 ****
--- 227,233 ----
return "COEFFICIENTS";
}
+ public String getFLUTImpression() {
+ return "IMPRESSION";
+ }
public int[] getFLUTFreqImpressionFormat() {
***************
*** 180,190 ****
}
! public String[] getFLUTSchemaResolution() {
! return schemaResolution_;
! }
!
! public String[] getFLUTMethodeResolution() {
! return methodeResolution_;
! }
public String getIMPRESSION() {
--- 235,245 ----
}
! // public String[] getFLUTSchemaResolution() {
! // return schemaResolution_;
! // }
! //
! // public String[] getFLUTMethodeResolution() {
! // return methodeResolution_;
! // }
public String getIMPRESSION() {
***************
*** 212,225 ****
}
public int getDLPNDllPointExtremite() {
return 3;
} /**
! * Renvoie le format concernant la ligne declarant le bloc Coor.
! */
public int[] getCOORFormat() {
return new int[] { 5, 15, 5, 5 };
} /**
! * Renvoie le format concernant les lignes declarant les coordonnées.
! */
public int[] getTroisDoubleFormat() {
return new int[] { 10, 10, 10 };
--- 267,284 ----
}
+ public int getDLPNDllPointMilieu() {
+ return 2;
+ }
+
public int getDLPNDllPointExtremite() {
return 3;
} /**
! * Renvoie le format concernant la ligne declarant le bloc Coor.
! */
public int[] getCOORFormat() {
return new int[] { 5, 15, 5, 5 };
} /**
! * Renvoie le format concernant les lignes declarant les coordonnées.
! */
public int[] getTroisDoubleFormat() {
return new int[] { 10, 10, 10 };
***************
*** 230,233 ****
--- 289,296 ----
}
+ public int[] getPRNDFormat() {
+ return new int[] { 5, 15, 5 };
+ }
+
public String getDLPN() {
return "DLPN";
***************
*** 290,293 ****
--- 353,360 ----
}
+ public int[] getBlocSimpleFormat() {
+ return new int[] { 5 };
+ }
+
public String getELEM() {
return "ELEM";
***************
*** 346,349 ****
--- 413,420 ----
}
+ public int getCodeFond() {
+ return 5;
+ }
+
public int getCodeBordLiquide() {
return 6;
***************
*** 358,377 ****
}
! public DicoEntite getCoefContribution(int _index) {
String rubrique= "Coefficients contribution";
DicoEntiteList entites= getRefluxModel().getEntites();
! if (entiteContrib_ == null) {
! List l= new ArrayList(18);
! DicoEntite ent;
! for (Iterator it= entites.iterator(); it.hasNext();) {
! ent= (DicoEntite)it.next();
! if (rubrique.equals(ent.getRubrique())) {
! l.add(ent);
! }
}
- Collections.sort(l, DicoEntiteGenerate.getComparatorIndex());
- entiteContrib_= new DicoEntite[l.size()];
- l.toArray(entiteContrib_);
}
if (_index < 0 || _index >= entiteContrib_.length) {
System.out.println(
--- 429,457 ----
}
! private void buildListContribution() {
String rubrique= "Coefficients contribution";
+ List l= new ArrayList(18);
+ DicoEntite ent;
DicoEntiteList entites= getRefluxModel().getEntites();
! for (Iterator it= entites.iterator(); it.hasNext();) {
! ent= (DicoEntite)it.next();
! if (rubrique.equals(ent.getRubrique())) {
! l.add(ent);
}
}
+ Collections.sort(l, DicoEntiteGenerate.getComparatorIndex());
+ entiteContrib_= new DicoEntite[l.size()];
+ l.toArray(entiteContrib_);
+ }
+
+ public int getCoefContributionNb() {
+ if (entiteContrib_ == null)
+ buildListContribution();
+ return entiteContrib_.length;
+ }
+
+ public DicoEntite getCoefContribution(int _index) {
+ if (entiteContrib_ == null)
+ buildListContribution();
if (_index < 0 || _index >= entiteContrib_.length) {
System.out.println(
***************
*** 396,399 ****
--- 476,493 ----
}
+ public CLVReader createCLVReader() {
+ return CLTransitoireFileFormat
+ .getInstance()
+ .getLastVersionImpl()
+ .createCLVReader();
+ }
+
+ public CLVWriter createCLVWriter() {
+ return CLTransitoireFileFormat
+ .getInstance()
+ .getLastVersionImpl()
+ .createCLVWriter();
+ }
+
/**
*
***************
*** 403,415 ****
}
public INPReader createINPReader() {
return new INPReader(this);
}
/**
*
*/
public FileWriteOperationAbstract createWriter() {
! return null;
}
--- 497,523 ----
}
+ public INPWriter createINPWriter() {
+ return new INPWriter(this);
+ }
+
public INPReader createINPReader() {
return new INPReader(this);
}
+ public FileOperationSynthese write(
+ File _f,
+ INPInterface _inter,
+ ProgressionInterface _prog) {
+ INPWriter w= createINPWriter();
+ w.setFile(_f);
+ w.setProgressReceiver(_prog);
+ return w.write(_inter);
+ }
+
/**
*
*/
public FileWriteOperationAbstract createWriter() {
! return new INPWriter(this);
}
Index: INPReader.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/reflux/io/INPReader.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** INPReader.java 22 Aug 2003 15:51:12 -0000 1.6
--- INPReader.java 2 Sep 2003 08:41:24 -0000 1.7
***************
*** 14,21 ****
--- 14,23 ----
import java.io.EOFException;
+ import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
+ import java.util.StringTokenizer;
[...1259 lines suppressed...]
! + clFile.getAbsolutePath());
! } else {
! CLVReader pnvr= version_.createCLVReader();
! H2dEvolutionMutable[] evols= new H2dEvolutionMutable[evolsPN.size()];
! evolsPN.toArray(evols);
! pnvr.setEvolutions(evols);
! pnvr.setFile(clFile);
! pnvr.setProgressReceiver(progress_);
! FileOperationSynthese s= pnvr.read();
! analyze_.merge(s.getAnalyze());
}
}
! return projet;
}
! public void setFile(File _f) {
! super.setFile(_f);
! baseFile_= _f.getAbsoluteFile().getParentFile().getAbsolutePath();
! ficName_= DodicoLib.getSansExtension(_f.getName());
}
Index: INPWriter.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/reflux/io/INPWriter.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** INPWriter.java 22 Aug 2003 15:51:12 -0000 1.4
--- INPWriter.java 2 Sep 2003 08:41:24 -0000 1.5
***************
*** 9,15 ****
package org.fudaa.dodico.reflux.io;
! import org.fudaa.dodico.fichiers.FileFormat;
! import org.fudaa.dodico.fichiers.FileOpWriterCharSimpleAbstract;
! import org.fudaa.dodico.fichiers.FileReadOperationAbstract;
/**
--- 9,49 ----
package org.fudaa.dodico.reflux.io;
[...1097 lines suppressed...]
+ String ficPn= version_.getPnTransitoireFichier(_inter.getFichiers());
+ if (ficPn == null) {
+ analyze_.addError(
+ DodicoLib.geti18n(
+ "Le fichier des proprietes nodales transitoires est introuvable( données non enregistrées)"));
+ }
+ else{
+ File fic=new File(baseDir_,ficPn);
+ System.out.println("ecriture "+fic.getAbsolutePath());
+ H2dEvolution[] evols=new H2dEvolution[pnTransitoireCourbeList.size()];
+ pnTransitoireCourbeList.toArray(evols);
+ CLVWriter w=version_.createCLVWriter();
+ analyze_.merge(w.write(evols,fic,progress_).getAnalyze());
+ }
+ }
+
+
+ }
}
|