|
From: <de...@us...> - 2003-12-19 12:10:40
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/reflux/io In directory sc8-pr-cvs1:/tmp/cvs-serv28839/reflux/io Modified Files: CLTransitoireFileFormat.java CorEleBthFileFormat.java INPAdapter.java INPFileFormat.java INPWriter.java Added Files: CrbFileFormat.java CrbReader.java CrbWriter.java Log Message: Update for h2d model Add support for evolution --- NEW FILE: CrbFileFormat.java --- (This appears to be a binary file; contents omitted.) --- NEW FILE: CrbReader.java --- (This appears to be a binary file; contents omitted.) --- NEW FILE: CrbWriter.java --- (This appears to be a binary file; contents omitted.) Index: CLTransitoireFileFormat.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/reflux/io/CLTransitoireFileFormat.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** CLTransitoireFileFormat.java 11 Dec 2003 12:41:28 -0000 1.5 --- CLTransitoireFileFormat.java 19 Dec 2003 12:10:37 -0000 1.6 *************** *** 9,12 **** --- 9,14 ---- package org.fudaa.dodico.reflux.io; import java.io.File; + + import org.fudaa.dodico.commun.DodicoResource; import org.fudaa.dodico.commun.ProgressionInterface; import org.fudaa.dodico.fichiers.FileFormat; *************** *** 17,20 **** --- 19,23 ---- import org.fudaa.dodico.fichiers.FileWriteOperationAbstract; import org.fudaa.dodico.h2d.H2dEvolution; + import org.fudaa.dodico.h2d.H2dFileFormatEvolutionVersion; import org.fudaa.dodico.h2d.H2dResource; import org.fudaa.dodico.h2d.type.H2dFileFormatType; *************** *** 34,43 **** private CLTransitoireFileFormat() { super(1); ! nom_= "cl transitoire"; extensions_= new String[] { "clv" }; ! ID_= "CL"; description_= H2dResource.getS("Fichier contenant les conditions limites transitoire"); ! mode_= MODE_ASCII; software_= FileFormatSoftware.REFLUX_IS; type_= H2dFileFormatType.COURBE_TRANSITOIRE.getId(); --- 37,46 ---- private CLTransitoireFileFormat() { super(1); ! nom_= DodicoResource.getS("courbes transitoires (preflux, format binaire)"); extensions_= new String[] { "clv" }; ! ID_= "REFLUX_CLV"; description_= H2dResource.getS("Fichier contenant les conditions limites transitoire"); ! mode_= MODE_BINAIRE; software_= FileFormatSoftware.REFLUX_IS; type_= H2dFileFormatType.COURBE_TRANSITOIRE.getId(); *************** *** 56,60 **** return getLastVersionImpl(); } ! public class CLVersion extends FileFormatVersion { public CLVersion() { super(getInstance(), "1.0"); --- 59,63 ---- return getLastVersionImpl(); } ! public class CLVersion extends FileFormatVersion implements H2dFileFormatEvolutionVersion{ public CLVersion() { super(getInstance(), "1.0"); *************** *** 87,90 **** --- 90,102 ---- return new CLVWriter(this); } + /** + * + */ + public FileOperationSynthese readEvolutions( + File _f, + ProgressionInterface _prog) { + return read(_f, _prog); + } + } } Index: CorEleBthFileFormat.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/reflux/io/CorEleBthFileFormat.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** CorEleBthFileFormat.java 11 Dec 2003 12:41:28 -0000 1.10 --- CorEleBthFileFormat.java 19 Dec 2003 12:10:37 -0000 1.11 *************** *** 114,118 **** * */ ! public FileOperationSynthese writeMaillage( File _f, H2dGrid _m, --- 114,118 ---- * */ ! public FileOperationSynthese writeGrid( File _f, H2dGrid _m, Index: INPAdapter.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/reflux/io/INPAdapter.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** INPAdapter.java 25 Nov 2003 10:11:50 -0000 1.10 --- INPAdapter.java 19 Dec 2003 12:10:37 -0000 1.11 *************** *** 32,35 **** --- 32,36 ---- private boolean isVentLecturePasDeTemps_; private boolean isRadiationsLecturePasDeTemps_; + private double timeBeginning_; // private int nbPNTransitoires_; // private int nbCLTransitoires_; *************** *** 293,295 **** --- 294,303 ---- // ptsExtremitesElement_=_ptIdx; // } + /** + * + */ + public double getTimeBeginningForTrans() { + return timeBeginning_; + } + } Index: INPFileFormat.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/reflux/io/INPFileFormat.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** INPFileFormat.java 11 Dec 2003 12:41:28 -0000 1.13 --- INPFileFormat.java 19 Dec 2003 12:10:37 -0000 1.14 *************** *** 486,490 **** * */ ! public FileOperationSynthese writeMaillage( File _f, H2dGrid _m, --- 486,490 ---- * */ ! public FileOperationSynthese writeGrid( File _f, H2dGrid _m, Index: INPWriter.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/reflux/io/INPWriter.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** INPWriter.java 12 Dec 2003 10:30:54 -0000 1.11 --- INPWriter.java 19 Dec 2003 12:10:37 -0000 1.12 *************** *** 913,920 **** out_.doubleField(i, 0d); } ! System.out.println("vale="+viscosityVal.doubleValue()); out_.doubleField(0, viscosityVal.doubleValue()); out_.writeFields(fmt2); ! } out_.println(); --- 913,920 ---- out_.doubleField(i, 0d); } ! System.out.println("vale=" + viscosityVal.doubleValue()); out_.doubleField(0, viscosityVal.doubleValue()); out_.writeFields(fmt2); ! } out_.println(); *************** *** 1037,1041 **** --- 1037,1059 ---- } //cl + Map oldEvolNewEvol= null; + double[] timeStep= null; + double min, max; + min= max= 0; + StringBuffer nameEvolBad= null; if (clTransitoireCourbeList.size() > 0) { + max= + H2dTimeStepGroup.getMaxTime( + _inter.getTimeBeginningForTrans(), + _inter.getGroupePasTemps()); + min= + H2dTimeStepGroup.getMinTime( + _inter.getTimeBeginningForTrans(), + _inter.getGroupePasTemps()); + timeStep= + H2dTimeStepGroup.getTimeStep( + _inter.getTimeBeginningForTrans(), + _inter.getGroupePasTemps()); + oldEvolNewEvol= new HashMap(clTransitoireCourbeList.size() * 2); String ficCl= version_.getCLTransitoireFichier(_inter.getFichiers()); if (ficCl == null) { *************** *** 1045,1051 **** } else { File fic= new File(baseDir_, ficCl); ! System.out.println("write " + fic.getAbsolutePath()); ! H2dEvolution[] evols= new H2dEvolution[clTransitoireCourbeList.size()]; ! clTransitoireCourbeList.toArray(evols); CLVWriter w= version_.createCLVWriter(); analyze_.merge(w.write(evols, fic, progress_).getAnalyze()); --- 1063,1086 ---- } else { File fic= new File(baseDir_, ficCl); ! if (CtuluLib.DEBUG) ! CtuluLib.debug("write " + fic.getAbsolutePath()); ! int n= clTransitoireCourbeList.size(); ! H2dEvolution[] evols= new H2dEvolution[n]; ! for (int i= 0; i < n; i++) { ! H2dEvolution e= (H2dEvolution)clTransitoireCourbeList.get(i); ! if (oldEvolNewEvol.containsKey(e)) { ! evols[i]= (H2dEvolution)oldEvolNewEvol.get(e); ! } else { ! if ((!e.isTimeInclude(min)) || (!e.isTimeInclude(max))) { ! if (nameEvolBad == null) { ! nameEvolBad= new StringBuffer(); ! nameEvolBad.append(e.getNom()); ! } else ! nameEvolBad.append(", ").append(e.getNom()); ! } ! evols[i]= e.createH2dEvolutionFromInterpolation(timeStep); ! oldEvolNewEvol.put(e, evols[i]); ! } ! } CLVWriter w= version_.createCLVWriter(); analyze_.merge(w.write(evols, fic, progress_).getAnalyze()); *************** *** 1054,1057 **** --- 1089,1109 ---- //pn if (pnTransitoireCourbeList.size() > 0) { + if (timeStep == null) { + max= + H2dTimeStepGroup.getMaxTime( + _inter.getTimeBeginningForTrans(), + _inter.getGroupePasTemps()); + min= + H2dTimeStepGroup.getMinTime( + _inter.getTimeBeginningForTrans(), + _inter.getGroupePasTemps()); + timeStep= + H2dTimeStepGroup.getTimeStep( + _inter.getTimeBeginningForTrans(), + _inter.getGroupePasTemps()); + } + if (oldEvolNewEvol == null) { + oldEvolNewEvol= new HashMap(pnTransitoireCourbeList.size()); + } String ficPn= version_.getPnTransitoireFichier(_inter.getFichiers()); if (ficPn == null) { *************** *** 1061,1070 **** } 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()); } } } --- 1113,1146 ---- } else { File fic= new File(baseDir_, ficPn); ! if (CtuluLib.DEBUG) ! CtuluLib.debug("write " + fic.getAbsolutePath()); ! int n= pnTransitoireCourbeList.size(); ! H2dEvolution[] evols= new H2dEvolution[n]; ! for (int i= 0; i < n; i++) { ! H2dEvolution e= (H2dEvolution)pnTransitoireCourbeList.get(i); ! if (oldEvolNewEvol.containsKey(e)) { ! evols[i]= (H2dEvolution)oldEvolNewEvol.get(e); ! } else { ! if ((!e.isTimeInclude(min)) || (!e.isTimeInclude(max))) { ! if (nameEvolBad == null) { ! nameEvolBad= new StringBuffer(); ! nameEvolBad.append(e.getNom()); ! } else ! nameEvolBad.append(", ").append(e.getNom()); ! } ! evols[i]= e.createH2dEvolutionFromInterpolation(timeStep); ! oldEvolNewEvol.put(e, evols[i]); ! } ! } CLVWriter w= version_.createCLVWriter(); analyze_.merge(w.write(evols, fic, progress_).getAnalyze()); } + } + if (nameEvolBad != null) { + analyze_.addError( + H2dResource.getS( + "Les courbes suivantes ne contiennent pas les bornes de la simulation") + + CtuluLib.LINE_SEP + + nameEvolBad.toString()); } } |