You can subscribe to this list here.
| 2003 |
Jan
|
Feb
(89) |
Mar
(219) |
Apr
(82) |
May
(33) |
Jun
(11) |
Jul
(129) |
Aug
(357) |
Sep
(34) |
Oct
(37) |
Nov
(42) |
Dec
(182) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
(59) |
Feb
(74) |
Mar
(196) |
Apr
(205) |
May
(109) |
Jun
(268) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Frederic D. <de...@us...> - 2004-03-31 08:26:48
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/test/geodesie In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9937/src/org/fudaa/dodico/test/geodesie Modified Files: TestJEllipsoide.java TestJLambert.java Log Message: Maj pour solutions initiales Index: TestJEllipsoide.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/test/geodesie/TestJEllipsoide.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TestJEllipsoide.java 5 Mar 2004 15:18:39 -0000 1.1 --- TestJEllipsoide.java 31 Mar 2004 08:14:32 -0000 1.2 *************** *** 29,33 **** */ public void testHauteurNormale() { ! System.out.println("testHauteurNormaleRadian"); double latRad= 0.977384381; double latDeg= latRad * 180 / Math.PI; --- 29,33 ---- */ public void testHauteurNormale() { ! // System.out.println("testHauteurNormaleRadian"); double latRad= 0.977384381; double latDeg= latRad * 180 / Math.PI; *************** *** 42,46 **** */ public void testLatitude() { ! System.out.println("testLatitude"); double latIso= 1.00552653648d; double latRad= 0.872664626; --- 42,46 ---- */ public void testLatitude() { ! // System.out.println("testLatitude"); double latIso= 1.00552653648d; double latRad= 0.872664626; *************** *** 55,59 **** */ public void testLatitudeIso() { ! System.out.println("testLatitudeIso()"); double latRad= 0.872664626; double latDeg= latRad * 180 / Math.PI; --- 55,59 ---- */ public void testLatitudeIso() { ! // System.out.println("testLatitudeIso()"); double latRad= 0.872664626; double latDeg= latRad * 180 / Math.PI; Index: TestJLambert.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/test/geodesie/TestJLambert.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TestJLambert.java 5 Mar 2004 15:18:39 -0000 1.1 --- TestJLambert.java 31 Mar 2004 08:14:32 -0000 1.2 *************** *** 20,24 **** public TestJLambert() { delta_= 1E-2; ! System.out.println("precision 1E-2"); } /** --- 20,24 ---- public TestJLambert() { delta_= 1E-2; ! // System.out.println("precision 1E-2"); } /** *************** *** 54,58 **** double[] r; double[] sortie; ! System.out.println("Changement de projection I"); double lonParis= SysGeodesique.enDegre(2, 20, 14.025); SysGeodesiqueLambert testLambert= --- 54,58 ---- double[] r; double[] sortie; ! // System.out.println("Changement de projection I"); double lonParis= SysGeodesique.enDegre(2, 20, 14.025); SysGeodesiqueLambert testLambert= *************** *** 84,88 **** */ public void testGeoEnLambertII() { ! System.out.println("Changement de projection II"); double lonParis= SysGeodesique.enDegre(2, 20, 14.025); SysGeodesiqueLambert testLambertII= --- 84,88 ---- */ public void testGeoEnLambertII() { ! // System.out.println("Changement de projection II"); double lonParis= SysGeodesique.enDegre(2, 20, 14.025); SysGeodesiqueLambert testLambertII= *************** *** 109,113 **** */ public void testLambertIEnLambertIIEtendu() { ! System.out.println("Changement de projection II etendu"); double lonParis= SysGeodesique.enDegre(2, 20, 14.025); SysGeodesiqueLambert testLambertIIEtendu= --- 109,113 ---- */ public void testLambertIEnLambertIIEtendu() { ! // System.out.println("Changement de projection II etendu"); double lonParis= SysGeodesique.enDegre(2, 20, 14.025); SysGeodesiqueLambert testLambertIIEtendu= |
|
From: Frederic D. <de...@us...> - 2004-03-31 08:26:48
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/ef In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9937/src/org/fudaa/dodico/ef Modified Files: EfGrid.java EfNodeMutable.java Log Message: Maj pour solutions initiales Index: EfGrid.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/ef/EfGrid.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** EfGrid.java 5 Mar 2004 15:18:39 -0000 1.2 --- EfGrid.java 31 Mar 2004 08:14:30 -0000 1.3 *************** *** 8,34 **** */ package org.fudaa.dodico.ef; import gnu.trove.TIntArrayList; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; - import org.fudaa.ctulu.CtuluGeometrie; [...1911 lines suppressed...] _listToFill.ensureCapacity(pts_.length); ! for (int i= 0; i < pts_.length; i++) { _listToFill.ajouteCoord(pts_[i]); } return true; } - } --- 1126,1136 ---- */ public boolean fillListWithPoint(ListMNTPoint _listToFill) { ! if (_listToFill == null) ! return false; _listToFill.ensureCapacity(pts_.length); ! for (int i = 0; i < pts_.length; i++) { _listToFill.ajouteCoord(pts_[i]); } return true; } } Index: EfNodeMutable.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/ef/EfNodeMutable.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** EfNodeMutable.java 12 Feb 2004 15:32:44 -0000 1.1 --- EfNodeMutable.java 31 Mar 2004 08:14:31 -0000 1.2 *************** *** 14,18 **** --- 14,52 ---- */ public class EfNodeMutable extends EfNode { + + + + + /** + * + */ + public EfNodeMutable() { + super(); + } + + /** + * @param _x + * @param _y + * @param _z + */ + public EfNodeMutable(double _x, double _y, double _z) { + super(_x, _y, _z); + } + /** + * @param _p + */ + public EfNodeMutable(EfNode _p) { + super(_p); + } + + /** + * @see org.fudaa.dodico.mnt.MNTPoint#setXYZ(double, double, double) + */ + public void setXYZ(double _x,double _y,double _z){ + x_=_x; + y_=_y; + z_=_z; + } } |
|
From: Frederic D. <de...@us...> - 2004-03-31 08:26:48
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/telemac In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9937/src/org/fudaa/dodico/h2d/telemac Modified Files: H2dTelemacBoundary.java H2dTelemacBcManager.java H2dTelemacBoundaryCondition.java H2dTelemacCLElementSource.java Log Message: Maj pour solutions initiales Index: H2dTelemacBoundaryCondition.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/telemac/H2dTelemacBoundaryCondition.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** H2dTelemacBoundaryCondition.java 11 Dec 2003 12:41:27 -0000 1.3 --- H2dTelemacBoundaryCondition.java 31 Mar 2004 08:14:31 -0000 1.4 *************** *** 8,15 **** */ package org.fudaa.dodico.h2d.telemac; - import org.fudaa.dodico.commun.DodicoLib; - import org.fudaa.dodico.commun.DodicoPermanentList; import org.fudaa.dodico.h2d.H2dBoundaryCondition; - import org.fudaa.dodico.h2d.type.H2dBoundaryType; import org.fudaa.dodico.h2d.type.H2dBcType; import org.fudaa.dodico.h2d.type.H2dVariableType; --- 8,12 ---- *************** *** 23,37 **** double traceurCoefA_; double traceurCoefB_; ! // public static final DodicoPermanentList VARIABLE_LIST= ! // new DodicoPermanentList( ! // DodicoLib.sort( ! // new H2dVariableType[] { ! // H2dVariableType.COTE_EAU, ! // H2dVariableType.VITESSE_U, ! // H2dVariableType.VITESSE_V, ! // H2dVariableType.TRACEUR, ! // H2dVariableType.TRACEUR_COEF_A, ! // H2dVariableType.TRACEUR_COEF_B, ! // H2dVariableType.RUGOSITE })); /** * --- 20,24 ---- double traceurCoefA_; double traceurCoefB_; ! /** * *************** *** 134,138 **** */ protected boolean setValue(H2dVariableType _variable, double _d) { ! if (_variable == H2dVariableType.COTE_EAU) return setH(_d); else if (_variable == H2dVariableType.VITESSE_U) --- 121,125 ---- */ protected boolean setValue(H2dVariableType _variable, double _d) { ! if (_variable == H2dVariableType.HAUTEUR_EAU) return setH(_d); else if (_variable == H2dVariableType.VITESSE_U) Index: H2dTelemacCLElementSource.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/telemac/H2dTelemacCLElementSource.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** H2dTelemacCLElementSource.java 25 Nov 2003 10:11:37 -0000 1.3 --- H2dTelemacCLElementSource.java 31 Mar 2004 08:14:31 -0000 1.4 *************** *** 8,13 **** */ package org.fudaa.dodico.h2d.telemac; - import org.fudaa.dodico.h2d.type.H2dBoundaryType; import org.fudaa.dodico.h2d.type.H2dBcType; /** * @author deniger --- 8,13 ---- */ package org.fudaa.dodico.h2d.telemac; import org.fudaa.dodico.h2d.type.H2dBcType; + import org.fudaa.dodico.h2d.type.H2dBoundaryType; /** * @author deniger Index: H2dTelemacBoundary.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/telemac/H2dTelemacBoundary.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** H2dTelemacBoundary.java 12 Dec 2003 10:30:54 -0000 1.4 --- H2dTelemacBoundary.java 31 Mar 2004 08:14:31 -0000 1.5 *************** *** 145,149 **** H2dVariableType.TRACEUR_COEF_A, H2dVariableType.TRACEUR_COEF_B, ! H2dVariableType.COTE_EAU })); } else if (_v.isFlowrateComputeFromVelocities(opt)) { return new DodicoPermanentList( --- 145,149 ---- H2dVariableType.TRACEUR_COEF_A, H2dVariableType.TRACEUR_COEF_B, ! H2dVariableType.HAUTEUR_EAU })); } else if (_v.isFlowrateComputeFromVelocities(opt)) { return new DodicoPermanentList( *************** *** 192,196 **** (AvailableVariable)def); vs= new H2dVariableType[1]; ! vs[0]= H2dVariableType.COTE_EAU; def= new AvailableVariableDefault(vs, vs); BORD_TYPE_VARIABLE_ACCEPTED.put( --- 192,196 ---- (AvailableVariable)def); vs= new H2dVariableType[1]; ! vs[0]= H2dVariableType.HAUTEUR_EAU; def= new AvailableVariableDefault(vs, vs); BORD_TYPE_VARIABLE_ACCEPTED.put( *************** *** 198,202 **** vs= new H2dVariableType[] { ! H2dVariableType.COTE_EAU, H2dVariableType.VITESSE_U, H2dVariableType.VITESSE_V }; --- 198,202 ---- vs= new H2dVariableType[] { ! H2dVariableType.HAUTEUR_EAU, H2dVariableType.VITESSE_U, H2dVariableType.VITESSE_V }; Index: H2dTelemacBcManager.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/telemac/H2dTelemacBcManager.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** H2dTelemacBcManager.java 12 Feb 2004 15:32:45 -0000 1.6 --- H2dTelemacBcManager.java 31 Mar 2004 08:14:31 -0000 1.7 *************** *** 26,29 **** --- 26,30 ---- import org.fudaa.dodico.commun.DodicoPermanentList; import org.fudaa.dodico.commun.ProgressionInterface; + import org.fudaa.dodico.commun.ProgressionUpdater; import org.fudaa.dodico.dico.DicoEntite; import org.fudaa.dodico.dico.DicoParams; *************** *** 759,770 **** //le nb de frontiere int n= frontiere.getNbFrontier(); ! int pourc= 0; ! if (_inter != null) { ! _inter.setProgression(pourc); ! } ! int step= DodicoLib.getStep(n); ! int pas= (int) (n / step); ! int pMax= pas; ! int pourcStep= (int) (50 / step); H2dBoundaryType bordType; boolean tracerTypeIsConstant= true; --- 760,768 ---- //le nb de frontiere int n= frontiere.getNbFrontier(); ! ! ProgressionUpdater up=new ProgressionUpdater(_inter); ! up.setValue(4,n); ! up.majAvancement(); ! H2dBoundaryType bordType; boolean tracerTypeIsConstant= true; *************** *** 958,968 **** } bordByFrontier[i]= r.createTelemacBordParFr(bords, clFrontier, i); ! if (_inter != null) { ! if (i > pMax) { ! pourc += pourcStep; ! _inter.setProgression(pourc); ! pMax += pas; ! } ! } } r.setFrontier(bordByFrontier); --- 956,960 ---- } bordByFrontier[i]= r.createTelemacBordParFr(bords, clFrontier, i); ! up.majAvancement(); } r.setFrontier(bordByFrontier); |
|
From: Frederic D. <de...@us...> - 2004-03-31 08:26:48
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/test/telemac In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9937/src/org/fudaa/dodico/test/telemac Modified Files: TestJSinusx.java Log Message: Maj pour solutions initiales Index: TestJSinusx.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/test/telemac/TestJSinusx.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TestJSinusx.java 5 Mar 2004 15:18:24 -0000 1.1 --- TestJSinusx.java 31 Mar 2004 08:14:31 -0000 1.2 *************** *** 24,27 **** --- 24,28 ---- import org.fudaa.dodico.mnt.MNTZone; import org.fudaa.dodico.telemac.io.SinusxFileFormat; + import org.fudaa.dodico.test.TestIO; /** * @version $Id$ *************** *** 105,108 **** --- 106,110 ---- File initFile= getFile(testLectureFic_); assertNotNull(initFile); + assertTrue(initFile.exists()); MNTZone[] zones= lecture(initFile); assertNotNull(zones); *************** *** 127,134 **** */ public File getFile(String _f) { ! URL url= getClass().getResource(_f); ! if (url == null) ! return null; ! return new File(url.getPath()); } --- 129,133 ---- */ public File getFile(String _f) { ! return TestIO.getFile(getClass(),_f); } |
|
From: Frederic D. <de...@us...> - 2004-03-31 08:26:47
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/test/reflux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9937/src/org/fudaa/dodico/test/reflux Modified Files: TestJSolution.java Log Message: Maj pour solutions initiales Index: TestJSolution.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/test/reflux/TestJSolution.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TestJSolution.java 16 Mar 2004 16:47:29 -0000 1.2 --- TestJSolution.java 31 Mar 2004 08:14:30 -0000 1.3 *************** *** 23,26 **** --- 23,28 ---- import org.fudaa.dodico.reflux.io.RefluxSolutionFileFormat; import org.fudaa.dodico.reflux.io.RefluxSolutionInitFileFormat; + import org.fudaa.dodico.reflux.io.RefluxSolutionInitReader; + import org.fudaa.dodico.reflux.io.RefluxSolutionInitWriter; import org.fudaa.dodico.reflux.io.RefluxSolutionReader; import org.fudaa.dodico.test.TestIO; *************** *** 101,108 **** assertEquals(0.28601E+01, si.getSolutionInitiale(H2dVariableType.VITESSE_U, 0), eps_); assertEquals(-0.35025E-15, si.getSolutionInitiale(H2dVariableType.VITESSE_V, 0), eps_); ! assertEquals(0.13250E+01, si.getSolutionInitiale(H2dVariableType.COTE_EAU, 0), eps_); assertEquals(0.28821E+01, si.getSolutionInitiale(H2dVariableType.VITESSE_U, 1766), eps_); assertEquals(0.24951E-06, si.getSolutionInitiale(H2dVariableType.VITESSE_V, 1766), eps_); ! assertEquals(0.13710E+01, si.getSolutionInitiale(H2dVariableType.COTE_EAU, 1766), eps_); } --- 103,110 ---- assertEquals(0.28601E+01, si.getSolutionInitiale(H2dVariableType.VITESSE_U, 0), eps_); assertEquals(-0.35025E-15, si.getSolutionInitiale(H2dVariableType.VITESSE_V, 0), eps_); ! assertEquals(0.13250E+01, si.getSolutionInitiale(H2dVariableType.HAUTEUR_EAU, 0), eps_); assertEquals(0.28821E+01, si.getSolutionInitiale(H2dVariableType.VITESSE_U, 1766), eps_); assertEquals(0.24951E-06, si.getSolutionInitiale(H2dVariableType.VITESSE_V, 1766), eps_); ! assertEquals(0.13710E+01, si.getSolutionInitiale(H2dVariableType.HAUTEUR_EAU, 1766), eps_); } *************** *** 136,147 **** lu = (double[]) RefluxSolutionInitFileFormat.getInstance().getLastVersionInstance().read(sivT, null).getSource(); ! H2dRefluxSICourant2D si2D = (H2dRefluxSICourant2D) H2dRefluxSICourant2D.loadSI(g, sivT, null) .getSource(); assertNotNull(si2D); File temp = createTempFile(); ! op = si2D.writeSI(g, temp, null); assertFalse(op.containsFatalError()); assertTrue(Arrays.equals(lu, (double[]) op.getSource())); ! H2dRefluxSICourant2D si2Dbis = (H2dRefluxSICourant2D) H2dRefluxSICourant2D .loadSI(g, temp, null) .getSource(); --- 138,149 ---- lu = (double[]) RefluxSolutionInitFileFormat.getInstance().getLastVersionInstance().read(sivT, null).getSource(); ! H2dRefluxSICourant2D si2D = (H2dRefluxSICourant2D) RefluxSolutionInitReader.loadSI(g, sivT, null) .getSource(); assertNotNull(si2D); File temp = createTempFile(); ! op = RefluxSolutionInitWriter.writeSI(g,si2D.createWriterInterface(g),temp, null); assertFalse(op.containsFatalError()); assertTrue(Arrays.equals(lu, (double[]) op.getSource())); ! H2dRefluxSICourant2D si2Dbis = (H2dRefluxSICourant2D) RefluxSolutionInitReader .loadSI(g, temp, null) .getSource(); *************** *** 150,157 **** } - - - - /** * @see org.fudaa.dodico.test.TestIO#testEcriture() --- 152,155 ---- *************** *** 159,161 **** --- 157,160 ---- public void testEcriture() { } + } |
|
From: Frederic D. <de...@us...> - 2004-03-31 08:26:47
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/reflux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9937/src/org/fudaa/dodico/h2d/reflux Modified Files: H2dRefluxSICourant2D.java H2dRefluxSolutionInitialeInterface.java H2dRefluxParameters.java H2dRefluxProjectDispatcherListener.java Added Files: H2dRefluxSolutionInit2DWriterInterface.java Log Message: Maj pour solutions initiales --- NEW FILE: H2dRefluxSolutionInit2DWriterInterface.java --- /* * @file H2dRefluxSolutionInit2DInterface.java * @creation 23 mars 2004 * @modification $Date: 2004/03/31 08:14:29 $ * @license GNU General Public License 2 * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne * @mail fud...@li... */ package org.fudaa.dodico.h2d.reflux; /** * @author Fred Deniger * @version $Id: H2dRefluxSolutionInit2DWriterInterface.java,v 1.1 2004/03/31 08:14:29 deniger Exp $ */ public interface H2dRefluxSolutionInit2DWriterInterface { /** * @return le nombre de point considere */ public int getNbPt(); /** * @param _idx * @return le vitesse u */ public double getU(int _idx); /** * @param _idx l'indice du point * @return la vitesse v au point donne */ public double getV(int _idx); /** * Doit donner la hauteur d'eau correcte au point (point transit,...) * @param _idx * @return la hauteur d'eau au point */ public double getH(int _idx); } Index: H2dRefluxSICourant2D.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/reflux/H2dRefluxSICourant2D.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** H2dRefluxSICourant2D.java 19 Mar 2004 17:40:17 -0000 1.3 --- H2dRefluxSICourant2D.java 31 Mar 2004 08:14:29 -0000 1.4 *************** *** 9,21 **** package org.fudaa.dodico.h2d.reflux; ! import java.io.File; import java.util.Arrays; import org.fudaa.dodico.commun.ProgressionInterface; import org.fudaa.dodico.commun.ProgressionUpdater; import org.fudaa.dodico.ef.EfElement; import org.fudaa.dodico.ef.EfGrid; ! import org.fudaa.dodico.fichiers.FileOperationSynthese; import org.fudaa.dodico.h2d.type.H2dVariableType; - import org.fudaa.dodico.reflux.io.RefluxSolutionInitFileFormat; --- 9,28 ---- package org.fudaa.dodico.h2d.reflux; ! import gnu.trove.TIntDoubleHashMap; ! import gnu.trove.TIntDoubleIterator; ! import gnu.trove.TIntProcedure; ! import java.util.Arrays; + + import org.fudaa.ctulu.CtuluLib; + import org.fudaa.dodico.commun.DodicoAnalyze; + import org.fudaa.dodico.commun.DodicoCommand; + import org.fudaa.dodico.commun.DodicoResource; import org.fudaa.dodico.commun.ProgressionInterface; import org.fudaa.dodico.commun.ProgressionUpdater; import org.fudaa.dodico.ef.EfElement; import org.fudaa.dodico.ef.EfGrid; ! import org.fudaa.dodico.ef.EfNode; import org.fudaa.dodico.h2d.type.H2dVariableType; *************** *** 24,32 **** * @version $id$ */ ! public class H2dRefluxSICourant2D implements H2dRefluxSolutionInitialeInterface { ! double[] u_; ! double[] v_; ! double[] h_; /** --- 31,96 ---- * @version $id$ */ ! public class H2dRefluxSICourant2D implements H2dRefluxSolutionInitialeInterface ! { ! /** ! * L'interface permettant de sauvegarder les si. ! * ! * @author Fred Deniger ! * @version $Id$ ! */ ! private class Courant2DWriterInterface implements H2dRefluxSolutionInit2DWriterInterface { ! EfGrid g_; ! ! boolean[] transit_; ! ! /** ! * @param _g le maillage associe ! */ ! public Courant2DWriterInterface(EfGrid _g) { ! transit_ = H2dRefluxSICourant2D.this.getNoeudsTransit(h_, _g); ! g_ = _g; ! } ! ! /** ! * @see org.fudaa.dodico.h2d.reflux.H2dRefluxSolutionInit2DWriterInterface#getH(int) ! */ ! public double getH(int _idx) { ! double r = h_[_idx]; ! if (r < 0) return 0d; ! if (!transit_[_idx] && r < 0.) { ! return 0; ! } ! else ! return r; ! } ! ! /** ! * @see org.fudaa.dodico.h2d.reflux.H2dRefluxSolutionInit2DWriterInterface#getNbPt() ! */ ! public int getNbPt() { ! return h_.length; ! } ! ! /** ! * @see org.fudaa.dodico.h2d.reflux.H2dRefluxSolutionInit2DWriterInterface#getU(int) ! */ ! public double getU(int _idx) { ! return u_[_idx]; ! } ! ! /** ! * @see org.fudaa.dodico.h2d.reflux.H2dRefluxSolutionInit2DWriterInterface#getV(int) ! */ ! public double getV(int _idx) { ! return v_[_idx]; ! } ! } ! ! double[] h_; ! private boolean isModified_; ! H2dRefluxProjectDispatcherListener listener_; ! double[] u_; ! double[] v_; /** *************** *** 48,51 **** --- 112,308 ---- } } + + + /** + * @param _g le maillage correspondant + * @param _coteEau la nouvelle cote d'eau + * @param _a le receveur pour les messages de l'operation + * @param _prog la barre de progression + * @return la commande si modif.Null sinon + */ + public DodicoCommand initFromCoteEau(final EfGrid _g,final double _coteEau,DodicoAnalyze _a,ProgressionInterface _prog){ + final double[] oldH=CtuluLib.copy(h_); + final double[] oldU=CtuluLib.copy(u_); + final double[] oldV=CtuluLib.copy(v_); + if(initFromCoteEauAction(_g,_coteEau,_a,_prog)){ + setModified(); + return new DodicoCommand(){ + + /** + * @see org.fudaa.dodico.commun.DodicoCommand#redo() + */ + public void redo() { + initFromCoteEauAction(_g,_coteEau,null,null); + setModified(); + } + + + /** + * @see org.fudaa.dodico.commun.DodicoCommand#undo() + */ + public void undo() { + u_=oldU; + v_=oldV; + h_=oldH; + setModified(); + } + }; + } + return null; + } + + /** + * @param _g le maillage en question + * @param _coteEau la nouvelle cote d'eau + * @param _a le receveur pour les messages + * @param _prog la barre de progression + * @return true si changement + */ + public boolean initFromCoteEauAction(EfGrid _g,double _coteEau,DodicoAnalyze _a,ProgressionInterface _prog){ + boolean r=false; + if(_g.getPtsNb()!=h_.length){ + _a.addFatalError(DodicoResource.getS("Non compatible")); + return r; + } + ProgressionUpdater up=new ProgressionUpdater(_prog); + up.setValue(4,h_.length,0,80); + for(int i=h_.length-1;i>=0;i--){ + double newH=_coteEau-_g.getPt(i).getZ(); + if(h_[i]!=newH){ + h_[i]=newH; + r=true; + } + if(u_[i]!=0){ + u_[i]=0; + r=true; + } + if(v_[i]!=0){ + v_[i]=0; + r=true; + } + up.majAvancement(); + } + return r; + } + + + /** + * Initialise u,v,h a partir du plan n1,n2,n3 et renvoie true si modi + * + * @param _g le maillage + * @param _n1 point 1 du plan + * @param _n2 point 2 du plan + * @param _n3 point 3 du plan + * @return true si modif. + */ + protected boolean initFromPlanAction(final EfGrid _g, final EfNode _n1, final EfNode _n2, + final EfNode _n3,ProgressionInterface _prog) { + boolean changed = false; + double penteX = getPenteXPlanSI(_n1, _n2, _n3); + double penteY = getPenteYPlanSI(_n1, _n2, _n3); + if(_prog!=null) _prog.setProgression(30); + for (int i = 0; i < h_.length; i++) { + EfNode pt = _g.getPt(i); + double nh = + penteX * (pt.getX() - _n1.getX()) + + penteY * (pt.getY() - _n1.getY()) + + _n1.getZ() + - pt.getZ(); + if (nh != h_[i]) { + h_[i] = nh; + changed = true; + } + } + if(_prog!=null) _prog.setProgression(30); + boolean[] nTransit = getNoeudsTransit(h_, _g); + if(_prog!=null) _prog.setProgression(50); + double sss = Math.sqrt(penteX * penteX + penteY * penteY); + // Si la pente sur X et Y est nulle => Vitesses nulles + if (sss < 1.e-10) { + for (int i = h_.length - 1; i >= 0; i--) { + if (u_[i] != 0) { + u_[i] = 0; + changed = true; + } + if (v_[i] != 0) { + changed = true; + v_[i] = 0; + } + } + } + // Si la pente est differente de 0 + else { + for (int i = h_.length - 1; i >= 0; i--) { + // Noeud de transit ou noeud sec => vitesses nulles + if (nTransit[i] || h_[i] <= 0.) { + if (u_[i] != 0) { + changed = true; + u_[i] = 0; + } + if (v_[i] != 0) { + changed = true; + v_[i] = 0; + } + } + // Noeud mouille + else { + double nv = -penteX * Math.sqrt(h_[i] / sss) * 50.; + if (u_[i] != nv) { + changed = true; + u_[i] = nv; + } + nv = -penteY * Math.sqrt(h_[i] / sss) * 50.; + if (v_[i] != nv) { + changed = true; + v_[i] = nv; + } + } + } + } + if(_prog!=null) _prog.setProgression(70); + return changed; + } + + protected void setModified() { + isModified_ = true; + if (listener_ != null) listener_.InitSolutionsChanged(); + } + + /** + * @param _g le maillage associe + * @return une interface pour l'ecriture des solutions initiales + */ + public H2dRefluxSolutionInit2DWriterInterface createWriterInterface(EfGrid _g) { + return new Courant2DWriterInterface(_g); + } + + /** + * @see org.fudaa.dodico.h2d.reflux.H2dRefluxSolutionInitialeInterface#getCopyOf(org.fudaa.dodico.h2d.type.H2dVariableType) + */ + public double[] getCopyOf(H2dVariableType _t) { + if (_t == H2dVariableType.HAUTEUR_EAU) + return CtuluLib.copy(h_); + else if (_t == H2dVariableType.VITESSE_U) + return CtuluLib.copy(u_); + else if (_t == H2dVariableType.VITESSE_V) + return CtuluLib.copy(v_); + else return null; + } + + /** + * @see org.fudaa.dodico.h2d.reflux.H2dRefluxSolutionInitialeInterface#getH(int) + */ + public double getH(int _idx) { + return h_[_idx]; + } + + + /** + * @return Returns the listener. + */ + public H2dRefluxProjectDispatcherListener getListener() { + return listener_; + } + /** *************** *** 56,82 **** } /** ! * @see org.fudaa.dodico.h2d.reflux.H2dRefluxSolutionInitialeInterface#isValideVariable(org.fudaa.dodico.h2d.type.H2dVariableType) */ ! public boolean isValideVariable(H2dVariableType _t) { ! return (_t == H2dVariableType.VITESSE_U) || (_t == H2dVariableType.VITESSE_V) ! || (_t == H2dVariableType.COTE_EAU); } /** ! * @see org.fudaa.dodico.h2d.reflux.H2dRefluxSolutionInitialeInterface#getSolutionInitiale(org.fudaa.dodico.h2d.type.H2dVariableType, ! * int) */ ! public double getSolutionInitiale(H2dVariableType _t, int _idx) { ! if (_t == H2dVariableType.VITESSE_U) ! return u_[_idx]; ! else if (_t == H2dVariableType.VITESSE_V) { ! return v_[_idx]; ! } ! else if (_t == H2dVariableType.COTE_EAU) { ! return h_[_idx]; ! } ! new Throwable().printStackTrace(); ! return 0d; } --- 313,389 ---- } + + /** ! * Determination des noeuds de transit. Si au moins 1 des noeuds de l'element est mouille et au ! * moins 1 est sec => Element de transit. Les noeuds non mouilles sont transit ! * ! * @param _hts Hauteurs totales sur les noeuds. ! * @param _g le maillage concerné ! * @return <i>true </i> noeud de transit, <i>false </i> sinon. */ ! public boolean[] getNoeudsTransit(double[] _hts, EfGrid _g) { ! boolean[] nTrs; ! boolean[] nSecs = new boolean[3]; ! nTrs = new boolean[_g.getPtsNb()]; ! for (int i = _g.getEltNb() - 1; i >= 0; i--) { ! EfElement el = _g.getElement(i); ! // Etat des noeuds de coins (sec/mouille) ! for (int j = 0; j < 3; j++) { ! // int iNd= ((Integer)hnd2Ind.get(ndsEl[j])).intValue(); ! nSecs[j] = _hts[el.getPtIndex(j)] <= 0.; ! } ! // Un des noeuds de coin n'est pas dans le meme etat => Element de ! // transit ! for (int j = 0; j < 2; j++) { ! if (nSecs[j] == nSecs[j + 1]) ! continue; ! // Noeuds transit ! nTrs[el.getPtIndex((j * 2 + 5) % 6)] = true; ! nTrs[el.getPtIndex(j * 2)] = true; ! nTrs[el.getPtIndex(j * 2 + 3)] = true; ! break; ! } ! } ! return nTrs; } + /** ! * @param _n1 le point 1 ! * @param _n2 le point 2 ! * @param _n3 le point 3 ! * @return la pente selon x */ ! ! public double getPenteXPlanSI(EfNode _n1, EfNode _n2, EfNode _n3) { ! return ! -( ! (_n2.getY() - _n1.getY()) * (_n3.getZ() - _n1.getZ()) ! - (_n2.getZ() - _n1.getZ()) * (_n3.getY() - _n1.getY())) ! / ((_n2.getX() - _n1.getX()) * (_n3.getY() - _n1.getY()) ! - (_n2.getY() - _n1.getY()) * (_n3.getX() - _n1.getX())); ! } ! ! /** ! * @param _n1 le point 1 ! * @param _n2 le point 2 ! * @param _n3 le point 3 ! * @return la pente selon y ! */ ! public double getPenteYPlanSI(EfNode _n1, EfNode _n2, EfNode _n3) { ! return ! ((_n2.getX() - _n1.getX()) * (_n3.getZ() - _n1.getZ()) ! - (_n2.getZ() - _n1.getZ()) * (_n3.getX() - _n1.getX())) ! / ((_n2.getX() - _n1.getX()) * (_n3.getY() - _n1.getY()) ! - (_n2.getY() - _n1.getY()) * (_n3.getX() - _n1.getX())); ! } ! ! /** ! * @param _idx ! * @return solution initiale pour h ! */ ! public double getSIForH(int _idx) { ! return h_[_idx]; } *************** *** 98,219 **** /** ! * @param _idx ! * @return solution initiale pour h */ ! public double getSIForH(int _idx) { ! return h_[_idx]; } ! public boolean isEquiv(H2dRefluxSICourant2D _d) { ! return Arrays.equals(u_, _d.u_) && Arrays.equals(v_, _d.v_) && Arrays.equals(h_, _d.h_); } /** ! * @param _g le maillage associé ! * @param _f le fichier siv a lire ! * @param _prog la barre de progression ! * @return la synthese contenant une instance de H2dRefluxSICourant2D */ ! public static FileOperationSynthese loadSI(EfGrid _g, File _f, ProgressionInterface _prog) { ! FileOperationSynthese init = RefluxSolutionInitFileFormat.getInstance() ! .getLastVersionInstance().read(_f, _prog); ! if (init.containsFatalError()) { ! init.setSource(null); ! return init; ! } ! double[] vals = (double[]) init.getSource(); ! double[][] si = new double[3][_g.getPtsNb()]; ! int idxDone = 0; ! int nbPt = _g.getPtsNb(); ! boolean[] done = new boolean[nbPt]; ! boolean[] isMiddle = new boolean[nbPt]; ! int temp; ! boolean isIdxMiddle; ! for (int i = _g.getEltNb() - 1; (i >= 0) && (idxDone < nbPt); i--) { ! EfElement elt = _g.getElement(i); ! isIdxMiddle = true; ! for (int j = elt.getPtNb() - 1; j >= 0; j--) { ! temp = elt.getPtIndex(j); ! if (!done[temp]) { ! idxDone++; ! done[temp] = true; ! isMiddle[temp] = isIdxMiddle; } ! isIdxMiddle = !isIdxMiddle; ! } } ! if (_prog != null) _prog.setProgression(30); ! int idxInVal = 0; ! idxDone = 0; ! temp = vals.length; ! ProgressionUpdater up = new ProgressionUpdater(_prog); ! up.setValue(3, nbPt, 30, 70); ! up.majProgessionStateOnly(); ! while (idxInVal < temp) { ! si[0][idxDone] = vals[idxInVal++]; ! si[1][idxDone] = vals[idxInVal++]; ! if (!isMiddle[idxDone]) { ! si[2][idxDone] = vals[idxInVal++]; } - up.majAvancement(); - idxDone++; } ! init.setSource(new H2dRefluxSICourant2D(si[0], si[1], si[2])); ! return init; } /** ! * @param _g le maillage associe ! * @param _f le fichier de dest ! * @param _prog la progression ! * @return la synthese de l'ecriture contenant le tableau de double generee comme source */ ! public FileOperationSynthese writeSI(EfGrid _g, File _f, ProgressionInterface _prog) { ! int idxDone = 0; ! int nbPt = _g.getPtsNb(); ! double[] vals = new double[nbPt * 3]; ! boolean[] done = new boolean[nbPt]; ! boolean[] isMiddle = new boolean[nbPt]; ! int temp; ! boolean isIdxMiddle; ! for (int i = _g.getEltNb() - 1; (i >= 0) && (idxDone < nbPt); i--) { ! EfElement elt = _g.getElement(i); ! isIdxMiddle = true; ! for (int j = elt.getPtNb() - 1; j >= 0; j--) { ! temp = elt.getPtIndex(j); ! if (!done[temp]) { ! idxDone++; ! done[temp] = true; ! isMiddle[temp] = isIdxMiddle; ! } ! isIdxMiddle = !isIdxMiddle; } } ! if (_prog != null) _prog.setProgression(30); ! int idxInVal = 0; ! idxDone = 0; ! temp = vals.length; ! ProgressionUpdater up = new ProgressionUpdater(_prog); ! up.setValue(3, nbPt, 30, 70); ! up.majProgessionStateOnly(); ! for (int i = 0; i < nbPt; i++) { ! vals[idxInVal++] = u_[i]; ! vals[idxInVal++] = v_[i]; ! if (!isMiddle[i]) { ! vals[idxInVal++] = h_[i]; ! } } ! double[] fvals = new double[idxInVal]; ! System.arraycopy(vals, 0, fvals, 0, fvals.length); ! return RefluxSolutionInitFileFormat.getInstance().getLastVersionInstance().write(_f, fvals, ! _prog); } /** ! * @see org.fudaa.dodico.h2d.reflux.H2dRefluxSolutionInitialeInterface#getVariables() */ ! public H2dVariableType[] getVariables() { ! return new H2dVariableType[] { H2dVariableType.VITESSE_U, H2dVariableType.VITESSE_V, ! H2dVariableType.COTE_EAU}; } } --- 405,637 ---- /** ! * @see org.fudaa.dodico.h2d.reflux.H2dRefluxSolutionInitialeInterface#getSolutionInitiale(org.fudaa.dodico.h2d.type.H2dVariableType, ! * int) */ ! public double getSolutionInitiale(H2dVariableType _t, int _idx) { ! if (_t == H2dVariableType.VITESSE_U) ! return u_[_idx]; ! else if (_t == H2dVariableType.VITESSE_V) { ! return v_[_idx]; ! } ! else if (_t == H2dVariableType.HAUTEUR_EAU) { ! return h_[_idx]; ! } ! new Throwable().printStackTrace(); ! return 0d; } ! ! ! /** ! * @see org.fudaa.dodico.h2d.reflux.H2dRefluxSolutionInitialeInterface#getVariables() ! */ ! public H2dVariableType[] getVariables() { ! return new H2dVariableType[] { H2dVariableType.VITESSE_U, H2dVariableType.VITESSE_V, ! H2dVariableType.HAUTEUR_EAU}; } + /** ! * @see org.fudaa.dodico.h2d.reflux.H2dRefluxSolutionInitialeInterface#initFromPlan(org.fudaa.dodico.ef.EfGrid, org.fudaa.dodico.ef.EfNode, org.fudaa.dodico.ef.EfNode, org.fudaa.dodico.ef.EfNode, org.fudaa.dodico.commun.ProgressionInterface) */ ! public DodicoCommand initFromPlan(final EfGrid _g, final EfNode _n1, final EfNode _n2, ! final EfNode _n3,ProgressionInterface _prog) { ! //sauvegarde pour undo ! final double[] uOld = new double[u_.length]; ! final double[] vOld = new double[v_.length]; ! final double[] hOld = new double[h_.length]; ! System.arraycopy(u_, 0, uOld, 0, u_.length); ! System.arraycopy(v_, 0, vOld, 0, v_.length); ! System.arraycopy(h_, 0, hOld, 0, h_.length); ! boolean changed = initFromPlanAction(_g, _n1, _n2, _n3,_prog); ! //si modif ! if (changed) { ! isModified_ = true; ! if (listener_ != null) ! listener_.InitSolutionsChanged(); ! return new DodicoCommand() { ! ! /** ! * @see org.fudaa.dodico.commun.DodicoCommand#redo() ! */ ! public void redo() { ! H2dRefluxSICourant2D.this.initFromPlanAction(_g, _n1, _n2, _n3,null); ! if (listener_ != null) ! listener_.InitSolutionsChanged(); } ! ! /** ! * @see org.fudaa.dodico.commun.DodicoCommand#undo() ! */ ! public void undo() { ! u_ = uOld; ! v_ = vOld; ! h_ = hOld; ! if (listener_ != null) ! listener_.InitSolutionsChanged(); ! } ! }; } ! return null; ! } ! ! ! ! /** ! * @see org.fudaa.dodico.h2d.reflux.H2dRefluxSolutionInitialeInterface#initFromSI(org.fudaa.dodico.h2d.reflux.H2dRefluxSolutionInitialeInterface, org.fudaa.dodico.commun.DodicoAnalyze) ! */ ! public DodicoCommand initFromSI(H2dRefluxSolutionInitialeInterface _interface, DodicoAnalyze _a) { ! if (_interface.isValideVariable(H2dVariableType.HAUTEUR_EAU) ! && _interface.isValideVariable(H2dVariableType.VITESSE_U) ! && _interface.isValideVariable(H2dVariableType.VITESSE_V)) { ! boolean changed = false; ! final double[] newU = _interface.getCopyOf(H2dVariableType.VITESSE_U); ! if (newU.length != u_.length) { ! System.out.println(newU.length); ! System.out.println(u_.length); ! _a.addFatalError(DodicoResource.getS("Non compatible")); ! return null; ! } ! if (!changed) { ! changed = !Arrays.equals(newU, u_); ! } ! final double[] newV = _interface.getCopyOf(H2dVariableType.VITESSE_V); ! if (!changed) { ! changed = !Arrays.equals(newV, v_); ! } ! final double[] newH = _interface.getCopyOf(H2dVariableType.HAUTEUR_EAU); ! if (!changed) { ! changed = !Arrays.equals(newH, h_); ! } ! if (changed) { ! setModified(); ! final double[] oldU = u_; ! final double[] oldV = v_; ! final double[] oldH = h_; ! u_ = newU; ! v_ = newV; ! h_ = newH; ! return new DodicoCommand() { ! ! /** ! * @see org.fudaa.dodico.commun.DodicoCommand#redo() ! */ ! public void redo() { ! u_ = newU; ! v_ = newV; ! h_ = newH; ! setModified(); ! } ! ! /** ! * @see org.fudaa.dodico.commun.DodicoCommand#undo() ! */ ! public void undo() { ! u_ = oldU; ! v_ = oldV; ! h_ = oldH; ! setModified(); ! } ! }; ! } ! else { ! if (CtuluLib.DEBUG) CtuluLib.debug("si not modified"); ! return null; } } ! else { ! _a.addFatalError(DodicoResource.getS("Non compatible")); ! return null; ! } } /** ! * @see org.fudaa.dodico.h2d.reflux.H2dRefluxSolutionInitialeInterface#initH(int[]) */ ! /** ! * @see org.fudaa.dodico.h2d.reflux.H2dRefluxSolutionInitialeInterface#initH(int[]) ! */ ! public DodicoCommand initH(int[] _idx) { ! if (_idx == null) return null; ! final TIntDoubleHashMap m = new TIntDoubleHashMap(_idx.length); ! int idxE; ! for (int i = _idx.length - 1; i >= 0; i--) { ! idxE = _idx[i]; ! double old = h_[idxE]; ! if (old != 0) { ! h_[idxE] = 0; ! m.put(idxE, old); } } ! if (m.size() > 0) { ! setModified(); ! return new DodicoCommand() { ! ! /** ! * @see org.fudaa.dodico.commun.DodicoCommand#redo() ! */ ! public void redo() { ! m.forEachKey(new TIntProcedure() { ! ! public boolean execute(int _arg0) { ! h_[_arg0] = 0; ! return true; ! } ! }); ! setModified(); ! } ! ! ! /** ! * @see org.fudaa.dodico.commun.DodicoCommand#undo() ! */ ! public void undo() { ! TIntDoubleIterator it = m.iterator(); ! for (int i = m.size(); i-- > 0;) { ! it.advance(); ! h_[it.key()] = it.value(); ! } ! setModified(); ! } ! }; } ! return null; } /** ! * @param _d ! * @return */ ! public boolean isEquiv(H2dRefluxSICourant2D _d) { ! return Arrays.equals(u_, _d.u_) && Arrays.equals(v_, _d.v_) && Arrays.equals(h_, _d.h_); ! } ! ! /** ! * @see org.fudaa.dodico.h2d.reflux.H2dRefluxSolutionInitialeInterface#isModified() ! */ ! public boolean isModified() { ! return isModified_; ! } ! ! /** ! * @see org.fudaa.dodico.h2d.reflux.H2dRefluxSolutionInitialeInterface#isValideVariable(org.fudaa.dodico.h2d.type.H2dVariableType) ! */ ! public boolean isValideVariable(H2dVariableType _t) { ! return (_t == H2dVariableType.VITESSE_U) || (_t == H2dVariableType.VITESSE_V) ! || (_t == H2dVariableType.HAUTEUR_EAU); ! } ! ! /** ! * @see org.fudaa.dodico.h2d.reflux.H2dRefluxSolutionInitialeInterface#razModified() ! */ ! public void razModified() { ! isModified_ = false; ! } ! ! /** ! * @param _listener The listener to set. ! */ ! public void setListener(H2dRefluxProjectDispatcherListener _listener) { ! listener_ = _listener; } } Index: H2dRefluxProjectDispatcherListener.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/reflux/H2dRefluxProjectDispatcherListener.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** H2dRefluxProjectDispatcherListener.java 16 Mar 2004 16:47:29 -0000 1.5 --- H2dRefluxProjectDispatcherListener.java 31 Mar 2004 08:14:29 -0000 1.6 *************** *** 31,33 **** --- 31,34 ---- */ public void InitSolutionsChanged(); + } Index: H2dRefluxSolutionInitialeInterface.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/reflux/H2dRefluxSolutionInitialeInterface.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** H2dRefluxSolutionInitialeInterface.java 19 Mar 2004 17:40:17 -0000 1.2 --- H2dRefluxSolutionInitialeInterface.java 31 Mar 2004 08:14:29 -0000 1.3 *************** *** 9,12 **** --- 9,17 ---- package org.fudaa.dodico.h2d.reflux; + import org.fudaa.dodico.commun.DodicoAnalyze; + import org.fudaa.dodico.commun.DodicoCommand; + import org.fudaa.dodico.commun.ProgressionInterface; + import org.fudaa.dodico.ef.EfGrid; + import org.fudaa.dodico.ef.EfNode; import org.fudaa.dodico.h2d.type.H2dVariableType; *************** *** 39,44 **** --- 44,114 ---- /** + * @param _idx les indices a modifier + * @return la commande si modif. null sinon + */ + public DodicoCommand initH(int[] _idx); + + /** + * @param _idx l'indice + * @return la cote d'eau a l'indice demande + */ + public double getH(int _idx); + + /** * @return les variables utilisees */ public H2dVariableType[] getVariables(); + /** + * @return le listener + */ + public H2dRefluxProjectDispatcherListener getListener(); + + /** + * @param _listener The listener to set. + */ + public void setListener(H2dRefluxProjectDispatcherListener _listener); + + /** + * @param _g le maillage + * @param _n1 point 1 du plan + * @param _n2 point 2 du plan + * @param _n3 point 3 du plan + * @param _prog la barre de progression (peut etre nul) + * @return la commande ou nul si aucune modif + */ + public DodicoCommand initFromPlan(final EfGrid _g, final EfNode _n1,final EfNode _n2,final EfNode _n3,ProgressionInterface _prog); + + /** + * @param _interface les nouvelles solutions initiales + * @param _a l'analyse de l'operation + * @return la commande si modif. Null sinon + */ + public DodicoCommand initFromSI(H2dRefluxSolutionInitialeInterface _interface,DodicoAnalyze _a); + + /** + * @param _g le maillage associe + * @param _coteEau la cote d'eau globale + * @param _a le receveur des analyses + * @param _prog la barre de progression + * @return la commande si changement + */ + public DodicoCommand initFromCoteEau(final EfGrid _g,final double _coteEau,DodicoAnalyze _a,ProgressionInterface _prog); + + /** + * @return true si modifie + */ + public boolean isModified(); + + /** + * Initialise l'etat modifie + */ + public void razModified(); + + /** + * @param _t la variable voulue + * @return une copie des valeurs initiales pour cette variable + */ + public double[] getCopyOf(H2dVariableType _t); + + } Index: H2dRefluxParameters.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/reflux/H2dRefluxParameters.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** H2dRefluxParameters.java 19 Mar 2004 17:40:17 -0000 1.7 --- H2dRefluxParameters.java 31 Mar 2004 08:14:29 -0000 1.8 *************** *** 113,116 **** --- 113,119 ---- } propElem_.addListener(_l); + if(solutionInitiales_!=null){ + solutionInitiales_.setListener(_l); + } listener_= _l; } *************** *** 244,248 **** * @param _ft * @param _analyze ! * @param _inpF * @return */ --- 247,251 ---- * @param _ft * @param _analyze ! * @param _si * @return */ *************** *** 320,329 **** } public boolean isModified() { return isModified || clMng_.isModified() || getDicoParams().isModified() ! || propElem_.isModified(); } public void clearModified() { isModified= false; --- 323,340 ---- } + /** + * @return true si les parametres sont modifies + */ public boolean isModified() { return isModified || clMng_.isModified() || getDicoParams().isModified() ! || propElem_.isModified() ! || solutionInitiales_.isModified(); } + + /** + * Initialise l'etat modifie + */ public void clearModified() { isModified= false; *************** *** 331,334 **** --- 342,346 ---- getDicoParams().clearModified(); propElem_.setModified(false); + solutionInitiales_.razModified(); if (listener_ != null) listener_.refluxProjectModifiedStateChange(); *************** *** 407,414 **** */ public void setSolutionInitiales(H2dRefluxSolutionInitialeInterface _solutionInitiales) { ! if((listener_!=null) && (solutionInitiales_!=_solutionInitiales)){ ! listener_.InitSolutionsChanged(); } - solutionInitiales_ = _solutionInitiales; } --- 419,428 ---- */ public void setSolutionInitiales(H2dRefluxSolutionInitialeInterface _solutionInitiales) { ! if(solutionInitiales_!=_solutionInitiales){ ! if(solutionInitiales_!=null) solutionInitiales_.setListener(null); ! solutionInitiales_ = _solutionInitiales; ! if(solutionInitiales_!=null) solutionInitiales_.setListener(listener_); ! if(listener_!=null) listener_.InitSolutionsChanged(); } } |
|
From: Frederic D. <de...@us...> - 2004-03-31 08:26:47
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/objet In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9937/src/org/fudaa/dodico/objet Modified Files: activateur.lst ServeurPersonne.java DActivateur.java Log Message: Maj pour solutions initiales Index: DActivateur.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/objet/DActivateur.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** DActivateur.java 25 Nov 2003 10:11:46 -0000 1.6 --- DActivateur.java 31 Mar 2004 08:14:30 -0000 1.7 *************** *** 8,18 **** */ package org.fudaa.dodico.objet; ! import org.omg.CORBA.*; ! // import java.lang.reflect.*; ! import java.io.*; ! import java.net.*; ! import java.util.*; ! // import java.text.*; ! import org.fudaa.dodico.corba.objet.*; /** * Classe implementant un activateur --- 8,22 ---- */ package org.fudaa.dodico.objet; ! import java.io.File; ! import java.io.FileReader; ! import java.io.InputStreamReader; ! import java.io.LineNumberReader; ! import java.util.Enumeration; ! import java.util.Hashtable; ! import java.util.NoSuchElementException; ! import java.util.StringTokenizer; ! import java.util.Vector; ! ! import org.fudaa.dodico.corba.objet.IActivateurOperations; /** * Classe implementant un activateur Index: activateur.lst =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/objet/activateur.lst,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** activateur.lst 23 Sep 2003 19:51:39 -0000 1.3 --- activateur.lst 31 Mar 2004 08:14:30 -0000 1.4 *************** *** 1,4 **** ! class ! usine ! org.fudaa.dodico.usine.ServeurUsine ! end --- 1,10 ---- ! class ! usine ! org.fudaa.dodico.usine.ServeurUsine ! class ! dunes ! org.fudaa.dodico.dunes.ServeurDunes ! class ! vag ! org.fudaa.dodico.vag.ServeurVag ! end Index: ServeurPersonne.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/objet/ServeurPersonne.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ServeurPersonne.java 25 Nov 2003 10:11:46 -0000 1.5 --- ServeurPersonne.java 31 Mar 2004 08:14:30 -0000 1.6 *************** *** 8,14 **** */ package org.fudaa.dodico.objet; ! import java.net.*; ! import java.util.*; ! import org.fudaa.dodico.corba.objet.*; import org.fudaa.dodico.corba.usine.IUsine; /** --- 8,16 ---- */ package org.fudaa.dodico.objet; ! import java.util.Date; ! ! import org.fudaa.dodico.corba.objet.IOrganisme; ! import org.fudaa.dodico.corba.objet.IOrganismeHelper; ! import org.fudaa.dodico.corba.objet.IPersonne; import org.fudaa.dodico.corba.usine.IUsine; /** |
|
From: Frederic D. <de...@us...> - 2004-03-31 08:26:47
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9937/src/org/fudaa/dodico/h2d Modified Files: h2d_en.fr_txt H2dTimeStepGroup.java Log Message: Maj pour solutions initiales Index: h2d_en.fr_txt =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/h2d_en.fr_txt,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** h2d_en.fr_txt 16 Mar 2004 16:47:29 -0000 1.13 --- h2d_en.fr_txt 31 Mar 2004 08:14:29 -0000 1.14 *************** *** 123,127 **** Le maillage n'est pas spécifié=The grid is not set Débit=Flowrate ! Côte eau=Water depth Traceur=Tracer Vitesse=Velocity --- 123,130 ---- Le maillage n'est pas spécifié=The grid is not set Débit=Flowrate ! Côte eau=Free surface ! Côte d'eau=Free surface ! Hauteur d'eau=Water depth ! Hauteur eau=Water depth Traceur=Tracer Vitesse=Velocity Index: H2dTimeStepGroup.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/H2dTimeStepGroup.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** H2dTimeStepGroup.java 19 Dec 2003 12:10:36 -0000 1.4 --- H2dTimeStepGroup.java 31 Mar 2004 08:14:29 -0000 1.5 *************** *** 12,15 **** --- 12,16 ---- import gnu.trove.TObjectDoubleProcedure; + import org.fudaa.ctulu.CtuluLib; import org.fudaa.dodico.commun.DodicoLib; import org.fudaa.dodico.h2d.type.H2dResolutionMethodType; *************** *** 108,120 **** } public final void initFrom(H2dTimeStepGroup _init) { varValueMethode_= _init.varValueMethode_ == null ? null ! : DodicoLib.copy(_init.varValueMethode_); varValueSchema_= _init.varValueSchema_ == null ? null ! : DodicoLib.copy(_init.varValueSchema_); schema_= _init.schema_; methode_= _init.methode_; --- 109,125 ---- } + /** + * Initialise les donnees + * @param _init la source pour initialies les donnees + */ public final void initFrom(H2dTimeStepGroup _init) { varValueMethode_= _init.varValueMethode_ == null ? null ! : CtuluLib.copy(_init.varValueMethode_); varValueSchema_= _init.varValueSchema_ == null ? null ! : CtuluLib.copy(_init.varValueSchema_); schema_= _init.schema_; methode_= _init.methode_; |
|
From: Frederic D. <de...@us...> - 2004-03-31 08:26:46
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/reflux/io In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9937/src/org/fudaa/dodico/reflux/io Modified Files: CrbWriter.java INPFileFormat.java RefluxSolutionInitWriter.java RefluxSolutionInitReader.java Log Message: Maj pour solutions initiales Index: INPFileFormat.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/reflux/io/INPFileFormat.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** INPFileFormat.java 16 Mar 2004 16:47:28 -0000 1.17 --- INPFileFormat.java 31 Mar 2004 08:14:29 -0000 1.18 *************** *** 56,59 **** --- 56,67 ---- type_= H2dFileFormatType.PROJET.getId(); } + + public static String getINPExtension(){ + return "inp"; + } + + public static String getSolution2DExtension(){ + return "sov"; + } public boolean containsGrid() { *************** *** 74,80 **** return (H2dRefluxDicoModel)super.getDico(); } public String getClTransitoireFileExtension() { ! return CLTransitoireFileFormat.getInstance().getExtensions()[0]; } public DicoEntite[] getContributionEntite() { return getEntitesForHeading( --- 82,94 ---- return (H2dRefluxDicoModel)super.getDico(); } + /** + * @return l'extension des fichiers cl transitoire utilises + */ public String getClTransitoireFileExtension() { ! return "clv"; } + /** + * @return les mot-clés contribution + */ public DicoEntite[] getContributionEntite() { return getEntitesForHeading( *************** *** 83,86 **** --- 97,103 ---- "Contribution coefficients" }); } + /** + * @return les mot-clés impression + */ public DicoEntite[] getPrintEntite() { return getEntitesForHeading(new String[] { "Impression", "Print" }); *************** *** 98,116 **** } 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()); --- 115,155 ---- } + /** + * @return "pnv" + */ public String getPnTransitoireFileExtension() { ! return "pnv"; } + /** + * @return "siv" + */ public String getSolutionInitFileExtension() { ! return "siv"; } + /** + * @return "sov" + */ public String getSolutionFileExtension() { ! return "sov"; } + /** + * @return "sfv" + */ public String getSolutionFinaleExtension() { ! return "sfv"; } + + + /** + * @param _f le tableau a parcourir + * @return le fichier contant l'extension clv + */ public String getCLTransitoireFichier(String[] _f) { return DodicoLib.findStringEndWith(_f, getClTransitoireFileExtension()); } + /** + * @param _f le tableau a parcourir + * @return le fichier contant l'extension pnv + */ public String getPnTransitoireFichier(String[] _f) { return DodicoLib.findStringEndWith(_f, getPnTransitoireFileExtension()); *************** *** 125,128 **** --- 164,175 ---- } + /** + * @param _f le tableau de recherche + * @return l'element du tableau contenant la bonne extension + */ + public String getSolution(String[] _f) { + return DodicoLib.findStringEndWith(_f, getSolutionFileExtension()); + } + public H2dBcType getClType(int _id) { Index: RefluxSolutionInitReader.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/reflux/io/RefluxSolutionInitReader.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** RefluxSolutionInitReader.java 16 Mar 2004 16:47:28 -0000 1.1 --- RefluxSolutionInitReader.java 31 Mar 2004 08:14:29 -0000 1.2 *************** *** 18,25 **** --- 18,30 ---- import org.fudaa.dodico.commun.DodicoAnalyze; import org.fudaa.dodico.commun.DodicoResource; + import org.fudaa.dodico.commun.ProgressionInterface; import org.fudaa.dodico.commun.ProgressionUpdater; + import org.fudaa.dodico.ef.EfElement; + import org.fudaa.dodico.ef.EfGrid; + import org.fudaa.dodico.fichiers.FileOperationSynthese; import org.fudaa.dodico.fichiers.FileReadOperationAbstract; import org.fudaa.dodico.fortran.FortranBinaryInputStream; import org.fudaa.dodico.fortran.FortranInterface; + import org.fudaa.dodico.h2d.reflux.H2dRefluxSICourant2D; *************** *** 101,103 **** --- 106,147 ---- }; } + + /** + * Lit le fichier si, attention : les niveaux d'eau sont transformés en hauteur d'eau + * @param _g le maillage associé + * @param _f le fichier siv a lire + * @param _prog la barre de progression + * @return la synthese contenant une instance de H2dRefluxSICourant2D + */ + public static FileOperationSynthese loadSI(EfGrid _g, File _f, ProgressionInterface _prog) { + FileOperationSynthese init = RefluxSolutionInitFileFormat.getInstance() + .getLastVersionInstance().read(_f, _prog); + if (init.containsFatalError()) { + init.setSource(null); + return init; + } + double[] vals = (double[]) init.getSource(); + double[][] si = new double[3][_g.getPtsNb()]; + int idxDone = 0; + int nbPt = _g.getPtsNb(); + int temp; + if (_prog != null) _prog.setProgression(30); + int idxInVal = 0; + idxDone = 0; + temp = vals.length; + ProgressionUpdater up = new ProgressionUpdater(_prog); + up.setValue(3, nbPt, 30, 70); + up.majProgessionStateOnly(); + while (idxInVal < temp) { + si[0][idxDone] = vals[idxInVal++]; + si[1][idxDone] = vals[idxInVal++]; + if (!_g.isMiddlePoint(idxDone)) { + si[2][idxDone] = vals[idxInVal++]-_g.getPt(idxDone).getZ(); + } + up.majAvancement(); + idxDone++; + } + init.setSource(new H2dRefluxSICourant2D(si[0], si[1], si[2])); + return init; + } } Index: CrbWriter.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/reflux/io/CrbWriter.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CrbWriter.java 12 Feb 2004 15:32:47 -0000 1.2 --- CrbWriter.java 31 Mar 2004 08:14:29 -0000 1.3 *************** *** 13,21 **** import org.fudaa.ctulu.CtuluLib; - - import org.fudaa.dodico.commun.DodicoAnalyze; - import org.fudaa.dodico.commun.DodicoLib; import org.fudaa.dodico.commun.DodicoResource; import org.fudaa.dodico.commun.ProgressionInterface; import org.fudaa.dodico.fichiers.FileFormatVersion; import org.fudaa.dodico.fichiers.FileOpWriterCharSimpleAbstract; --- 13,19 ---- import org.fudaa.ctulu.CtuluLib; import org.fudaa.dodico.commun.DodicoResource; import org.fudaa.dodico.commun.ProgressionInterface; + import org.fudaa.dodico.commun.ProgressionUpdater; import org.fudaa.dodico.fichiers.FileFormatVersion; import org.fudaa.dodico.fichiers.FileOpWriterCharSimpleAbstract; *************** *** 29,47 **** */ public class CrbWriter extends FileOpWriterCharSimpleAbstract { CrbFileFormat.CRBVersion v_; - public CrbWriter(CrbFileFormat.CRBVersion _v) { - v_= _v; } /** ! * */ protected void _write(Object _o) { if (_o instanceof H2dEvolution[]) ! writeEvol((H2dEvolution[])_o); ! else ! analyze_.addFatalError(DodicoResource.getS("Données invalides")); ! } --- 27,48 ---- */ public class CrbWriter extends FileOpWriterCharSimpleAbstract { + CrbFileFormat.CRBVersion v_; + /** + * @param _v la version a utiliser + */ + public CrbWriter(CrbFileFormat.CRBVersion _v) { + v_ = _v; } /** ! * * */ protected void _write(Object _o) { if (_o instanceof H2dEvolution[]) ! writeEvol((H2dEvolution[]) _o); ! else ! analyze_.addFatalError(DodicoResource.getS("Données invalides")); } *************** *** 51,125 **** } try { ! FortranWriter w= new FortranWriter(out_); w.setLineSeparator(lineSep_); w.stringField(1, v_.getVersionName()); w.stringField(0, "*!$ Version"); ! w.writeFields(new int[] { 12, 10 }); ! int n= _evol.length; int nbPoint; ! int step= DodicoLib.getStep(n); ! int pourcStep= (int) (100 / step); ! int pas= (int) (n / step); ! int pMax= pas; ! int pourc=0; ! int[] fmtEntete= new int[] { 20, 1, 5 }; ! int[] fmtCorps= new int[] { 10, 1, 10 }; ! for (int i= 0; i < n; i++) { ! H2dEvolution e= _evol[i]; w.intField(2, e.getPasTempNb()); ! String nom= e.getNom(); if ((nom == null) || (nom.length() == 0)) { ! nom= "C " + CtuluLib.getString(i); } w.stringField(0, nom); w.writeFields(fmtEntete); ! nbPoint=e.getPasTempNb(); ! for(int j=0;j<nbPoint;j++){ w.doubleField(0, e.getQuickPasDeTemps(j)); w.doubleField(2, e.getQuickValue(j)); w.writeFields(fmtCorps); } ! if (progress_!=null) { ! if (i > pMax) { ! pourc += pourcStep; ! progress_.setProgression(pourc); ! pMax += pas; ! } ! } } } catch (IOException e) { analyze_.manageException(e); } - } /** ! * */ public FileFormatVersion getVersion() { return v_; } ! ! public FileOperationSynthese write(H2dEvolution[] _evol){ ! if (progress_ != null) ! progress_.setDesc( ! getOperationDescription() + CtuluLib.ESPACE + getVersion()); writeEvol(_evol); return closeOperation(_evol); } ! ! ! public final FileOperationSynthese write( ! H2dEvolution[] _o, ! File _f, ! ProgressionInterface _inter) { setFile(_f); setProgressReceiver(_inter); return write(_o); } - - - - } --- 52,122 ---- } try { ! FortranWriter w = new FortranWriter(out_); w.setLineSeparator(lineSep_); w.stringField(1, v_.getVersionName()); w.stringField(0, "*!$ Version"); ! w.writeFields(new int[] { 12, 10}); ! int n = _evol.length; int nbPoint; ! ProgressionUpdater up = new ProgressionUpdater(progress_); ! up.setValue(4, n); ! up.majProgessionStateOnly(); ! int[] fmtEntete = new int[] { 20, 1, 5}; ! int[] fmtCorps = new int[] { 10, 1, 10}; ! for (int i = 0; i < n; i++) { ! H2dEvolution e = _evol[i]; w.intField(2, e.getPasTempNb()); ! String nom = e.getNom(); if ((nom == null) || (nom.length() == 0)) { ! nom = "C " + CtuluLib.getString(i); } w.stringField(0, nom); w.writeFields(fmtEntete); ! nbPoint = e.getPasTempNb(); ! for (int j = 0; j < nbPoint; j++) { w.doubleField(0, e.getQuickPasDeTemps(j)); w.doubleField(2, e.getQuickValue(j)); w.writeFields(fmtCorps); } ! up.majAvancement(); } } catch (IOException e) { analyze_.manageException(e); } } + /** ! * @return la version utilisee */ public FileFormatVersion getVersion() { return v_; } ! ! /** ! * @param _evol ! * @return ! */ ! public FileOperationSynthese write(H2dEvolution[] _evol) { ! if (progress_ != null) ! progress_.setDesc( ! getOperationDescription() + CtuluLib.ESPACE + getVersion()); writeEvol(_evol); return closeOperation(_evol); } ! ! /** ! * @param _o les evolutions a enregistrer ! * @param _f le fichier ! * @param _inter la barre de progression ! * @return la synthese de l'operation ! */ public final FileOperationSynthese write( ! H2dEvolution[] _o, ! File _f, ! ProgressionInterface _inter) { setFile(_f); setProgressReceiver(_inter); return write(_o); } } Index: RefluxSolutionInitWriter.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/reflux/io/RefluxSolutionInitWriter.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** RefluxSolutionInitWriter.java 16 Mar 2004 16:47:28 -0000 1.1 --- RefluxSolutionInitWriter.java 31 Mar 2004 08:14:29 -0000 1.2 *************** *** 14,23 **** --- 14,30 ---- import java.io.IOException; import java.io.OutputStream; + import org.fudaa.dodico.commun.DodicoAnalyze; import org.fudaa.dodico.commun.DodicoResource; + import org.fudaa.dodico.commun.ProgressionInterface; import org.fudaa.dodico.commun.ProgressionUpdater; + import org.fudaa.dodico.ef.EfGrid; + import org.fudaa.dodico.fichiers.FileOperationSynthese; import org.fudaa.dodico.fichiers.FileWriteOperationAbstract; import org.fudaa.dodico.fortran.FortranBinaryOutputStream; import org.fudaa.dodico.fortran.FortranInterface; + import org.fudaa.dodico.h2d.reflux.H2dRefluxSolutionInit2DWriterInterface; + + import sun.security.krb5.internal.ccache.an; *************** *** 59,63 **** try { out = new FileOutputStream(_f); ! } catch (FileNotFoundException _e) { return; } --- 66,72 ---- try { out = new FileOutputStream(_f); ! } catch (IOException _e) { ! analyze_.manageException(_e); ! _e.printStackTrace(); return; } *************** *** 67,75 **** private void setOut(OutputStream _out) { ! try{ ! out_ = new FortranBinaryOutputStream(_out,true); } ! catch(IOException e){ ! out_=null; } } --- 76,85 ---- private void setOut(OutputStream _out) { ! try { ! out_ = new FortranBinaryOutputStream(_out, true); } ! catch (IOException e) { ! e.printStackTrace(); ! out_ = null; } } *************** *** 79,105 **** */ protected void _write(Object _o) { ! if(!(_o instanceof double[])){ _donneesInvalides(_o); } ! else _write((double[])_o); } ! protected void _write(double[] _data) { ! if(out_==null){ analyze_.addFatalError(DodicoResource.getS("Le flux de sortie est nul")); } ! try{ ! ProgressionUpdater up=new ProgressionUpdater(progress_); ! up.setValue(4,_data.length); ! for (int i= 0; i < _data.length; i++){ ! out_.writeDoublePrecision(_data[i]); ! up.majAvancement(); } ! out_.writeRecord(); } ! catch(IOException e){ analyze_.manageException(e); } ! } } --- 89,149 ---- */ protected void _write(Object _o) { ! if (!(_o instanceof double[])) { _donneesInvalides(_o); } ! else _write((double[]) _o); } ! protected void _write(double[] _data) { ! if (out_ == null) { analyze_.addFatalError(DodicoResource.getS("Le flux de sortie est nul")); + return; } ! if(_data==null){ ! analyze_.addFatalError(DodicoResource.getS("Les données sont nulles")); ! return; } ! try { ! ProgressionUpdater up = new ProgressionUpdater(progress_); ! up.setValue(4, _data.length); ! for (int i = 0; i < _data.length; i++) { ! out_.writeDoublePrecision(_data[i]); ! up.majAvancement(); ! } ! out_.writeRecord(); } ! catch (IOException e) { analyze_.manageException(e); } ! } ! ! ! /** ! * @param _g le maillage associe ! * @param _f le fichier de dest ! * @param _init l'interface contenant les valeurs a ecrire ! * @param _prog la progression ! * @return la synthese de l'ecriture contenant le tableau de double generee comme source ! */ ! public static FileOperationSynthese writeSI(EfGrid _g, H2dRefluxSolutionInit2DWriterInterface _init, ! File _f, ProgressionInterface _prog) { ! int nbPt = _g.getPtsNb(); ! double[] vals = new double[nbPt * 3]; ! if (_prog != null) _prog.setProgression(30); ! int idxInVal = 0; ! ProgressionUpdater up = new ProgressionUpdater(_prog); ! up.setValue(3, nbPt, 30, 70); ! up.majProgessionStateOnly(); ! for (int i = 0; i < nbPt; i++) { ! vals[idxInVal++] = _init.getU(i); ! vals[idxInVal++] = _init.getV(i); ! if (_g.isExtremePoint(i)) { ! vals[idxInVal++] = _init.getH(i)+_g.getPt(i).getZ(); ! } ! } ! double[] fvals = new double[idxInVal]; ! System.arraycopy(vals, 0, fvals, 0, fvals.length); ! return RefluxSolutionInitFileFormat.getInstance().getLastVersionInstance().write(_f, fvals, ! _prog); } } |
|
From: Frederic D. <de...@us...> - 2004-03-31 08:26:45
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/dico In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9937/src/org/fudaa/dodico/dico Modified Files: DicoManager.java Log Message: Maj pour solutions initiales Index: DicoManager.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/dico/DicoManager.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** DicoManager.java 25 Nov 2003 10:11:29 -0000 1.6 --- DicoManager.java 31 Mar 2004 08:14:28 -0000 1.7 *************** *** 8,29 **** */ package org.fudaa.dodico.dico; - import java.awt.Component; import java.io.File; import java.io.FileFilter; import java.util.ArrayList; import java.util.Arrays; - import java.util.Collections; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; - import java.util.Set; import java.util.TreeMap; ! import javax.swing.AbstractListModel; ! import javax.swing.ComboBoxModel; ! import javax.swing.DefaultListCellRenderer; ! import javax.swing.JList; ! import javax.swing.ListCellRenderer; ! import javax.swing.UIManager; import org.fudaa.dodico.commun.DodicoLib; import org.fudaa.dodico.commun.DodicoPermanentList; --- 8,21 ---- */ package org.fudaa.dodico.dico; import java.io.File; import java.io.FileFilter; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.TreeMap; ! import org.fudaa.dodico.commun.DodicoLib; import org.fudaa.dodico.commun.DodicoPermanentList; *************** *** 143,147 **** } } ! public abstract DicoCasFileFormat createFormat(String _s); // public DicoModelAbstract getLastVersion(String _name) { // DicoCasFileFormatVersion des= getLastVersionDesc(_name); --- 135,139 ---- } } ! protected abstract DicoCasFileFormat createFormat(String _s); // public DicoModelAbstract getLastVersion(String _name) { // DicoCasFileFormatVersion des= getLastVersionDesc(_name); |
|
From: Frederic D. <de...@us...> - 2004-03-31 08:26:21
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/dunes/io In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9937/src/org/fudaa/dodico/dunes/io Modified Files: DunesReader.java DunesWriter.java Log Message: Maj pour solutions initiales Index: DunesReader.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/dunes/io/DunesReader.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** DunesReader.java 12 Feb 2004 15:32:44 -0000 1.13 --- DunesReader.java 31 Mar 2004 08:14:30 -0000 1.14 *************** *** 8,18 **** */ package org.fudaa.dodico.dunes.io; import java.io.EOFException; import java.io.IOException; import org.fudaa.ctulu.CtuluLib; ! ! import org.fudaa.dodico.commun.DodicoAnalyze; ! import org.fudaa.dodico.commun.DodicoLib; import org.fudaa.dodico.ef.EfElement; import org.fudaa.dodico.ef.EfGrid; --- 8,17 ---- */ package org.fudaa.dodico.dunes.io; + import java.io.EOFException; import java.io.IOException; import org.fudaa.ctulu.CtuluLib; ! import org.fudaa.dodico.commun.ProgressionUpdater; import org.fudaa.dodico.ef.EfElement; import org.fudaa.dodico.ef.EfGrid; *************** *** 30,34 **** --- 29,35 ---- */ public class DunesReader extends FileOpReadCharSimpleAbstract { + DunesFileFormat.DunesVersion version_; + /** * @param _in le flux d'entree non bufferise. *************** *** 37,51 **** this(DunesFileFormat.getInstance().getLastVersionImpl()); } public DunesReader(DunesFileFormat.DunesVersion _f) { ! version_= _f; } protected Object _read() { return readDunes(); } private DunesInterface readDunes() { ! DunesAdapter source_= null; ! EfNode[] points= null; ! EfElement[] elems= null; ! double[] adaptatifs= null; in_.setJumpBlankLine(true); try { --- 38,58 ---- this(DunesFileFormat.getInstance().getLastVersionImpl()); } + + /** + * @param _f le format a utiliser + */ public DunesReader(DunesFileFormat.DunesVersion _f) { ! version_ = _f; } + protected Object _read() { return readDunes(); } + private DunesInterface readDunes() { ! DunesAdapter source_ = null; ! EfNode[] points = null; ! EfElement[] elems = null; ! double[] adaptatifs = null; in_.setJumpBlankLine(true); try { *************** *** 54,63 **** in_.readFields(); if ((in_.getNumberOfFields() != 1) ! && (!version_.getNoeudCode().equals(in_.stringField(0)))) { analyze_.addError( ! H2dResource.getS( ! "L'identifiant {0} est attendu", ! version_.getNoeudCode()), ! in_); return null; } --- 61,70 ---- in_.readFields(); if ((in_.getNumberOfFields() != 1) ! && (!version_.getNoeudCode().equals(in_.stringField(0)))) { analyze_.addError( ! H2dResource.getS( ! "L'identifiant {0} est attendu", ! version_.getNoeudCode()), ! in_); return null; } *************** *** 65,150 **** //NOMBRE_DE_NOEUD TYPE_DE_MAILLAGE in_.readFields(); ! //verification que l'on a bien 2 champs if (in_.getNumberOfFields() != 2) { analyze_.addFatalError( ! H2dResource.getS("Nombre de noeuds non trouvé"), ! in_); return null; } //le nombre de noeud ! int nbNoeuds= in_.intField(0); //le type de maillage. //Si 2, des infos sur le maillage adaptatif seront presentes ! int typeMaillage= in_.intField(1); //Si adaptatif, on initialise le tableau stockant les valeurs. if (typeMaillage == version_.getAdaptatifCode()) { ! adaptatifs= new double[nbNoeuds]; //on affecte a source le tableau. } //Creation du tableau de point. ! points= new EfNode[nbNoeuds]; // maillage.points = points; ! int pourc= 0; ! boolean afficheAvance= (progress_ == null ? false : true); ! if (afficheAvance) ! progress_.setProgression(pourc); ! int step= DodicoLib.getStep(nbNoeuds); ! int pourcStep= (int) (50 / step); ! int pas= (int) (nbNoeuds / step); ! int pMax= pas; int temp; //lecture des noeuds ! for (int i= 0; i < nbNoeuds; i++) { in_.readFields(); if (in_.getNumberOfFields() != 4) { analyze_.addInfo( ! H2dResource.getS("Format attendu") + ": NUM_POINT X Y Z", ! in_); analyze_.addError( ! H2dResource.getS( ! "La définition du noeud {0} n'est pas valide", ! CtuluLib.getString(i + 1)), ! in_); return null; } ! temp= in_.intField(0); if (temp != (i + 1)) { analyze_.addInfo( ! H2dResource.getS( ! "Le numéro du point ne correspond pas au numéro réel"), ! in_); } ! points[i]= ! new EfNode( ! in_.doubleField(1), ! in_.doubleField(2), ! in_.doubleField(3)); if (adaptatifs != null) { in_.readFields(); if (in_.getNumberOfFields() != 1) { analyze_.addWarn( ! H2dResource.getS( ! "La ligne du coefficient adaptatif ne doit contenir qu'un champ"), ! in_); ! } ! adaptatifs[i]= in_.doubleField(0); ! } ! if (afficheAvance) { ! if (i > pMax) { ! pourc += pourcStep; ! progress_.setProgression(pourc); ! pMax += pas; } } } //Lecture du mot cle ELEMENT in_.readFields(); if ((in_.getNumberOfFields() != 1) ! && (!version_.getElementCode().equals(in_.stringField(0)))) { analyze_.addError( ! H2dResource.getS( ! "L'identifiant {0} est attendu", ! version_.getElementCode()), ! in_); return null; } --- 72,147 ---- //NOMBRE_DE_NOEUD TYPE_DE_MAILLAGE in_.readFields(); ! //verification que l'on a bien 2 champs if (in_.getNumberOfFields() != 2) { analyze_.addFatalError( ! H2dResource.getS("Nombre de noeuds non trouvé"), ! in_); return null; } //le nombre de noeud ! int nbNoeuds = in_.intField(0); //le type de maillage. //Si 2, des infos sur le maillage adaptatif seront presentes ! int typeMaillage = in_.intField(1); //Si adaptatif, on initialise le tableau stockant les valeurs. if (typeMaillage == version_.getAdaptatifCode()) { ! adaptatifs = new double[nbNoeuds]; //on affecte a source le tableau. } //Creation du tableau de point. ! points = new EfNode[nbNoeuds]; // maillage.points = points; ! int pourc = 0; ! ProgressionUpdater up = new ProgressionUpdater(progress_); ! up.setValue(2, nbNoeuds, 0, 50); ! up.majProgessionStateOnly(); int temp; //lecture des noeuds ! for (int i = 0; i < nbNoeuds; i++) { in_.readFields(); if (in_.getNumberOfFields() != 4) { analyze_.addInfo( ! H2dResource.getS("Format attendu") + ": NUM_POINT X Y Z", ! in_); analyze_.addError( ! H2dResource.getS( ! "La définition du noeud {0} n'est pas valide", ! CtuluLib.getString(i + 1)), ! in_); return null; } ! temp = in_.intField(0); if (temp != (i + 1)) { analyze_.addInfo( ! H2dResource.getS( ! "Le numéro du point ne correspond pas au numéro réel"), ! in_); } ! points[i] = ! new EfNode( ! in_.doubleField(1), ! in_.doubleField(2), ! in_.doubleField(3)); if (adaptatifs != null) { in_.readFields(); if (in_.getNumberOfFields() != 1) { analyze_.addWarn( ! H2dResource.getS( ! "La ligne du coefficient adaptatif ne doit contenir qu'un champ"), ! in_); } + adaptatifs[i] = in_.doubleField(0); } + up.majAvancement(); } //Lecture du mot cle ELEMENT in_.readFields(); if ((in_.getNumberOfFields() != 1) ! && (!version_.getElementCode().equals(in_.stringField(0)))) { analyze_.addError( ! H2dResource.getS( ! "L'identifiant {0} est attendu", ! version_.getElementCode()), ! in_); return null; } *************** *** 154,255 **** if (in_.getNumberOfFields() != 1) { analyze_.addFatalError( ! H2dResource.getS("Cette ligne est invalide"), ! in_); return null; } ! int nbElem= in_.intField(0); ! elems= new EfElement[nbElem]; //Les donnees utiles pour l'etat d'avancement ! step= DodicoLib.getStep(nbElem); ! pas= (int) (nbElem / step); ! pMax= pas; ! pourcStep= (int) (50 / step); int[] index; ! for (int i= 0; i < nbElem; i++) { in_.readFields(); if (in_.getNumberOfFields() < 2) { analyze_.addInfo( ! H2dResource.getS("Format attendu") ! + "NUM_ELEMENT NB_POINT P[1] ...P[NB_POINT]", ! in_); analyze_.addError( ! H2dResource.getS("La définition de l'élément {0} n'est pas valide"), ! in_); return null; } //le numero d'element ! temp= in_.intField(0); if (temp != (i + 1)) { analyze_.addInfo( ! H2dResource.getS( ! "L'index de l'élément ne correspond pas à l'index réel"), ! in_); } ! temp= in_.intField(1); if (temp <= 0) { analyze_.addError( ! H2dResource.getS( ! "Le nombre de points est négatif ou nul pour l'élément d'indice {0}", ! CtuluLib.getString(i + 1)), ! in_); return null; } if (in_.getNumberOfFields() != (temp + 2)) { analyze_.addInfo( ! H2dResource.getS("Nombre indiqué") ! + ": " ! + temp ! + "." ! + H2dResource.getS("Nombre lu") ! + ": " ! + (in_.getNumberOfFields() - 2), ! in_); analyze_.addFatalError( ! H2dResource.getS("Le nombre d'éléments est incorrect"), ! in_); return null; } ! index= new int[temp]; ! for (int j= 0; j < temp; j++) { //on stocke les indexs en commencant a 0. ! index[j]= in_.intField(2 + j) - 1; ! } ! elems[i]= new EfElement(index); ! if (afficheAvance) { ! if (i > pMax) { ! pourc += pourcStep; ! progress_.setProgression(pourc); ! pMax += pas; ! } } } in_.readFields(); if (!"0 0 0 0".equals(in_.getLine().trim())) { ! if (in_.getLine().trim() != "") ! analyze_.addWarn( ! H2dResource.getS("Cette ligne et les suivantes sont ignorées"), ! in_); } in_.readFields(); ! if (in_.getLine().trim() != "") ! analyze_.addWarn( ! H2dResource.getS("Cette ligne et les suivantes sont ignorées"), ! in_); } catch (EOFException e) { ! if (CtuluLib.DEBUG) ! CtuluLib.debug("Dunes Read end"); } catch (NumberFormatException fe) { ! analyze_.manageException(fe, in_); } catch (IOException _e) { analyze_.manageException(_e); } //Le mot clef noeud est trouve, on peut creer le maillage. ! EfGrid maillage= new EfGrid(points, elems); EfLib.orienteGrid(maillage, progress_, true, analyze_); ! source_= new DunesAdapter(); source_.setMaillage(maillage); source_.setAdaptatif(adaptatifs); return source_; } /** * @return --- 151,245 ---- if (in_.getNumberOfFields() != 1) { analyze_.addFatalError( ! H2dResource.getS("Cette ligne est invalide"), ! in_); return null; } ! int nbElem = in_.intField(0); ! elems = new EfElement[nbElem]; //Les donnees utiles pour l'etat d'avancement ! up.setValue(2, nbElem, 50, 50); ! up.majProgessionStateOnly(); int[] index; ! for (int i = 0; i < nbElem; i++) { in_.readFields(); if (in_.getNumberOfFields() < 2) { analyze_.addInfo( ! H2dResource.getS("Format attendu") ! + "NUM_ELEMENT NB_POINT P[1] ...P[NB_POINT]", ! in_); analyze_.addError( ! H2dResource.getS("La définition de l'élément {0} n'est pas valide"), ! in_); return null; } //le numero d'element ! temp = in_.intField(0); if (temp != (i + 1)) { analyze_.addInfo( ! H2dResource.getS( ! "L'index de l'élément ne correspond pas à l'index réel"), ! in_); } ! temp = in_.intField(1); if (temp <= 0) { analyze_.addError( ! H2dResource.getS( ! "Le nombre de points est négatif ou nul pour l'élément d'indice {0}", ! CtuluLib.getString(i + 1)), ! in_); return null; } if (in_.getNumberOfFields() != (temp + 2)) { analyze_.addInfo( ! H2dResource.getS("Nombre indiqué") ! + ": " ! + temp ! + "." ! + H2dResource.getS("Nombre lu") ! + ": " ! + (in_.getNumberOfFields() - 2), ! in_); analyze_.addFatalError( ! H2dResource.getS("Le nombre d'éléments est incorrect"), ! in_); return null; } ! index = new int[temp]; ! for (int j = 0; j < temp; j++) { //on stocke les indexs en commencant a 0. ! index[j] = in_.intField(2 + j) - 1; } + elems[i] = new EfElement(index); + up.majAvancement(); } in_.readFields(); if (!"0 0 0 0".equals(in_.getLine().trim())) { ! if (in_.getLine().trim() != "") ! analyze_.addWarn( ! H2dResource.getS("Cette ligne et les suivantes sont ignorées"), ! in_); } in_.readFields(); ! if (in_.getLine().trim() != "") ! analyze_.addWarn( ! H2dResource.getS("Cette ligne et les suivantes sont ignorées"), ! in_); } catch (EOFException e) { ! if (CtuluLib.DEBUG) ! CtuluLib.debug("Dunes Read end"); } catch (NumberFormatException fe) { ! analyze_.manageException(fe, in_); } catch (IOException _e) { analyze_.manageException(_e); } //Le mot clef noeud est trouve, on peut creer le maillage. ! EfGrid maillage = new EfGrid(points, elems); EfLib.orienteGrid(maillage, progress_, true, analyze_); ! source_ = new DunesAdapter(); source_.setMaillage(maillage); source_.setAdaptatif(adaptatifs); return source_; } + /** * @return *************** *** 258,266 **** return getDunesFileFormat(); } public DunesFileFormat getDunesFileFormat() { ! return (DunesFileFormat)version_.getFileFormat(); } /** ! * */ public FileFormatVersion getVersion() { --- 248,261 ---- return getDunesFileFormat(); } + + /** + * @return le format utilise + */ public DunesFileFormat getDunesFileFormat() { ! return (DunesFileFormat) version_.getFileFormat(); } + /** ! * @return la version utilisee */ public FileFormatVersion getVersion() { Index: DunesWriter.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/dunes/io/DunesWriter.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** DunesWriter.java 12 Feb 2004 15:32:44 -0000 1.12 --- DunesWriter.java 31 Mar 2004 08:14:30 -0000 1.13 *************** *** 8,16 **** */ package org.fudaa.dodico.dunes.io; - import java.io.IOException; ! import org.fudaa.dodico.commun.DodicoAnalyze; import org.fudaa.dodico.commun.DodicoLib; import org.fudaa.dodico.commun.DodicoResource; import org.fudaa.dodico.ef.EfElement; import org.fudaa.dodico.ef.EfGrid; --- 8,16 ---- */ package org.fudaa.dodico.dunes.io; ! import java.io.IOException; import org.fudaa.dodico.commun.DodicoLib; import org.fudaa.dodico.commun.DodicoResource; + import org.fudaa.dodico.commun.ProgressionUpdater; import org.fudaa.dodico.ef.EfElement; import org.fudaa.dodico.ef.EfGrid; *************** *** 22,48 **** import org.fudaa.dodico.h2d.H2dResource; /** - * * @author deniger * @version $Id$ */ public class DunesWriter extends FileOpWriterCharSimpleAbstract { DunesFileFormat.DunesVersion version_; public DunesWriter() { this(DunesFileFormat.getInstance().getLastVersionImpl()); } public DunesWriter(DunesFileFormat.DunesVersion _f) { ! version_= _f; } public FileFormat getFileFormat() { return version_.getFileFormat(); } /** ! * Ecrire les donnees de l'interface <code>DunesInterface</code> ! * sur la sortie <code>Writer</code>. L'ecriture n'est effectuée ! * que si les points et elements du maillage sont non nuls. ! * La méthode se termine par un flush mais ne ferme pas le flux. */ protected void writeDunes(DunesInterface _d) { ! DunesInterface dunes_= _d; //Test sur les objets a ecrire if (dunes_ == null) { --- 22,60 ---- import org.fudaa.dodico.h2d.H2dResource; /** * @author deniger * @version $Id$ */ public class DunesWriter extends FileOpWriterCharSimpleAbstract { + DunesFileFormat.DunesVersion version_; + + /** + * Construit avec une version par defaut + */ public DunesWriter() { this(DunesFileFormat.getInstance().getLastVersionImpl()); } + + /** + * @param _f la version a utiliser + */ public DunesWriter(DunesFileFormat.DunesVersion _f) { ! version_ = _f; } + + /** + * @return le format utilise + */ public FileFormat getFileFormat() { return version_.getFileFormat(); } + /** ! * Ecrire les donnees de l'interface <code>DunesInterface</code> sur la sortie <code>Writer</code>. ! * L'ecriture n'est effectuée que si les points et elements du maillage sont non nuls. La méthode ! * se termine par un flush mais ne ferme pas le flux. */ protected void writeDunes(DunesInterface _d) { ! DunesInterface dunes_ = _d; //Test sur les objets a ecrire if (dunes_ == null) { *************** *** 54,66 **** return; } ! EfGrid maillage= dunes_.getGrid(); if (maillage == null) { analyze_.addFatalError("Le maillage est nul"); return; } ! int nPts= maillage.getPtsNb(); if (nPts == 0) { analyze_.addFatalError( ! H2dResource.getS("Le maillage ne contient pas de points")); return; } --- 66,78 ---- return; } ! EfGrid maillage = dunes_.getGrid(); if (maillage == null) { analyze_.addFatalError("Le maillage est nul"); return; } ! int nPts = maillage.getPtsNb(); if (nPts == 0) { analyze_.addFatalError( ! H2dResource.getS("Le maillage ne contient pas de points")); return; } *************** *** 71,91 **** // return; // } ! int nElems= maillage.getEltNb(); if (nElems == 0) { analyze_.addFatalError( ! H2dResource.getS("Le maillage ne contient pas d'éléments")); return; } ! StringBuffer b= new StringBuffer(600); b.append(version_.getNoeudCode()); b.append(' '); b.append(lineSep_); b.append(nPts); ! boolean printAdaptatifV= false; ! double[] adValeur= dunes_.getAdaptatifValeur(); b.append(' '); if (adValeur != null) { b.append(version_.getAdaptatifCode()); ! printAdaptatifV= true; } else { b.append(version_.getNonAdaptatifCode()); --- 83,103 ---- // return; // } ! int nElems = maillage.getEltNb(); if (nElems == 0) { analyze_.addFatalError( ! H2dResource.getS("Le maillage ne contient pas d'éléments")); return; } ! StringBuffer b = new StringBuffer(600); b.append(version_.getNoeudCode()); b.append(' '); b.append(lineSep_); b.append(nPts); ! boolean printAdaptatifV = false; ! double[] adValeur = dunes_.getAdaptatifValeur(); b.append(' '); if (adValeur != null) { b.append(version_.getAdaptatifCode()); ! printAdaptatifV = true; } else { b.append(version_.getNonAdaptatifCode()); *************** *** 94,111 **** //Gestion de l'etat d'avancement //le pas pour afficher l'etat d'avancement ! int pourc= 0; ! boolean afficheAvance= (progress_ == null ? false : true); if (afficheAvance) { progress_.setProgression(pourc); progress_.setDesc(H2dResource.getS("Ecriture fichier") + " dunes"); } ! int step= DodicoLib.getStep(nPts); ! int pas= (int) (nPts / step); ! int pMax= pas; ! int pourcStep= (int) (50 / step); EfNode pt; try { ! for (int i= 0; i < nPts; i++) { ! pt= maillage.getPt(i); b.append((i + 1)); b.append(' '); --- 106,121 ---- //Gestion de l'etat d'avancement //le pas pour afficher l'etat d'avancement ! int pourc = 0; ! boolean afficheAvance = (progress_ == null ? false : true); if (afficheAvance) { progress_.setProgression(pourc); progress_.setDesc(H2dResource.getS("Ecriture fichier") + " dunes"); } ! ProgressionUpdater up = new ProgressionUpdater(progress_); ! up.setValue(2, nPts); EfNode pt; try { ! for (int i = 0; i < nPts; i++) { ! pt = maillage.getPt(i); b.append((i + 1)); b.append(' '); *************** *** 121,131 **** } DodicoLib.writeTo(out_, b); ! if (afficheAvance) { ! if (i > pMax) { ! pourc += pourcStep; ! progress_.setProgression(pourc); ! pMax += pas; ! } ! } } //Cette ligne blanche est-elle utile ? --- 131,135 ---- } DodicoLib.writeTo(out_, b); ! up.majAvancement(); } //Cette ligne blanche est-elle utile ? *************** *** 138,152 **** b.append(lineSep_); //pour afficher l'etat d'avancement ! step= DodicoLib.getStep(nElems); ! pas= (int) (nElems / step); ! pMax= pas; ! pourcStep= (int) (50 / step); //les points par elements EfElement ppel; //le nombre de points par elements. int nppel; ! for (int i= 0; i < nElems; i++) { ! ppel= maillage.getElement(i); ! nppel= ppel.getPtNb(); //le num d'elements b.append((i + 1)); --- 142,154 ---- b.append(lineSep_); //pour afficher l'etat d'avancement ! up.setValue(2, nElems, 50, 50); ! up.majAvancement(); //les points par elements EfElement ppel; //le nombre de points par elements. int nppel; ! for (int i = 0; i < nElems; i++) { ! ppel = maillage.getElement(i); ! nppel = ppel.getPtNb(); //le num d'elements b.append((i + 1)); *************** *** 155,159 **** b.append(nppel); //les indices des points pour l'element i ! for (int j= 0; j < nppel; j++) { b.append(' '); //Les indices sont stockés a partir de 0. --- 157,161 ---- b.append(nppel); //les indices des points pour l'element i ! for (int j = 0; j < nppel; j++) { b.append(' '); //Les indices sont stockés a partir de 0. *************** *** 162,172 **** writeln(b); //mis a jour de l'etat d'avancement au cas ou. ! if (afficheAvance) { ! if (i > pMax) { ! pourc += pourcStep; ! progress_.setProgression(pourc); ! pMax += pas; ! } ! } } DodicoLib.writeTo(out_, b); --- 164,168 ---- writeln(b); //mis a jour de l'etat d'avancement au cas ou. ! up.majAvancement(); } DodicoLib.writeTo(out_, b); *************** *** 177,199 **** return; } /** ! * */ protected void _write(Object _o) { if (_o instanceof DunesInterface) { ! writeDunes((DunesInterface)_o); } else { analyze_.addFatalError(DodicoResource.getS("Données invalides")); } } /** ! * ! */ public final FileOperationSynthese write(DunesInterface _o) { writeDunes(_o); return closeOperation(_o); } /** ! * */ public FileFormatVersion getVersion() { --- 173,198 ---- return; } + /** ! * * */ protected void _write(Object _o) { if (_o instanceof DunesInterface) { ! writeDunes((DunesInterface) _o); } else { analyze_.addFatalError(DodicoResource.getS("Données invalides")); } } + /** ! * * ! */ public final FileOperationSynthese write(DunesInterface _o) { writeDunes(_o); return closeOperation(_o); } + /** ! * * */ public FileFormatVersion getVersion() { |
|
From: Frederic D. <de...@us...> - 2004-03-31 08:26:20
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/fortran In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9937/src/org/fudaa/dodico/fortran Modified Files: FortranReader.java Log Message: Maj pour solutions initiales Index: FortranReader.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/fortran/FortranReader.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** FortranReader.java 12 Feb 2004 15:32:44 -0000 1.11 --- FortranReader.java 31 Mar 2004 08:14:33 -0000 1.12 *************** *** 12,16 **** --- 12,20 ---- import java.io.LineNumberReader; import java.io.Reader; + import java.util.ArrayList; import java.util.Vector; + + import com.memoire.fu.FuVectorString; + import org.fudaa.dodico.commun.DodicoLib; /** *************** *** 30,34 **** // extends LineNumberReader { ! protected String[] fields; protected String line; // protected int number; --- 34,39 ---- // extends LineNumberReader { ! // protected String[] fields; ! protected ArrayList fields; protected String line; // protected int number; *************** *** 158,166 **** */ public void analyzeCurrentLine(int[] _fmt) throws IOException, EOFException { ! fields= null; if (_fmt != null) { int i, j, l; l= _fmt.length; ! fields= new String[l]; j= 0; int lineLength= line.length(); --- 163,177 ---- */ public void analyzeCurrentLine(int[] _fmt) throws IOException, EOFException { ! if (_fmt != null) { int i, j, l; l= _fmt.length; ! if(fields==null){ ! fields=new ArrayList(l); ! } ! else{ ! fields.clear(); ! fields.ensureCapacity(l); ! } j= 0; int lineLength= line.length(); *************** *** 170,174 **** int fmti; char[] cars; ! StringBuffer tempS; for (i= 0; i < l; i++) { fmti= _fmt[i]; --- 181,185 ---- int fmti; char[] cars; ! StringBuffer tempS=new StringBuffer(); for (i= 0; i < l; i++) { fmti= _fmt[i]; *************** *** 180,184 **** cars= new char[end - begin]; line.getChars(begin, end, cars, 0); ! tempS= new StringBuffer(fmti); tempS.append(cars); // MODIF AXEL --- 191,197 ---- cars= new char[end - begin]; line.getChars(begin, end, cars, 0); ! //tempS= new StringBuffer(fmti); ! tempS.setLength(0); ! tempS.ensureCapacity(fmti); tempS.append(cars); // MODIF AXEL *************** *** 192,196 **** while (tempS.length() < fmti) tempS.append(" "); ! fields[i]= tempS.toString(); j += fmti; } --- 205,210 ---- while (tempS.length() < fmti) tempS.append(" "); ! //fields[i]= tempS.toString(); ! fields.add(tempS.toString()); j += fmti; } *************** *** 222,230 **** * * @see #setCommentInOneField(String) */ public boolean isCommentLine() { if (commentChar_ == null) throw new IllegalArgumentException("Comment char must be set with setCommandInOneField()"); ! if ((fields.length == 1) && (fields[0].startsWith(commentChar_))) return true; return false; --- 236,245 ---- * * @see #setCommentInOneField(String) + * @return true si comment line */ public boolean isCommentLine() { if (commentChar_ == null) throw new IllegalArgumentException("Comment char must be set with setCommandInOneField()"); ! if ((fields.size()== 1) && (((String)fields.get(0)).startsWith(commentChar_))) return true; return false; *************** *** 254,258 **** //on stocke la ligne ... else{ ! fields= new String[] { line }; } return; --- 269,278 ---- //on stocke la ligne ... else{ ! if(fields==null){ ! fields=new ArrayList(20); ! } ! else ! fields.clear(); ! fields.add(line); } return; *************** *** 266,270 **** char[] c= line.toCharArray(); int staille= c.length; ! Vector v= new Vector(21); for (i= 0; i < staille; i++) { // Hors d'un champ --- 286,290 ---- char[] c= line.toCharArray(); int staille= c.length; ! ArrayList v= new ArrayList(21); for (i= 0; i < staille; i++) { // Hors d'un champ *************** *** 292,296 **** // Ajout du champ dans le vecteur des champs if (fieldEnd != -1) { ! v.addElement(line.substring(fieldBegin, fieldEnd)); fieldBegin= -1; fieldEnd= -1; --- 312,316 ---- // Ajout du champ dans le vecteur des champs if (fieldEnd != -1) { ! v.add(line.substring(fieldBegin, fieldEnd)); fieldBegin= -1; fieldEnd= -1; *************** *** 300,309 **** if (fieldBegin != -1) if (!fieldQuote) ! v.addElement(line.substring(fieldBegin, staille)); else System.out.println( "error with field " + line.substring(fieldBegin, staille)); ! fields= new String[v.size()]; ! v.toArray(fields); } //Ancienne version --- 320,328 ---- if (fieldBegin != -1) if (!fieldQuote) ! v.add(line.substring(fieldBegin, staille)); else System.out.println( "error with field " + line.substring(fieldBegin, staille)); ! fields= v; } //Ancienne version *************** *** 322,326 **** char[] c= s.toCharArray(); int staille= c.length; ! Vector v= new Vector(21); // for(i=0; i<s.length(); i++) for (i= 0; i < staille; i++) { --- 341,345 ---- char[] c= s.toCharArray(); int staille= c.length; ! ArrayList v= new ArrayList(21); // for(i=0; i<s.length(); i++) for (i= 0; i < staille; i++) { *************** *** 348,352 **** if (fieldEnd != -1) { String stemp= s.substring(fieldBegin, fieldEnd); ! v.addElement(stemp); fieldBegin= -1; fieldEnd= -1; --- 367,371 ---- if (fieldEnd != -1) { String stemp= s.substring(fieldBegin, fieldEnd); ! v.add(stemp); fieldBegin= -1; fieldEnd= -1; *************** *** 354,361 **** } } ! l= v.size(); ! fields= new String[l]; ! for (i= 0; i < l; i++) ! fields[i]= (String)v.elementAt(i); } protected static String clearSpaces(String s) { --- 373,378 ---- } } ! // l= v.size(); ! fields= v; } protected static String clearSpaces(String s) { *************** *** 386,393 **** public double doubleField(int _i) { double r= 0.; ! if ((fields != null) && (_i < fields.length)) { // r=(new Double(clearSpaces(fields[_i]))).doubleValue(); // String s=clearSpaces(fields[_i]); ! String s= fields[_i].trim(); if (!blankIsZero || s.length() != 0) r= Double.parseDouble(s); --- 403,410 ---- public double doubleField(int _i) { double r= 0.; ! if ((fields != null) && (_i < fields.size())) { // r=(new Double(clearSpaces(fields[_i]))).doubleValue(); // String s=clearSpaces(fields[_i]); ! String s= ((String)fields.get(_i)).trim(); if (!blankIsZero || s.length() != 0) r= Double.parseDouble(s); *************** *** 400,404 **** */ public int getNumberOfFields() { ! return fields == null ? 0 : fields.length; } /** --- 417,421 ---- */ public int getNumberOfFields() { ! return fields == null ? 0 : fields.size(); } /** *************** *** 409,415 **** public int intField(int _i) { int r= 0; ! if ((fields != null) && (_i < fields.length)) { // r=(new Integer(clearSpaces(fields[_i]))).intValue(); ! String s= clearSpaces(fields[_i]); if (!blankIsZero || s.length() != 0) r= Integer.parseInt(s); --- 426,432 ---- public int intField(int _i) { int r= 0; ! if ((fields != null) && (_i < fields.size())) { // r=(new Integer(clearSpaces(fields[_i]))).intValue(); ! String s= clearSpaces((String)fields.get(_i)); if (!blankIsZero || s.length() != 0) r= Integer.parseInt(s); *************** *** 425,430 **** public String stringField(int _i) { String r= ""; ! if ((fields != null) && (_i < fields.length)) ! r= clearSpaces(fields[_i]); if (r.length() >= 2) { char c= r.charAt(0); --- 442,447 ---- public String stringField(int _i) { String r= ""; ! if ((fields != null) && (_i < fields.size())) ! r= clearSpaces((String)fields.get(_i)); if (r.length() >= 2) { char c= r.charAt(0); |
|
From: Frederic D. <de...@us...> - 2004-03-31 08:26:20
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9937/src/org/fudaa/dodico/test Modified Files: TestIO.java TestJStrcuture.java Log Message: Maj pour solutions initiales Index: TestJStrcuture.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/test/TestJStrcuture.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TestJStrcuture.java 22 Mar 2004 10:16:12 -0000 1.2 --- TestJStrcuture.java 31 Mar 2004 08:14:34 -0000 1.3 *************** *** 47,51 **** */ ITestDunes d = null; ! CDodico.findServerNames("::dunes::ITestDunes", 7000); Object o = CDodico.findServerByInterface("::dunes::ITestDunes", 4000); if (o == null) --- 47,51 ---- */ ITestDunes d = null; ! /*CDodico.findServerNames("::dunes::ITestDunes", 7000); Object o = CDodico.findServerByInterface("::dunes::ITestDunes", 4000); if (o == null) *************** *** 54,58 **** o = CDodico.findServerByInterface("::dunes::ITestDunes", 4000); if (o != null) ! d = ITestDunesHelper.narrow(o); if (d == null) { d = UsineHelper.creeUsineLocale().creeDunesTestDunes(); --- 54,58 ---- o = CDodico.findServerByInterface("::dunes::ITestDunes", 4000); if (o != null) ! d = ITestDunesHelper.narrow(o);*/ if (d == null) { d = UsineHelper.creeUsineLocale().creeDunesTestDunes(); Index: TestIO.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/test/TestIO.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** TestIO.java 10 Mar 2004 09:08:37 -0000 1.9 --- TestIO.java 31 Mar 2004 08:14:34 -0000 1.10 *************** *** 12,20 **** import java.net.URL; - import com.memoire.fu.FuLib; - import junit.framework.TestCase; ! import org.fudaa.dodico.fichiers.FileFormat; ! import org.fudaa.dodico.fichiers.FileOperationSynthese; /** * --- 12,18 ---- import java.net.URL; import junit.framework.TestCase; ! ! import com.memoire.fu.FuLib; /** * *************** *** 25,28 **** --- 23,29 ---- protected double eps_; protected File fic_; + /** + * @param _fic le nom du fichier a charger + */ public TestIO(String _fic) { eps_= 1E-15; *************** *** 31,36 **** assertTrue(fic_.exists()); } ! public abstract void testLecture(); ! public File createTempFile() { File f= null; try { --- 32,39 ---- assertTrue(fic_.exists()); } ! /** ! * @return un fichier temporaire ! */ ! public static File createTempFile() { File f= null; try { *************** *** 43,50 **** } public void assertDoubleEquals(double _v1,double _v2){ super.assertEquals(_v1, _v2, eps_); } ! public abstract void testEcriture(); protected final File getFile(String _f) { URL url= getClass().getResource(_f); --- 46,64 ---- } + /** + * Compare 2 doubles avec une precision eps_ ( variable protegee 1e-15). + * @param _v1 le premier double a comparer + * @param _v2 le deuxieme double a comparer + */ public void assertDoubleEquals(double _v1,double _v2){ super.assertEquals(_v1, _v2, eps_); } ! // public abstract void testEcriture(); ! ! /** ! * Permet de trouver une ressource presente dans le rep de la classe donnee ! * @param _f le nom du fichier a trouver ! * @return le fichier ! */ protected final File getFile(String _f) { URL url= getClass().getResource(_f); *************** *** 54,62 **** return f; } public static final File getFile(Class _c, String _f) { URL url= _c.getResource(_f); if (url == null) return null; ! return new File(url.getPath()); } } --- 68,83 ---- return f; } + /** + * Permet de trouver une ressource presente dans le rep de la classe donnee + * @param _c la classe a considerer + * @param _f le nom du fichier a trouver + * @return le fichier + */ public static final File getFile(Class _c, String _f) { URL url= _c.getResource(_f); if (url == null) return null; ! File f=new File(FuLib.decode(url.getPath().substring(1))); ! return f; } } |
|
From: Frederic D. <de...@us...> - 2004-03-31 08:26:20
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/test/h2d In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9937/src/org/fudaa/dodico/test/h2d Modified Files: TestJMaillage.java Log Message: Maj pour solutions initiales Index: TestJMaillage.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/test/h2d/TestJMaillage.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TestJMaillage.java 5 Mar 2004 15:18:25 -0000 1.1 --- TestJMaillage.java 31 Mar 2004 08:14:34 -0000 1.2 *************** *** 134,137 **** --- 134,140 ---- mail_= createMaillageT6(); } + /** + * @return le maillage en version T6 + */ public static EfGrid createMaillageT6() { EfNode[] pts= new EfNode[27]; *************** *** 334,337 **** --- 337,343 ---- _testBordCommunT6(); } + /** + * Teste les bords du maillage + */ public void _testBordCommunT6() { EfFrontier bord= mail_.getFrontiers(); *************** *** 365,368 **** --- 371,383 ---- assertEquals(3, bord.getIdxGlobal(1, 4)); assertEquals(12, bord.getIdxGlobal(1, 5)); + for(int i=0;i<=8;i++){ + assertTrue(mail_.isExtremePoint(i)); + assertFalse(mail_.isMiddlePoint(i)); + } + for(int i=9;i<mail_.getPtsNb();i++){ + assertTrue(mail_.isMiddlePoint(i)); + assertFalse(mail_.isExtremePoint(i)); + } + } public void testT3T6() { |
|
From: Frederic D. <de...@us...> - 2004-03-31 08:26:20
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/telemac In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9937/src/org/fudaa/dodico/telemac Modified Files: TelemacDicoManager.java Log Message: Maj pour solutions initiales Index: TelemacDicoManager.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/telemac/TelemacDicoManager.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** TelemacDicoManager.java 12 Mar 2004 10:16:13 -0000 1.16 --- TelemacDicoManager.java 31 Mar 2004 08:14:34 -0000 1.17 *************** *** 48,55 **** super("org.fudaa.dodico.telemac.dico."); } ! /** ! * ! */ ! public DicoCasFileFormat createFormat(String _s) { if (_s.equals(Telemac2dFileFormat.getInstance().getID())) return Telemac2dFileFormat.getInstance(); --- 48,52 ---- super("org.fudaa.dodico.telemac.dico."); } ! protected DicoCasFileFormat createFormat(String _s) { if (_s.equals(Telemac2dFileFormat.getInstance().getID())) return Telemac2dFileFormat.getInstance(); |
|
From: Frederic D. <de...@us...> - 2004-03-31 08:26:20
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/type In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9937/src/org/fudaa/dodico/h2d/type Modified Files: H2dVariableType.java Log Message: Maj pour solutions initiales Index: H2dVariableType.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/type/H2dVariableType.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** H2dVariableType.java 12 Feb 2004 15:32:45 -0000 1.9 --- H2dVariableType.java 31 Mar 2004 08:14:33 -0000 1.10 *************** *** 34,38 **** new H2dVariableType(2, H2dResource.getS("Côte eau"), "SL") { public double getValue(H2dVariableTypeContainer _c) { ! return _c.getH(); } public boolean canBeTransient(){ --- 34,39 ---- new H2dVariableType(2, H2dResource.getS("Côte eau"), "SL") { public double getValue(H2dVariableTypeContainer _c) { ! new Throwable().printStackTrace(); ! return 0; } public boolean canBeTransient(){ *************** *** 45,48 **** --- 46,62 ---- } }; + + public static final H2dVariableType HAUTEUR_EAU= + new H2dVariableType(2, H2dResource.getS("Hauteur eau"),null) { + public double getValue(H2dVariableTypeContainer _c) { + return _c.getH(); + } + + + public String getCommonUnit(){ + return "m"; + + } + }; public static final H2dVariableType TRACEUR= new H2dVariableType(3, H2dResource.getS("Traceur"), "T") { |
|
From: Frederic D. <de...@us...> - 2004-03-31 08:26:19
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/telemac/io In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9937/src/org/fudaa/dodico/telemac/io Modified Files: TelemacCLAdapter.java Log Message: Maj pour solutions initiales Index: TelemacCLAdapter.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/telemac/io/TelemacCLAdapter.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** TelemacCLAdapter.java 25 Nov 2003 10:11:58 -0000 1.12 --- TelemacCLAdapter.java 31 Mar 2004 08:14:32 -0000 1.13 *************** *** 10,16 **** import org.fudaa.dodico.h2d.telemac.H2dTelemacCLElementSource; import org.fudaa.dodico.h2d.telemac.H2dTelemacCLSourceInterface; - import org.fudaa.dodico.h2d.telemac.H2dTelemacBoundaryCondition; - import org.fudaa.dodico.h2d.type.H2dBoundaryType; - import org.fudaa.dodico.h2d.type.H2dBcType; /** * --- 10,13 ---- *************** *** 29,33 **** /** * Autant que de points frontieres. - * @see org.fudaa.dodico.telemac.io.TelemacCLInterface#getNbLines() */ public int getNbLines() { --- 26,29 ---- |
|
From: Frederic D. <de...@us...> - 2004-03-31 08:26:19
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/commun In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9937/src/org/fudaa/dodico/commun Modified Files: dodico_en.fr_txt DodicoCommandManager.java DodicoLib.java Log Message: Maj pour solutions initiales Index: DodicoLib.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/commun/DodicoLib.java,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** DodicoLib.java 12 Mar 2004 10:16:12 -0000 1.23 --- DodicoLib.java 31 Mar 2004 08:14:32 -0000 1.24 *************** *** 351,363 **** ! public static TObjectDoubleHashMap copy(TObjectDoubleHashMap _m){ ! TObjectDoubleHashMap r=new TObjectDoubleHashMap(_m); ! TObjectDoubleIterator it=_m.iterator(); ! for(int i=_m.size();i-->0;){ ! it.advance(); ! r.put(it.key(),it.value()); ! } ! return r; ! } public static boolean copyFile(File _fileFrom, File _fileTo) { InputStream inBuffer= null; --- 351,355 ---- ! public static boolean copyFile(File _fileFrom, File _fileTo) { InputStream inBuffer= null; *************** *** 598,614 **** return null; } ! public static String[] copy(String[] _init) { ! if (_init == null) ! return null; ! String[] r= new String[_init.length]; ! System.arraycopy(_init, 0, r, 0, _init.length); ! return r; ! } - /** - * Appel la methode getStep(nbIteration,5) - */ - public final static int getStep(int nbIteration) { - return ProgressionUpdater.getStep(nbIteration, 5); - } } --- 590,595 ---- return null; } ! ! } Index: dodico_en.fr_txt =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/commun/dodico_en.fr_txt,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** dodico_en.fr_txt 12 Mar 2004 10:16:11 -0000 1.9 --- dodico_en.fr_txt 31 Mar 2004 08:14:32 -0000 1.10 *************** *** 111,112 **** --- 111,114 ---- Exécutable=Executable Exécuter=Executer + Non compatible=Not compatible + Le fichier {0} n'existe pas=The file {0} does not exist \ No newline at end of file Index: DodicoCommandManager.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/commun/DodicoCommandManager.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** DodicoCommandManager.java 25 Nov 2003 10:11:25 -0000 1.3 --- DodicoCommandManager.java 31 Mar 2004 08:14:32 -0000 1.4 *************** *** 38,42 **** } public void clean() { ! if (cmd_ != null) { cmd_.clear(); indexLastUndoCmd_= 0; --- 38,42 ---- } public void clean() { ! if( (cmd_ != null) && (cmd_.size()>0)){ cmd_.clear(); indexLastUndoCmd_= 0; *************** *** 126,128 **** --- 126,135 ---- } } + /** + * @return Returns the listener. + */ + public DodicoCmdMngListener getListener() { + return listener_; + } + } |
|
From: Frederic D. <de...@us...> - 2004-03-22 10:26:36
|
Update of /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/commun/conversion In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7617/src/org/fudaa/fudaa/commun/conversion Modified Files: FudaaMaillageElement.java FudaaElement.java Log Message: Correction bogue SMaillage Index: FudaaElement.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/commun/conversion/FudaaElement.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** FudaaElement.java 25 Nov 2003 10:13:32 -0000 1.5 --- FudaaElement.java 22 Mar 2004 10:16:19 -0000 1.6 *************** *** 8,11 **** --- 8,14 ---- */ package org.fudaa.fudaa.commun.conversion; + import java.util.Arrays; + + import org.fudaa.dodico.commun.DodicoLib; import org.fudaa.dodico.corba.geometrie.*; import org.fudaa.ebli.geometrie.*; *************** *** 17,27 **** */ public abstract class FudaaElement { /** ! * Translation d'un point SElement vers GrElement */ ! public static GrElement s2Gr(SElement _e) { ! GrNoeud[] noeuds= new GrNoeud[_e.noeuds.length]; for (int i= 0; i < noeuds.length; i++) ! noeuds[i]= FudaaNoeud.s2Gr(_e.noeuds[i]); int type= -1; if (_e.type == LTypeElement.L2) --- 20,34 ---- */ public abstract class FudaaElement { + /** ! * Translation d'un point SElement vers GrElement ! * @param _nds ! * @param _e ! * @return */ ! public static GrElement s2Gr(SNoeud[] _nds,SElement _e) { ! GrNoeud[] noeuds= new GrNoeud[_e.noeudsIdx.length]; for (int i= 0; i < noeuds.length; i++) ! noeuds[i]= FudaaNoeud.s2Gr(_nds[_e.noeudsIdx[i]]); int type= -1; if (_e.type == LTypeElement.L2) *************** *** 40,49 **** } /** ! * Translation d'un point GrElement vers SElement */ ! public static SElement gr2S(GrElement _e) { ! SNoeud[] noeuds= new SNoeud[_e.noeuds.length]; ! for (int i= 0; i < noeuds.length; i++) ! noeuds[i]= FudaaNoeud.gr2S(_e.noeuds[i]); LTypeElement type= null; if (_e.type == GrElement.L2) --- 47,65 ---- } /** ! * Translation d'un point GrElement vers SElement. Les indices de la ! * structure SElement seront determines a partir de la position des ! * points dans le tableau passe en parametre. ! * ! * @param _nds les noeuds du maillage : pour recuperer les indexs ! * @param _e l'element a traduire ! * @return une structure element */ ! public static SElement gr2S(GrNoeud[] _nds,GrElement _e) { ! int[] noeudsIdx= new int[_e.noeuds.length]; ! for (int i= 0; i < noeudsIdx.length; i++){ ! noeudsIdx[i]= DodicoLib.findObject(_nds,_e.noeuds); ! if(noeudsIdx[i]<0) throw new IllegalArgumentException("les noeuds de l'elements ne sont corrects"); ! } ! LTypeElement type= null; if (_e.type == GrElement.L2) *************** *** 59,63 **** else if (_e.type == GrElement.Q8) type= LTypeElement.Q8; ! return new SElement(noeuds, type); } } --- 75,79 ---- else if (_e.type == GrElement.Q8) type= LTypeElement.Q8; ! return new SElement(noeudsIdx, type); } } Index: FudaaMaillageElement.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/commun/conversion/FudaaMaillageElement.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** FudaaMaillageElement.java 19 Mar 2004 17:40:24 -0000 1.6 --- FudaaMaillageElement.java 22 Mar 2004 10:16:19 -0000 1.7 *************** *** 11,14 **** --- 11,15 ---- import java.util.Map; + import org.fudaa.dodico.commun.DodicoLib; import org.fudaa.dodico.corba.geometrie.LTypeElement; import org.fudaa.dodico.corba.geometrie.SElement; *************** *** 35,42 **** Map s2Gr= new Hashtable(sNds.length); SElement el=sEls[0]; - System.out.println(el.noeuds[2].point.x+" "+el.noeuds[2].point.y+" "+el.noeuds[2].point.z); - System.out.println("egal true? "+(el.noeuds[2]==sNds[5422])); - System.out.println("egal true? "+(el.noeuds[0]==sNds[3120])); - System.out.println("egal true? "+(el.noeuds[0].equals(sNds[3120]))); // List lSNds=Arrays.asList(sNds); // Noeuds --- 36,39 ---- *************** *** 45,62 **** s2Gr.put(sNds[i], nds[i]); } - System.out.println("true= "+s2Gr.containsKey(sNds[3120])); - System.out.println("true= "+s2Gr.containsKey(el.noeuds[0])); - System.out.println("true= "+s2Gr.containsKey(sNds[0])); // Elements for (int i= 0; i < sEls.length; i++) { ! SNoeud[] sNdsEl= sEls[i].noeuds; GrNoeud[] ndsEl= new GrNoeud[sNdsEl.length]; int type; for (int j= 0; j < sNdsEl.length; j++){ ! if(!s2Gr.containsKey(sNdsEl[j])){ ! new Throwable(i+" "+j).printStackTrace(); ! return null; ! } ! ndsEl[j]= (GrNoeud)s2Gr.get(sNdsEl[j]); // if(ndsEl[j]==null) System.err.println("Noeuds null elt="+i+" pt idx="+j); } --- 42,52 ---- s2Gr.put(sNds[i], nds[i]); } // Elements for (int i= 0; i < sEls.length; i++) { ! int[] sNdsEl= sEls[i].noeudsIdx; GrNoeud[] ndsEl= new GrNoeud[sNdsEl.length]; int type; for (int j= 0; j < sNdsEl.length; j++){ ! ndsEl[j]= nds[sNdsEl[j]]; // if(ndsEl[j]==null) System.err.println("Noeuds null elt="+i+" pt idx="+j); } *************** *** 94,97 **** --- 84,88 ---- /** * Translation d'une GrMaillageElement vers une SMaillage + * @return le smaillage correspondant */ public static SMaillage gr2S(GrMaillageElement _ml) { *************** *** 100,117 **** SNoeud[] sNds= new SNoeud[nds.length]; SElement[] sEls= new SElement[els.length]; ! Hashtable gr2S= new Hashtable(sNds.length); // List lNds=Arrays.asList(nds); // Noeuds for (int i= 0; i < nds.length; i++) { sNds[i]= FudaaNoeud.gr2S(nds[i]); ! gr2S.put(nds[i], sNds[i]); } // Elements for (int i= 0; i < els.length; i++) { GrNoeud[] ndsEl= els[i].noeuds; ! SNoeud[] sNdsEl= new SNoeud[ndsEl.length]; LTypeElement type; ! for (int j= 0; j < ndsEl.length; j++) ! sNdsEl[j]= (SNoeud)gr2S.get(ndsEl[j]); if (els[i].type == GrElement.L2) type= LTypeElement.L2; --- 91,112 ---- SNoeud[] sNds= new SNoeud[nds.length]; SElement[] sEls= new SElement[els.length]; ! /* Hashtable gr2S= new Hashtable(sNds.length); // List lNds=Arrays.asList(nds); + * */ // Noeuds for (int i= 0; i < nds.length; i++) { sNds[i]= FudaaNoeud.gr2S(nds[i]); ! // gr2S.put(nds[i], sNds[i]); } // Elements for (int i= 0; i < els.length; i++) { GrNoeud[] ndsEl= els[i].noeuds; ! int[] sNdsEl= new int[ndsEl.length]; LTypeElement type; ! for (int j= 0; j < ndsEl.length; j++){ ! sNdsEl[j]= DodicoLib.findObject(nds,ndsEl[j]); ! if(sNdsEl[j]<0) throw new IllegalArgumentException("des noeuds ne sont pas contenus dans le maillage"); ! } ! if (els[i].type == GrElement.L2) type= LTypeElement.L2; |
|
From: Frederic D. <de...@us...> - 2004-03-22 10:26:36
|
Update of /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/commun/modele In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7617/src/org/fudaa/fudaa/commun/modele Modified Files: ModeleSMaillageElement.java Log Message: Correction bogue SMaillage Index: ModeleSMaillageElement.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/commun/modele/ModeleSMaillageElement.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ModeleSMaillageElement.java 25 Nov 2003 10:13:34 -0000 1.6 --- ModeleSMaillageElement.java 22 Mar 2004 10:16:20 -0000 1.7 *************** *** 8,11 **** --- 8,13 ---- */ package org.fudaa.fudaa.commun.modele; + import gnu.trove.TIntObjectHashMap; + import java.util.Hashtable; import java.util.Enumeration; *************** *** 120,127 **** else poly_.sommets.vide(); ! SNoeud[] temp= smaillage_.elements[i].noeuds; ! for (int j= temp.length - 1; j >= 0; j--) poly_.sommets.ajoute( ! new GrPoint(temp[j].point.x, temp[j].point.y, temp[j].point.z)); temp= null; return poly_; --- 122,132 ---- else poly_.sommets.vide(); ! int[] temp= smaillage_.elements[i].noeudsIdx; ! SPoint stemp; ! for (int j= temp.length - 1; j >= 0; j--){ ! stemp=smaillage_.noeuds[temp[j]].point; poly_.sommets.ajoute( ! new GrPoint(stemp.x, stemp.y, stemp.z)); ! } temp= null; return poly_; *************** *** 263,278 **** private GrElement[] s2GrElement() { int nb= nombrePolygones(); ! Hashtable tableNoeud= new Hashtable(getNombreNoeuds()); GrElement[] r= new GrElement[nb]; for (int i= nb - 1; i >= 0; i--) { ! SNoeud[] e= smaillage_.elements[i].noeuds; GrNoeud[] noeuds= new GrNoeud[e.length]; for (int j= noeuds.length - 1; j >= 0; j--) { ! if (!tableNoeud.containsKey(e[j])) { noeuds[j]= ! new GrNoeud(new GrPoint(e[j].point.x, e[j].point.y, e[j].point.z)); ! tableNoeud.put(e[j], noeuds[j]); } else ! noeuds[j]= (GrNoeud) (tableNoeud.get(e[j])); } int type= -1; --- 268,284 ---- private GrElement[] s2GrElement() { int nb= nombrePolygones(); ! TIntObjectHashMap idxNoeud=new TIntObjectHashMap(getNombreNoeuds()); GrElement[] r= new GrElement[nb]; for (int i= nb - 1; i >= 0; i--) { ! int[] e= smaillage_.elements[i].noeudsIdx; GrNoeud[] noeuds= new GrNoeud[e.length]; for (int j= noeuds.length - 1; j >= 0; j--) { ! if (!idxNoeud.containsKey(e[j])) { ! SPoint stemp=smaillage_.noeuds[e[j]].point; noeuds[j]= ! new GrNoeud(new GrPoint(stemp.x, stemp.y, stemp.z)); ! idxNoeud.put(e[j], noeuds[j]); } else ! noeuds[j]= (GrNoeud) (idxNoeud.get(e[j])); } int type= -1; |
|
From: Frederic D. <de...@us...> - 2004-03-22 10:26:35
|
Update of /cvsroot/fudaa/fudaa_devel/fudaa/src/org/fudaa/fudaa/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7617/src/org/fudaa/fudaa/test Added Files: TestJMaillage.java Log Message: Correction bogue SMaillage --- NEW FILE: TestJMaillage.java --- /* * @file TestJMaillage.java * @creation 22 mars 2004 * @modification $Date: 2004/03/22 10:16:19 $ * @license GNU General Public License 2 * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne * @mail fud...@li... */ package org.fudaa.fudaa.test; import junit.framework.TestCase; import org.fudaa.dodico.corba.geometrie.LTypeElement; import org.fudaa.dodico.corba.geometrie.SElement; import org.fudaa.dodico.corba.geometrie.SMaillage; import org.fudaa.dodico.corba.geometrie.SNoeud; import org.fudaa.dodico.corba.geometrie.SPoint; import org.fudaa.ebli.geometrie.GrElement; import org.fudaa.ebli.geometrie.GrMaillageElement; import org.fudaa.ebli.geometrie.GrNoeud; import org.fudaa.fudaa.commun.conversion.FudaaMaillageElement; /** * @author Fred Deniger * @version $Id: TestJMaillage.java,v 1.1 2004/03/22 10:16:19 deniger Exp $ */ public class TestJMaillage extends TestCase { /** * Test les conversions structures/objet Gr */ public void testSToGr(){ SMaillage s=new SMaillage(); SNoeud[] nds=new SNoeud[10]; for(int i=nds.length-1;i>=0;i--){ nds[i]=new SNoeud(new SPoint(Math.random()*100,Math.random()*100,Math.random()*100)); } SElement[] elts=new SElement[15]; for(int i=elts.length-1;i>=0;i--){ elts[i]=new SElement(); elts[i].type=LTypeElement.T3; elts[i].noeudsIdx=new int[3]; for(int j=2;j>=0;j--){ int t=(int)Math.random()*nds.length; if(t<0) t=0; if(t>9) t=9; elts[i].noeudsIdx[j]=t; } } s.noeuds=nds; s.elements=elts; GrMaillageElement m=FudaaMaillageElement.s2Gr(s); assertNotNull(m); GrNoeud[] grNds=m.noeuds(); GrElement[] grElt=m.elements(); assertNotNull(grNds); assertEquals(grNds.length,nds.length); assertEquals(grElt.length,elts.length); for(int i=grNds.length-1;i>=0;i--){ internTest(grNds[i],nds[i]); } for(int i=grElt.length-1;i>=0;i--){ internTest(nds,grElt[i],elts[i]); } SMaillage newM=FudaaMaillageElement.gr2S(m); assertNotNull(newM); assertEquals(newM.noeuds.length,s.noeuds.length); assertEquals(newM.elements.length,s.elements.length); for(int i=newM.noeuds.length-1;i>=0;i--){ internTest(newM.noeuds[i],s.noeuds[i]); } for(int i=newM.elements.length-1;i>=0;i--){ internTest(newM.elements[i],s.elements[i]); } } /** * Test l'equivalence entre un snoeud et un grnoeud. * @param _n le grNoeud a tester * @param _s le SNoeud a tester */ public void internTest(GrNoeud _n,SNoeud _s){ assertEquals(_n.point.x,_s.point.x,1e-15); assertEquals(_n.point.y,_s.point.y,1e-15); assertEquals(_n.point.z,_s.point.z,1e-15); } /** * Test l'egalite entre 2 Snoeuds * @param _n le SNoeud a tester * @param _s le SNoeud a tester */ public void internTest(SNoeud _n,SNoeud _s){ assertEquals(_n.point.x,_s.point.x,1e-15); assertEquals(_n.point.y,_s.point.y,1e-15); assertEquals(_n.point.z,_s.point.z,1e-15); } /** * Test l'equivalence entre un selement et un grelement. * @param _listNds liste des snoeuds * @param _n le grelement a tester * @param _s la structure a tester */ public void internTest(SNoeud[] _listNds,GrElement _n,SElement _s){ assertEquals(_n.noeuds.length,_s.noeudsIdx.length); for(int i=_n.noeuds.length-1;i>=0;i--){ internTest(_n.noeuds[i],_listNds[_s.noeudsIdx[i]]); } } public void internTest(SElement _n,SElement _s){ assertEquals(_n.noeudsIdx.length,_s.noeudsIdx.length); assertEquals(_n.type,_s.type); for(int i=_n.noeudsIdx.length-1;i>=0;i--){ assertEquals(_n.noeudsIdx[i],_s.noeudsIdx[i]); } } } |
|
From: Frederic D. <de...@us...> - 2004-03-22 10:26:28
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7538/src/org/fudaa/dodico/test Modified Files: TestJStrcuture.java Log Message: Correction bogue SMaillage Index: TestJStrcuture.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/test/TestJStrcuture.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TestJStrcuture.java 19 Mar 2004 17:35:57 -0000 1.1 --- TestJStrcuture.java 22 Mar 2004 10:16:12 -0000 1.2 *************** *** 70,74 **** //alors qu'en distant cela plante : les noeuds et element //sont serialise independemment ! assertTrue(elt.noeuds[0].equals(s)); } } --- 70,78 ---- //alors qu'en distant cela plante : les noeuds et element //sont serialise independemment ! /*SNoeud id=elt.noeuds[0]; ! System.out.println(id.point.x+" "+id.point.y+" "+id.point.z); ! assertTrue(id.equals(s));*/ ! // System.out.println(s.point.x+" "+s.point.y+" "+s.point.z); ! } } |
|
From: Frederic D. <de...@us...> - 2004-03-22 10:26:28
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/idl/general In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7538/idl/general Modified Files: geometrie.idl Log Message: Correction bogue SMaillage Index: geometrie.idl =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/idl/general/geometrie.idl,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** geometrie.idl 19 Mar 2004 17:40:17 -0000 1.11 --- geometrie.idl 22 Mar 2004 10:16:12 -0000 1.12 *************** *** 108,112 **** * Noeuds de l'element. */ ! VSNoeud noeuds; /** --- 108,116 ---- * Noeuds de l'element. */ ! //Correction pour eviter les erreurs corba: ! //les points contenus dans noeuds ne sont pas egaux ! //aux pointeurs contenus dans maillage.noeuds ! //VSNoeud noeuds; ! ventier noeudsIdx; /** |
|
From: Frederic D. <de...@us...> - 2004-03-22 10:26:28
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/olb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7538/src/org/fudaa/dodico/olb Modified Files: DResultatsOLB.java DParametresOLB.java Log Message: Correction bogue SMaillage Index: DParametresOLB.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/olb/DParametresOLB.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** DParametresOLB.java 25 Nov 2003 10:11:47 -0000 1.5 --- DParametresOLB.java 22 Mar 2004 10:16:11 -0000 1.6 *************** *** 50,56 **** SNoeud[] nds= _m.noeuds; SElement[] els= _m.elements; ! Hashtable nd2Num= new Hashtable(nds.length); for (int i= 0; i < nds.length; i++) ! nd2Num.put(nds[i], new Integer(i + 1)); System.out.println("Ecriture de " + fichier + ".olb_in"); try { --- 50,56 ---- SNoeud[] nds= _m.noeuds; SElement[] els= _m.elements; ! /*Hashtable nd2Num= new Hashtable(nds.length); for (int i= 0; i < nds.length; i++) ! nd2Num.put(nds[i], new Integer(i + 1));*/ System.out.println("Ecriture de " + fichier + ".olb_in"); try { *************** *** 72,79 **** // <numéro d'élément>,<nombre de noeuds>,<numéros de noeuds> for (int i= 0; i < els.length; i++) { ! SNoeud[] ndsEle= els[i].noeuds; fout.print((i + 1) + " " + ndsEle.length); for (int j= 0; j < ndsEle.length; j++) ! fout.print(" " + ((Integer)nd2Num.get(ndsEle[j])).intValue()); fout.println(); } --- 72,79 ---- // <numéro d'élément>,<nombre de noeuds>,<numéros de noeuds> for (int i= 0; i < els.length; i++) { ! int[] ndsEle= els[i].noeudsIdx; fout.print((i + 1) + " " + ndsEle.length); for (int j= 0; j < ndsEle.length; j++) ! fout.print(" " + (ndsEle[j]+1)); fout.println(); } Index: DResultatsOLB.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/olb/DResultatsOLB.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** DResultatsOLB.java 25 Nov 2003 10:11:47 -0000 1.6 --- DResultatsOLB.java 22 Mar 2004 10:16:11 -0000 1.7 *************** *** 85,91 **** System.err.println("OLB_out Decalage en ligne : " + (i + 1)); int nbNdsEle= finp.intField(1); ! SNoeud[] nds= new SNoeud[nbNdsEle]; for (j= 0; j < nbNdsEle; j++) ! nds[j]= noeuds[finp.intField(j + 2) - 1]; if (nbNdsEle == 3) elements[i]= new SElement(nds, LTypeElement.T3); --- 85,91 ---- System.err.println("OLB_out Decalage en ligne : " + (i + 1)); int nbNdsEle= finp.intField(1); ! int[] nds= new int[nbNdsEle]; for (j= 0; j < nbNdsEle; j++) ! nds[j]= finp.intField(j + 2) - 1; if (nbNdsEle == 3) elements[i]= new SElement(nds, LTypeElement.T3); |
|
From: Frederic D. <de...@us...> - 2004-03-22 10:26:27
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/ef/serviceDunes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7538/src/org/fudaa/dodico/ef/serviceDunes Modified Files: Convertisseur.java Log Message: Correction bogue SMaillage Index: Convertisseur.java =================================================================== RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/ef/serviceDunes/Convertisseur.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Convertisseur.java 25 Nov 2003 10:11:33 -0000 1.6 --- Convertisseur.java 22 Mar 2004 10:16:11 -0000 1.7 *************** *** 8,11 **** --- 8,12 ---- */ package org.fudaa.dodico.ef.serviceDunes; + import org.fudaa.dodico.corba.dunes.ICalculDunes; import org.fudaa.dodico.corba.ef.IElement; *************** *** 29,270 **** import org.fudaa.dodico.objet.CDodico; /** ! * Classe statique de conversion: les methodes statiques convertissent les ! * interfaces en structures et inversement. Toutes les fonctions sont simples. ! * Si les parametres d'entrees sont invalides, un tableau vide est renvoye. ! * ! * @version $Id$ ! * @author deniger */ public class Convertisseur { ! /** ! * Singleton. ! */ ! /** ! * Singleton. ! * ! * Singleton. Singleton. Singleton. Constructeur prive. ! * ! */ ! private Convertisseur() {} ! /** ! * Met a jour les parametres de ICalculDunes a partir des IParametresCalcul ! * issus du modele metier. L'operation est effectuee si les 2 parametres sont ! * non nuls (envoie exceptions sinon). Verifie egalement le typeElement qui ! * doit etre egale a T3 ou T6 pour le code de calcul Dunes (exception sinon). ! * ! * @param _calCode ! * @param _paramMetier ! * @return true si deroulement complet et correct et false sion ! */ ! public static boolean majICalculDunes( ! ICalculDunes _calCode, ! IParametresCalcul _paramMetier) { ! if (_paramMetier == null) { ! CDodico.exception( ! Convertisseur.class, ! "Les parametres metiers sont nuls."); ! return false; ! } ! if (_calCode == null) { ! CDodico.exception(Convertisseur.class, "L'objet ICalculDunes est nul."); ! return false; ! } ! _calCode.optionP(true); ! _calCode.optionQ(_paramMetier.controleAngles()); ! _calCode.optionA(_paramMetier.controleAires()); ! _calCode.optionS(!_paramMetier.ajoutPoints()); ! _calCode.optionO(_paramMetier.maillageParLongueurOnde()); ! _calCode.optionC(_paramMetier.ajoutEnveloppeConvexe()); ! _calCode.optionY(!_paramMetier.ajoutNoeudsContour()); ! _calCode.aireMax(_paramMetier.aireMax()); ! _calCode.angleMin(_paramMetier.angleMin()); ! _calCode.hauteurMer(_paramMetier.hauteurMer()); ! _calCode.periodeHoule(_paramMetier.periodeHoule()); ! _calCode.nombrePointsLongueurOnde(_paramMetier.nombrePoints()); ! //Dunes ne marche qu'avec 2 types d'éléments T3 et T6 le reste est ignoré ! if ((_paramMetier.typeElement() == LTypeElement.T6) ! || (_paramMetier.typeElement() == LTypeElement.T3)) { ! _calCode.typeElementDunes(_paramMetier.typeElement()); ! return true; ! } else { ! CDodico.exception( ! Convertisseur.class, ! "Dunes gère des éléments de type T3 ou T6 uniquement"); ! return false; ! } ! } /** * Conversion d'un IPoint en SPoint. ! * * @param _point ! * @return le SPoint correspondant a _point */ public static SPoint IPoint2S(IPoint _point) { ! if (_point == null) { ! return null; ! } ! SPoint r= new SPoint(); ! double[] p= _point.coordonnees(); ! r.x= p[0]; ! r.y= p[1]; ! r.z= p[2]; ! p= null; ! return r; ! } ! /** ! * Description de la methode ! * ! * @param _point ! * @param _u ! * @return ! */ ! public static IPoint SPoint2I(SPoint _point, IUsine _u) { ! if ((_point == null) || (_u == null)) { ! return null; } ! IPoint r= _u.creeGeometriePoint(); ! r.coordonnees(new double[] { _point.x, _point.y, _point.z }); return r; } /** * Conversion de _points en un tableau de IPoint[]. ! * * @param _points ! * @return le tableau convertit ou un tableau vide si _points est nul. */ public static SPoint[] IPoint2S(IPoint[] _points) { ! if (_points == null) { ! return new SPoint[0]; } ! int longueur= _points.length; ! SPoint[] spoints= new SPoint[longueur]; ! for (int i= longueur - 1; i >= 0; i--) { ! spoints[i]= IPoint2S(_points[i]); } return spoints; } ! /** ! * Description de la methode ! * ! * @param _points ! * @param _u ! * @return ! */ ! public static IPoint[] SPoint2I(SPoint[] _points, IUsine _u) { ! if ((_points == null) || (_u == null)) { ! return null; ! } ! int longueur= _points.length; ! IPoint[] r= new IPoint[longueur]; ! for (int i= longueur - 1; i >= 0; i--) { ! r[i]= SPoint2I(_points[i], _u); ! } ! return r; ! } /** * Conversion de l'interface _poly en Structure. ! * * @param _poly * @return */ public static SPolyligne IPolyligne2S(IPolyligne _poly) { ! if (_poly == null) { ! return null; } ! SPolyligne r= new SPolyligne(); ! int longueur= _poly.points().taille(); ! IPoint[] tempo= new IPoint[longueur]; ! for (int i= 0; i < longueur; i++) { ! tempo[i]= IPointHelper.narrow(_poly.points().element(i)); } ! r.points= IPoint2S(tempo); ! tempo= null; return r; } /** * Conversion du tableau de IPolyligne _polys en Structure. ! * * @param _polys * @return */ public static SPolyligne[] IPolyligne2S(IPolyligne[] _polys) { ! if (_polys == null) { ! return null; } ! int longueur= _polys.length; ! SPolyligne[] r= new SPolyligne[longueur]; ! for (int i= longueur - 1; i >= 0; i--) { ! r[i]= IPolyligne2S(_polys[i]); } return r; } /** * Transforme l'interface _trou en structure equivalente. ! * * @param _trou * @return */ public static STrou ITrou2S(ITrou _trou) { ! if (_trou == null) { ! return null; } ! STrou r= new STrou(); ! r.position= IPoint2S(_trou.position()); return r; } /** ! * Transforme le tableau d'interfaces _trous en tableau de structures ! * equivalentes. ! * * @param _trous * @return */ public static STrou[] ITrou2S(ITrou[] _trous) { ! if (_trous == null) { ! return null; } ! int longueur= _trous.length; ! STrou[] strou= new STrou[longueur]; ! for (int i= longueur - 1; i >= 0; i--) { ! strou[i]= ITrou2S(_trous[i]); } return strou; } /** ! * Transforme l'interface _region en structure equivalente. ! * ! * @param _region * @return */ ! public static SRegion IRegion2S(IRegion _region) { ! if (_region == null) { return null; } - SRegion r= new SRegion(); - r.position= IPoint2S(_region.position()); - r.aireMaxElement= _region.aireMaxElement(); return r; } /** ! * Transforme le tableau d'interfaces _regions en tableau de structures ! * equivalentes. ! * ! * @param _regions * @return */ ! public static SRegion[] IRegion2S(IRegion[] _regions) { ! if (_regions == null) { ! return new SRegion[0]; ! } ! int longueur= _regions.length; ! SRegion[] sregion= new SRegion[longueur]; ! for (int i= longueur - 1; i >= 0; i--) { ! sregion[i]= IRegion2S(_regions[i]); } ! return sregion; } /** * Transforme l'interface _noeud en structure equivalente. ! * * @param _noeud * @param _u --- 30,299 ---- import org.fudaa.dodico.objet.CDodico; /** ! * Classe statique de conversion: les methodes statiques convertissent les interfaces en structures ! * et inversement. Toutes les fonctions sont simples. Si les parametres d'entrees sont invalides, ! * un tableau vide est renvoye. ! * ! * @version $Id$ ! * @author deniger */ public class Convertisseur { ! /** * Conversion d'un IPoint en SPoint. ! * * @param _point ! * @return le SPoint correspondant a _point */ public static SPoint IPoint2S(IPoint _point) { ! if (_point == null) { ! return null; } ! SPoint r = new SPoint(); ! double[] p = _point.coordonnees(); ! r.x = p[0]; ! r.y = p[1]; ! r.z = p[2]; ! p = null; return r; } + /** * Conversion de _points en un tableau de IPoint[]. ! * * @param _points ! * @return le tableau convertit ou un tableau vide si _points est nul. */ public static SPoint[] IPoint2S(IPoint[] _points) { ! if (_points == null) { ! return new SPoint[0]; } ! int longueur = _points.length; ! SPoint[] spoints = new SPoint[longueur]; ! for (int i = longueur - 1; i >= 0; i--) { ! spoints[i] = IPoint2S(_points[i]); } return spoints; } ! /** * Conversion de l'interface _poly en Structure. ! * * @param _poly * @return */ public static SPolyligne IPolyligne2S(IPolyligne _poly) { ! if (_poly == null) { ! return null; } ! SPolyligne r = new SPolyligne(); ! int longueur = _poly.points().taille(); ! IPoint[] tempo = new IPoint[longueur]; ! for (int i = 0; i < longueur; i++) { ! tempo[i] = IPointHelper.narrow(_poly.points().element(i)); } ! r.points = IPoint2S(tempo); ! tempo = null; return r; } + /** * Conversion du tableau de IPolyligne _polys en Structure. ! * * @param _polys * @return */ public static SPolyligne[] IPolyligne2S(IPolyligne[] _polys) { ! if (_polys == null) { ! return null; } ! int longueur = _polys.length; ! SPolyligne[] r = new SPolyligne[longueur]; ! for (int i = longueur - 1; i >= 0; i--) { ! r[i] = IPolyligne2S(_polys[i]); } return r; } + + /** + * Transforme l'interface _region en structure equivalente. + * + * @param _region + * @return + */ + public static SRegion IRegion2S(IRegion _region) { + if (_region == null) { + return null; + } + SRegion r = new SRegion(); + r.position = IPoint2S(_region.position()); + r.aireMaxElement = _region.aireMaxElement(); + return r; + } + + /** + * Transforme le tableau d'interfaces _regions en tableau de structures equivalentes. + * + * @param _regions + * @return + */ + public static SRegion[] IRegion2S(IRegion[] _regions) { + if (_regions == null) { + return new SRegion[0]; + } + int longueur = _regions.length; + SRegion[] sregion = new SRegion[longueur]; + for (int i = longueur - 1; i >= 0; i--) { + sregion[i] = IRegion2S(_regions[i]); + } + return sregion; + } + /** * Transforme l'interface _trou en structure equivalente. ! * * @param _trou * @return */ public static STrou ITrou2S(ITrou _trou) { ! if (_trou == null) { ! return null; } ! STrou r = new STrou(); ! r.position = IPoint2S(_trou.position()); return r; } + /** ! * Transforme le tableau d'interfaces _trous en tableau de structures equivalentes. ! * * @param _trous * @return */ public static STrou[] ITrou2S(ITrou[] _trous) { ! if (_trous == null) { ! return null; } ! int longueur = _trous.length; ! STrou[] strou = new STrou[longueur]; ! for (int i = longueur - 1; i >= 0; i--) { ! strou[i] = ITrou2S(_trous[i]); } return strou; } + /** ! * Met a jour les parametres de ICalculDunes a partir des IParametresCalcul issus du modele ! * metier. L'operation est effectuee si les 2 parametres sont non nuls (envoie exceptions sinon). ! * Verifie egalement le typeElement qui doit etre egale a T3 ou T6 pour le code de calcul Dunes ! * (exception sinon). ! * ! * @param _calCode ! * @param _paramMetier ! * @return true si deroulement complet et correct et false sion ! */ ! public static boolean majICalculDunes( ! ICalculDunes _calCode, ! IParametresCalcul _paramMetier) { ! if (_paramMetier == null) { ! CDodico.exception( ! Convertisseur.class, ! "Les parametres metiers sont nuls."); ! return false; ! } ! if (_calCode == null) { ! CDodico.exception(Convertisseur.class, "L'objet ICalculDunes est nul."); ! return false; ! } ! _calCode.optionP(true); ! _calCode.optionQ(_paramMetier.controleAngles()); ! _calCode.optionA(_paramMetier.controleAires()); ! _calCode.optionS(!_paramMetier.ajoutPoints()); ! _calCode.optionO(_paramMetier.maillageParLongueurOnde()); ! _calCode.optionC(_paramMetier.ajoutEnveloppeConvexe()); ! _calCode.optionY(!_paramMetier.ajoutNoeudsContour()); ! _calCode.aireMax(_paramMetier.aireMax()); ! _calCode.angleMin(_paramMetier.angleMin()); ! _calCode.hauteurMer(_paramMetier.hauteurMer()); ! _calCode.periodeHoule(_paramMetier.periodeHoule()); ! _calCode.nombrePointsLongueurOnde(_paramMetier.nombrePoints()); ! //Dunes ne marche qu'avec 2 types d'éléments T3 et T6 le reste est ignoré ! if ((_paramMetier.typeElement() == LTypeElement.T6) ! || (_paramMetier.typeElement() == LTypeElement.T3)) { ! _calCode.typeElementDunes(_paramMetier.typeElement()); ! return true; ! } else { ! CDodico.exception( ! Convertisseur.class, ! "Dunes gère des éléments de type T3 ou T6 uniquement"); ! return false; ! } ! } ! ! /** ! * Transforme le tableau d'interfaces _elements en tableau de structures equivalentes. ! * ! * @param _elements ! * @param _u * @return */ ! public static IElement[] SElement2I(SNoeud[] _nds,SElement[] _elements, IUsine _u) { ! if ((_elements == null) || (_u == null)) { ! return new IElement[0]; ! } ! int longueur = _elements.length; ! IElement[] ielem = new IElement[longueur]; ! for (int i = longueur - 1; i >= 0; i--) { ! ielem[i] = SElement2I(_nds,_elements[i], _u); ! } ! return ielem; ! } ! ! /** ! * Transforme l'interface _element en structure equivalente. ! * ! * @param _element ! * @param _u ! * @param _pts les noeuds du maillage ! * @return ! */ ! public static IElement SElement2I(SNoeud[] _pts, SElement _element, IUsine _u) { ! if ((_element == null) || (_u == null)) { ! return null; ! } ! IElement r = _u.creeEfElement(); ! SNoeud[] snds = new SNoeud[_element.noeudsIdx.length]; ! for (int j = _element.noeudsIdx.length - 1; j >= 0; j--) { ! snds[j] = _pts[_element.noeudsIdx[j]]; ! } ! r.noeuds(SNoeud2I(snds, _u)); ! if ((_element.type == LTypeElement.T3) ! || (_element.type == LTypeElement.T6)) { ! r.type(_element.type); ! } else { ! CDodico.exception( ! Convertisseur.class, ! "Dunes gère des éléments de type T3 ou T6 uniquement"); return null; } return r; } + /** ! * @param _smaillage ! * @param _u * @return */ ! public static IMaillage SMaillage2I(SMaillage _smaillage, IUsine _u) { ! if ((_smaillage == null) || (_u == null)) { ! return null; } ! IMaillage r = _u.creeEfMaillage(); ! r.elements(SElement2I(_smaillage.noeuds,_smaillage.elements, _u)); ! return r; } + /** * Transforme l'interface _noeud en structure equivalente. ! * * @param _noeud * @param _u *************** *** 272,286 **** */ public static INoeud SNoeud2I(SNoeud _noeud, IUsine _u) { ! if ((_noeud == null) || (_u == null)) { ! return null; } ! INoeud r= _u.creeEfNoeud(); r.point(SPoint2I(_noeud.point, _u)); return r; } /** ! * Transforme le tableau d'interfaces _noeuds en tableau de structures ! * equivalentes. ! * * @param _noeuds * @param _u --- 301,315 ---- */ public static INoeud SNoeud2I(SNoeud _noeud, IUsine _u) { ! if ((_noeud == null) || (_u == null)) { ! return null; } ! INoeud r = _u.creeEfNoeud(); r.point(SPoint2I(_noeud.point, _u)); return r; } + /** ! * Transforme le tableau d'interfaces _noeuds en tableau de structures equivalentes. ! * * @param _noeuds * @param _u *************** *** 288,357 **** */ public static INoeud[] SNoeud2I(SNoeud[] _noeuds, IUsine _u) { ! if ((_noeuds == null) || (_u == null)) { ! return new INoeud[0]; } ! int longueur= _noeuds.length; ! INoeud[] inoeud= new INoeud[longueur]; ! for (int i= longueur - 1; i >= 0; i--) { ! inoeud[i]= SNoeud2I(_noeuds[i], _u); } return inoeud; } /** ! * Transforme l'interface _element en structure equivalente. ! * ! * @param _element * @param _u * @return */ ! public static IElement SElement2I(SElement _element, IUsine _u) { ! if ((_element == null) || (_u == null)) { ! return null; ! } ! IElement r= _u.creeEfElement(); ! r.noeuds(SNoeud2I(_element.noeuds, _u)); ! if ((_element.type == LTypeElement.T3) ! || (_element.type == LTypeElement.T6)) { ! r.type(_element.type); ! } else { ! CDodico.exception( ! Convertisseur.class, ! "Dunes gère des éléments de type T3 ou T6 uniquement"); ! return null; } return r; } /** ! * Transforme le tableau d'interfaces _elements en tableau de structures ! * equivalentes. ! * ! * @param _elements * @param _u * @return */ ! public static IElement[] SElement2I(SElement[] _elements, IUsine _u) { ! if ((_elements == null) || (_u == null)) { ! return new IElement[0]; } ! int longueur= _elements.length; ! IElement[] ielem= new IElement[longueur]; ! int pc= 0; ! for (int i= longueur - 1; i >= 0; i--) { ! ielem[i]= SElement2I(_elements[i], _u); } ! return ielem; } /** ! * @param _smaillage ! * @param _u ! * @return */ ! public static IMaillage SMaillage2I(SMaillage _smaillage, IUsine _u) { ! if ((_smaillage == null) || (_u == null)) { ! return null; ! } ! IMaillage r= _u.creeEfMaillage(); ! r.elements(SElement2I(_smaillage.elements, _u)); ! return r; ! } } --- 317,372 ---- */ public static INoeud[] SNoeud2I(SNoeud[] _noeuds, IUsine _u) { ! if ((_noeuds == null) || (_u == null)) { ! return new INoeud[0]; } ! int longueur = _noeuds.length; ! INoeud[] inoeud = new INoeud[longueur]; ! for (int i = longueur - 1; i >= 0; i--) { ! inoeud[i] = SNoeud2I(_noeuds[i], _u); } return inoeud; } + /** ! * Description de la methode ! * ! * @param _point * @param _u * @return */ ! public static IPoint SPoint2I(SPoint _point, IUsine _u) { ! if ((_point == null) || (_u == null)) { ! return null; } + IPoint r = _u.creeGeometriePoint(); + r.coordonnees(new double[] { _point.x, _point.y, _point.z}); return r; } + /** ! * Description de la methode ! * ! * @param _points * @param _u * @return */ ! public static IPoint[] SPoint2I(SPoint[] _points, IUsine _u) { ! if ((_points == null) || (_u == null)) { ! return null; } ! int longueur = _points.length; ! IPoint[] r = new IPoint[longueur]; ! for (int i = longueur - 1; i >= 0; i--) { ! r[i] = SPoint2I(_points[i], _u); } ! return r; } + /** ! * Singleton. */ ! /** ! * Singleton. Singleton. Singleton. Singleton. Constructeur prive. ! */ ! private Convertisseur() {} } |