|
From: <de...@us...> - 2011-11-02 23:31:04
|
Revision: 6606
http://fudaa.svn.sourceforge.net/fudaa/?rev=6606&view=rev
Author: deniger
Date: 2011-11-02 23:30:57 +0000 (Wed, 02 Nov 2011)
Log Message:
-----------
Modified Paths:
--------------
trunk/business/dodico-h2d/core/src/main/resources/org/fudaa/dodico/h2d/resource/h2d_en.fr_txt
trunk/business/dodico-h2d/io/src/main/java/org/fudaa/dodico/rubar/io/RubarVENResult.java
trunk/business/dodico-h2d/io/src/main/java/org/fudaa/dodico/rubar/io/RubarVENWriter.java
trunk/business/dodico-h2d/io/src/test/java/org/fudaa/dodico/rubar/io/TestRubarVENFileFormat.java
Added Paths:
-----------
trunk/business/dodico-h2d/core/src/main/java/org/fudaa/dodico/h2d/rubar/H2dRubarVentInterface.java
trunk/business/dodico-h2d/core/src/main/java/org/fudaa/dodico/h2d/rubar/H2dRubarVentListener.java
trunk/business/dodico-h2d/core/src/main/java/org/fudaa/dodico/h2d/rubar/H2dRubarVentMng.java
Added: trunk/business/dodico-h2d/core/src/main/java/org/fudaa/dodico/h2d/rubar/H2dRubarVentInterface.java
===================================================================
--- trunk/business/dodico-h2d/core/src/main/java/org/fudaa/dodico/h2d/rubar/H2dRubarVentInterface.java (rev 0)
+++ trunk/business/dodico-h2d/core/src/main/java/org/fudaa/dodico/h2d/rubar/H2dRubarVentInterface.java 2011-11-02 23:30:57 UTC (rev 6606)
@@ -0,0 +1,47 @@
+/*
+ * @creation 14 d\xE9c. 2004
+ * @modification $Date: 2006-04-19 13:19:39 $
+ * @license GNU General Public License 2
+ * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
+ * @mail de...@fu...
+ */
+package org.fudaa.dodico.h2d.rubar;
+
+import org.fudaa.dodico.mesure.EvolutionReguliere;
+
+/**
+ * @author Fred Deniger
+ * @version $Id: H2dRubarAppInterface.java,v 1.4 2006-04-19 13:19:39 deniger Exp $
+ */
+public interface H2dRubarVentInterface {
+
+ /**
+ * @return le nombre d'element d\xE9fini par cette resultat
+ */
+ int getNbElt();
+
+ /**
+ * @return le nombre d'element d\xE9fini par cette resultat
+ */
+ int getNbEvol();
+
+ /**
+ * @param idx l'indice [0;getNbEvol()[
+ * @return l'evolution correspondante.
+ */
+ EvolutionReguliere getEvolutionAlongX(int idx);
+ EvolutionReguliere getEvolutionAlongY(int idx);
+
+ /**
+ * @param idxElt l'indice [0;getNbElt()[
+ * @return l'evol correspondante
+ */
+ EvolutionReguliere getEvolAlongXForElt(int idxElt);
+ EvolutionReguliere getEvolAlongYForElt(int idxElt);
+
+ /**
+ * @param eltIdx l'element demande
+ * @return l'indice de la courbe correspondante
+ */
+ int getEvolIdx(int eltIdx);
+}
\ No newline at end of file
Added: trunk/business/dodico-h2d/core/src/main/java/org/fudaa/dodico/h2d/rubar/H2dRubarVentListener.java
===================================================================
--- trunk/business/dodico-h2d/core/src/main/java/org/fudaa/dodico/h2d/rubar/H2dRubarVentListener.java (rev 0)
+++ trunk/business/dodico-h2d/core/src/main/java/org/fudaa/dodico/h2d/rubar/H2dRubarVentListener.java 2011-11-02 23:30:57 UTC (rev 6606)
@@ -0,0 +1,41 @@
+/*
+ * @creation 14 d\xE9c. 2004
+ * @modification $Date: 2006-04-19 13:19:39 $
+ * @license GNU General Public License 2
+ * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
+ * @mail de...@fu...
+ */
+package org.fudaa.dodico.h2d.rubar;
+
+import org.fudaa.dodico.mesure.EvolutionReguliereInterface;
+
+/**
+ * @author Fred Deniger
+ * @version $Id: H2dRubarApportListener.java,v 1.4 2006-04-19 13:19:39 deniger Exp $
+ */
+public interface H2dRubarVentListener {
+
+ /**
+ * Envoye lorsque le contenu a ete modifie.
+ *
+ * @param _mng le manager d'apport
+ * @param _dest l'evolution modifiee
+ */
+ void ventEvolutionContentChanged(H2dRubarVentMng _mng, EvolutionReguliereInterface _dest);
+
+ /**
+ * Envoye lorsque les affectations d'evolution sur les element ont ete modifiees.
+ *
+ * @param _mng le manager d'apport
+ */
+ void ventChanged(H2dRubarVentMng _mng);
+
+ /**
+ * Utilise lorsqu'une evolution devient ou n'est plus utilisee.
+ *
+ * @param _mng le manager d'apport
+ * @param _dest l'evolution qui n'est plus ou devient utilise
+ */
+ void ventEvolutionUsedChanged(H2dRubarVentMng _mng, EvolutionReguliereInterface _dest);
+
+}
Added: trunk/business/dodico-h2d/core/src/main/java/org/fudaa/dodico/h2d/rubar/H2dRubarVentMng.java
===================================================================
--- trunk/business/dodico-h2d/core/src/main/java/org/fudaa/dodico/h2d/rubar/H2dRubarVentMng.java (rev 0)
+++ trunk/business/dodico-h2d/core/src/main/java/org/fudaa/dodico/h2d/rubar/H2dRubarVentMng.java 2011-11-02 23:30:57 UTC (rev 6606)
@@ -0,0 +1,452 @@
+/*
+ * @creation 14 d\xE9c. 2004
+ *
+ * @modification $Date: 2007-05-22 13:11:25 $
+ *
+ * @license GNU General Public License 2
+ *
+ * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
+ *
+ * @mail de...@fu...
+ */
+package org.fudaa.dodico.h2d.rubar;
+
+import gnu.trove.TDoubleHashSet;
+import gnu.trove.TIntObjectHashMap;
+import gnu.trove.TObjectIntHashMap;
+import gnu.trove.TObjectIntIterator;
+
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
+
+import org.fudaa.ctulu.CtuluCommandContainer;
+import org.fudaa.ctulu.CtuluLibString;
+import org.fudaa.ctulu.CtuluNumberFormater;
+import org.fudaa.ctulu.CtuluResource;
+import org.fudaa.ctulu.collection.CtuluArrayObject;
+import org.fudaa.ctulu.fileformat.FortranLib;
+
+import org.fudaa.dodico.h2d.H2dEvolutionUseCounter;
+import org.fudaa.dodico.h2d.resource.H2dResource;
+import org.fudaa.dodico.h2d.type.H2dVariableTransType;
+import org.fudaa.dodico.mesure.EvolutionListener;
+import org.fudaa.dodico.mesure.EvolutionReguliere;
+import org.fudaa.dodico.mesure.EvolutionReguliereAbstract;
+import org.fudaa.dodico.mesure.EvolutionReguliereInterface;
+
+/**
+ * @author Fred Deniger
+ * @version $Id: H2dRubarApportSpatialMng.java,v 1.14 2007-05-22 13:11:25 deniger Exp $
+ */
+public class H2dRubarVentMng implements EvolutionListener {
+
+ private class ApportModelObject extends CtuluArrayObject {
+
+ /**
+ * @param _nb
+ */
+ public ApportModelObject(final int _nb) {
+ super(_nb);
+ }
+
+ protected boolean internalSet(final int _i, final Object _newV) {
+ if (super.list_[_i] != _newV) {
+ if (super.list_[_i] != null) {
+ final H2dRubarEvolution e = (H2dRubarEvolution) super.list_[_i];
+ e.setUnUsed(false);
+ if (e.getUsed() == 0) {
+ updateUsedCourbe(e);
+ }
+ }
+ if (_newV != null) {
+ final H2dRubarEvolution e = (H2dRubarEvolution) _newV;
+ e.setListener(H2dRubarVentMng.this);
+ e.setUsed(false);
+ if (e.getUsed() == 1) {
+ updateUsedCourbe(e);
+ }
+ }
+ return super.internalSet(_i, _newV);
+ }
+ return false;
+ }
+
+ protected void fireObjectChanged(int _indexGeom, Object _newValue) {
+ appEvolChanged();
+ }
+ }
+
+ final static CtuluNumberFormater APP_TIME_FORMAT = FortranLib.getFormater(15, 4, true);
+
+ CtuluArrayObject eltXIdx_;
+ CtuluArrayObject eltYIdx_;
+
+ Set listener_;
+ int nbElt_;
+
+ /**
+ * @return le nombre d'element
+ */
+ public final int getNbElt() {
+ return nbElt_;
+ }
+
+ /**
+ * @param _app l
+ */
+ public H2dRubarVentMng(final H2dRubarVentInterface _app) {
+ nbElt_ = _app.getNbElt();
+ createModel();
+ final TIntObjectHashMap intEvolX = new TIntObjectHashMap();
+ final TIntObjectHashMap intEvolY = new TIntObjectHashMap();
+ int idx = 1;
+ for (int i = nbElt_ - 1; i >= 0; i--) {
+ // l'evolution est deja enregistree: on la reprend
+ int evolIdx = _app.getEvolIdx(i);
+ if (intEvolX.contains(evolIdx)) {
+ eltXIdx_.set(i, intEvolX.get(evolIdx));
+ eltYIdx_.set(i, intEvolY.get(evolIdx));
+ } else {
+ EvolutionReguliere evolX = _app.getEvolAlongXForElt(i);
+ EvolutionReguliere evolY = _app.getEvolAlongYForElt(i);
+ // l'evolution est vide, on met une valeur nulle
+ if (!isEvolEmpty(evolX) || !isEvolEmpty(evolY)) {
+ // a continer
+ final H2dRubarEvolution finalEvolX = H2dRubarEvolution.createH2dRubarEvolution(H2dVariableTransType.VENT_X,
+ evolX, this);
+ final H2dRubarEvolution finalEvolY = H2dRubarEvolution.createH2dRubarEvolution(H2dVariableTransType.VENT_Y,
+ evolY, this);
+ finalEvolX.setNom(H2dResource.getS("Vent X") + CtuluLibString.ESPACE + (idx));
+ finalEvolY.setNom(H2dResource.getS("Vent Y") + CtuluLibString.ESPACE + (idx++));
+ eltXIdx_.set(i, finalEvolX);
+ eltYIdx_.set(i, finalEvolY);
+ intEvolX.put(evolIdx, finalEvolX);
+ intEvolY.put(evolIdx, finalEvolY);
+ }
+ }
+ }
+ }
+
+ /**
+ * @return l'interface a utiliser pour sauvegarder les chroniques d'apport
+ */
+ public H2dRubarVentInterface getSavedInterface() {
+ return new SaveAdapter();
+ }
+
+ private class SaveAdapter implements H2dRubarVentInterface {
+
+ int[] idx_;
+ EvolutionReguliere[] evolsX_;
+ EvolutionReguliere[] evolsY_;
+
+ protected SaveAdapter() {
+ final int nbElt = eltXIdx_.getSize();
+ idx_ = new int[nbElt];
+ int tmp = 0;
+ final Map<H2dRubarEvolution, TObjectIntHashMap<H2dRubarEvolution>> evolXevolYIndice = new HashMap<H2dRubarEvolution, TObjectIntHashMap<H2dRubarEvolution>>();
+ for (int i = 0; i < nbElt; i++) {
+ H2dRubarEvolution ex = H2dRubarVentMng.this.getEvolutionAlongX(i);
+ H2dRubarEvolution ey = H2dRubarVentMng.this.getEvolutionAlongY(i);
+ // si null on met l'evolution vide
+ if (ex == null) {
+ ex = H2dRubarApportSpatialMng.EMPTY_EVOL;
+ }
+ if (ey == null) {
+ ey = H2dRubarApportSpatialMng.EMPTY_EVOL;
+ }
+ boolean found = false;
+ if (evolXevolYIndice.containsKey(ex)) {
+ TObjectIntHashMap<H2dRubarEvolution> evoly = evolXevolYIndice.get(ex);
+ if (evoly != null && evoly.contains(ey)) {
+ found = true;
+ idx_[i] = evoly.get(ey);
+ }
+ if (!found) {
+ TObjectIntHashMap<H2dRubarEvolution> IdByevolY = evolXevolYIndice.get(ex);
+ if (IdByevolY == null) {
+ IdByevolY = new TObjectIntHashMap<H2dRubarEvolution>();
+ evolXevolYIndice.put(ex, IdByevolY);
+ }
+ IdByevolY.put(ey, tmp);
+ idx_[i] = tmp++;
+ }
+ }
+ }
+ evolsX_ = new EvolutionReguliere[tmp];
+ evolsY_ = new EvolutionReguliere[tmp];
+ for (Entry<H2dRubarEvolution, TObjectIntHashMap<H2dRubarEvolution>> entry : evolXevolYIndice.entrySet()) {
+ final TObjectIntIterator<H2dRubarEvolution> it = entry.getValue().iterator();
+ for (int i = tmp; i-- > 0;) {
+ it.advance();
+ EvolutionReguliere ex = entry.getKey();
+ EvolutionReguliere ey = it.key();
+ TDoubleHashSet commonX = new TDoubleHashSet();
+ if (!ex.isEvolutionWithSameX(ey, commonX)) {
+ final double[] common = commonX.toArray();
+ Arrays.sort(common);
+ ex = ex.createEvolutionFromInterpolation(common);
+ ey = ey.createEvolutionFromInterpolation(common);
+
+ }
+ evolsX_[it.value()] = ex;
+ evolsY_[it.value()] = ey;
+ }
+
+ }
+
+ }
+
+ @Override
+ public EvolutionReguliere getEvolAlongXForElt(int idxElt) {
+ return evolsX_[idx_[idxElt]];
+ }
+
+ @Override
+ public EvolutionReguliere getEvolAlongYForElt(int idxElt) {
+ return evolsY_[idx_[idxElt]];
+ }
+
+ @Override
+ public EvolutionReguliere getEvolutionAlongX(int idx) {
+ return evolsX_[idx];
+ }
+
+ @Override
+ public EvolutionReguliere getEvolutionAlongY(int idx) {
+ return evolsY_[idx];
+ }
+
+ public int getEvolIdx(final int _eltIdx) {
+ return idx_[_eltIdx];
+ }
+
+ public int getNbElt() {
+ return idx_.length;
+ }
+
+ public int getNbEvol() {
+ return evolsX_.length;
+ }
+ }
+
+ public void fillWithTransientCurves(final H2dEvolutionUseCounter _r) {
+ if (eltYIdx_ != null) {
+ for (int i = eltYIdx_.getSize() - 1; i >= 0; i--) {
+ final H2dRubarEvolution ex = (H2dRubarEvolution) eltXIdx_.getObjectValueAt(i);
+ if (ex != null) {
+ _r.add(ex, H2dVariableTransType.VENT_X, i);
+ }
+ final H2dRubarEvolution ey = (H2dRubarEvolution) eltYIdx_.getObjectValueAt(i);
+ if (ey != null) {
+ _r.add(ey, H2dVariableTransType.VENT_Y, i);
+ }
+ }
+ }
+ }
+
+ Set<H2dRubarEvolution> evolutionsUsed_;
+
+ protected void updateUsedCourbe(final H2dRubarEvolution _e) {
+ if (_e.isUsed() && !evolutionsUsed_.contains(_e)) {
+ evolutionsUsed_.add(_e);
+ appEvolIsUsedChanged(_e);
+ } else if ((!_e.isUsed()) && evolutionsUsed_.contains(_e)) {
+ evolutionsUsed_.remove(_e);
+ appEvolIsUsedChanged(_e);
+ }
+
+ }
+
+ /**
+ * @return tableau des courbes utilisees.
+ */
+ public EvolutionReguliereAbstract[] getUsedCourbes() {
+ if (eltXIdx_ != null) {
+ final EvolutionReguliereAbstract[] rf = new EvolutionReguliereAbstract[evolutionsUsed_.size()];
+ evolutionsUsed_.toArray(rf);
+ return rf;
+ }
+ return null;
+
+ }
+
+ /**
+ * @param _evol l'evolution a tester
+ * @return true si evolution vide
+ */
+ protected static boolean isEvolEmpty(final EvolutionReguliereInterface _evol) {
+ if (_evol == null || _evol.getNbValues() == 0) {
+ return true;
+ }
+ if (_evol.getNbValues() == 1) {
+ return (_evol.getX(0) == 0) && (_evol.getY(0) == 0);
+ }
+ return false;
+
+ }
+
+ public H2dRubarVentMng(final int _nbElt) {
+ nbElt_ = _nbElt;
+ }
+
+ protected final void createModel() {
+ if (eltXIdx_ == null) {
+ eltXIdx_ = new ApportModelObject(nbElt_);
+ eltYIdx_ = new ApportModelObject(nbElt_);
+ evolutionsUsed_ = new HashSet();
+ }
+ }
+
+ /**
+ * @param _l le listener a ajouter
+ */
+ public void addAppListener(final H2dRubarApportListener _l) {
+ if (listener_ == null) {
+ listener_ = new HashSet(3);
+ }
+ listener_.add(_l);
+ }
+
+ public void clear(final CtuluCommandContainer _cmd) {
+ if (eltXIdx_ != null) {
+ final int[] idx = new int[nbElt_];
+ for (int i = nbElt_ - 1; i >= 0; i--) {
+ idx[i] = i;
+ }
+ eltXIdx_.set(idx, null, _cmd);
+ eltYIdx_.set(idx, null, _cmd);
+ }
+ }
+
+ /**
+ * @param _l le listener a tester
+ * @return true si est contenu
+ */
+ public boolean containsAppListener(final H2dRubarApportListener _l) {
+ return (listener_ != null) && listener_.contains(_l);
+ }
+
+ public void evolutionChanged(final EvolutionReguliereInterface _e) {
+ if (listener_ != null) {
+ for (final Iterator it = listener_.iterator(); it.hasNext();) {
+ ((H2dRubarVentListener) it.next()).ventEvolutionContentChanged(this, _e);
+ }
+ }
+ }
+
+ public void evolutionUsedChanged(final EvolutionReguliereInterface _e, final int _old, final int _new,
+ final boolean _isAdjusting) {
+ }
+
+ protected void appEvolChanged() {
+ if (listener_ != null) {
+ for (final Iterator it = listener_.iterator(); it.hasNext();) {
+ ((H2dRubarVentListener) it.next()).ventChanged(this);
+ }
+ }
+ }
+
+ protected void appEvolIsUsedChanged(final EvolutionReguliereInterface _e) {
+ if (listener_ != null) {
+ for (final Iterator it = listener_.iterator(); it.hasNext();) {
+ ((H2dRubarVentListener) it.next()).ventEvolutionUsedChanged(this, _e);
+ }
+ }
+ }
+
+ public H2dRubarEvolution getCommonEvolAlongX(final int[] _idx) {
+ if (_idx == null || _idx.length == 0) {
+ return null;
+ }
+ H2dRubarEvolution r = getEvolutionAlongX(_idx[0]);
+ if (r == null) {
+ r = H2dRubarApportSpatialMng.EMPTY_EVOL;
+ }
+ for (int i = _idx.length - 1; i > 0; i--) {
+ H2dRubarEvolution test = getEvolutionAlongX(_idx[i]);
+ if (test == null) {
+ test = H2dRubarApportSpatialMng.EMPTY_EVOL;
+ }
+ if (test != r) {
+ return null;
+ }
+ }
+ return r;
+ }
+
+ public H2dRubarEvolution getCommonEvolAlongY(final int[] _idx) {
+ if (_idx == null || _idx.length == 0) {
+ return null;
+ }
+ H2dRubarEvolution r = getEvolutionAlongY(_idx[0]);
+ if (r == null) {
+ r = H2dRubarApportSpatialMng.EMPTY_EVOL;
+ }
+ for (int i = _idx.length - 1; i > 0; i--) {
+ H2dRubarEvolution test = getEvolutionAlongY(_idx[i]);
+ if (test == null) {
+ test = H2dRubarApportSpatialMng.EMPTY_EVOL;
+ }
+ if (test != r) {
+ return null;
+ }
+ }
+ return r;
+ }
+
+ /**
+ * @param _i l'indice de l'element
+ * @return l'evolution correspondante
+ */
+ public H2dRubarEvolution getEvolutionAlongX(final int _i) {
+ return eltXIdx_ == null ? null : (H2dRubarEvolution) eltXIdx_.getValueAt(_i);
+ }
+
+ public H2dRubarEvolution getEvolutionAlongY(final int _i) {
+ return eltYIdx_ == null ? null : (H2dRubarEvolution) eltYIdx_.getValueAt(_i);
+ }
+
+ /**
+ * @return true si des evolution sont d\xE9finies
+ */
+ public boolean isSet() {
+ return evolutionsUsed_ != null && evolutionsUsed_.size() > 0;
+ }
+
+ /**
+ * @param _l le listener a enlever
+ */
+ public void removeAppListener(final H2dRubarApportListener _l) {
+ if (listener_ != null) {
+ listener_.remove(_l);
+ }
+ }
+
+ /**
+ * @param _idx les indices a modifier
+ * @param _e l'\xE9volution
+ * @param _cmd le receveur de commande
+ */
+ public void setX(final int[] _idx, final H2dRubarEvolution _ex, final H2dRubarEvolution _ey,
+ final CtuluCommandContainer _cmd) {
+ H2dRubarEvolution ex = _ex;
+ H2dRubarEvolution ey = _ey;
+ if (ex == H2dRubarApportSpatialMng.EMPTY_EVOL || isEvolEmpty(ex)) {
+ ex = null;
+ }
+ if (ey == H2dRubarApportSpatialMng.EMPTY_EVOL || isEvolEmpty(ey)) {
+ ey = null;
+ }
+ if (eltXIdx_ == null) {
+ createModel();
+ }
+ eltXIdx_.set(_idx, ex, _cmd);
+ eltYIdx_.set(_idx, ey, _cmd);
+ }
+}
\ No newline at end of file
Modified: trunk/business/dodico-h2d/core/src/main/resources/org/fudaa/dodico/h2d/resource/h2d_en.fr_txt
===================================================================
--- trunk/business/dodico-h2d/core/src/main/resources/org/fudaa/dodico/h2d/resource/h2d_en.fr_txt 2011-11-02 22:58:57 UTC (rev 6605)
+++ trunk/business/dodico-h2d/core/src/main/resources/org/fudaa/dodico/h2d/resource/h2d_en.fr_txt 2011-11-02 23:30:57 UTC (rev 6606)
@@ -336,6 +336,9 @@
Chronique d'apport=Storm water
Les chroniques d'apport=Storms water
Apport=Storm
+Vent=Wind
+Vent Y=Wind Y
+Vent X=Wind X
Vitesse de frottement=Friction velocity
Le nombre d'\xE9lements n'est pas pr\xE9cis\xE9=The number of elements is not set
Limnigrammes=Hydrographs
Modified: trunk/business/dodico-h2d/io/src/main/java/org/fudaa/dodico/rubar/io/RubarVENResult.java
===================================================================
--- trunk/business/dodico-h2d/io/src/main/java/org/fudaa/dodico/rubar/io/RubarVENResult.java 2011-11-02 22:58:57 UTC (rev 6605)
+++ trunk/business/dodico-h2d/io/src/main/java/org/fudaa/dodico/rubar/io/RubarVENResult.java 2011-11-02 23:30:57 UTC (rev 6606)
@@ -1,13 +1,12 @@
package org.fudaa.dodico.rubar.io;
+import org.fudaa.dodico.h2d.rubar.H2dRubarVentInterface;
import org.fudaa.dodico.mesure.EvolutionReguliere;
/**
- *
* @author CANEL Christophe (Genesis)
- *
*/
-public class RubarVENResult {
+public class RubarVENResult implements H2dRubarVentInterface {
EvolutionReguliere[] evolsX;
EvolutionReguliere[] evolsY;
int[] eltEvolIdx;
@@ -26,6 +25,11 @@
return evolsX == null ? 0 : evolsX.length;
}
+ public int getNbEvol() {
+ return getNbEvolX();
+
+ }
+
/**
* @return le nombre d'\xE9volution Y.
*/
@@ -33,19 +37,13 @@
return evolsY == null ? 0 : evolsY.length;
}
- /**
- * @param index l'index
- * @return l'\xE9volution X.
- */
- public EvolutionReguliere getEvolX(int index) {
+ @Override
+ public EvolutionReguliere getEvolutionAlongX(int index) {
return evolsX[index];
}
- /**
- * @param index l'index
- * @return l'\xE9volution Y.
- */
- public EvolutionReguliere getEvolY(int index) {
+ @Override
+ public EvolutionReguliere getEvolutionAlongY(int index) {
return evolsY[index];
}
@@ -57,11 +55,13 @@
return eltEvolIdx[eltIdx];
}
- public EvolutionReguliere getEvolXForElt(final int idxElt) {
- return getEvolX(getEvolIdx(idxElt));
+ @Override
+ public EvolutionReguliere getEvolAlongXForElt(int eltIdx) {
+ return getEvolutionAlongX(getEvolIdx(eltIdx));
}
- public EvolutionReguliere getEvolYForElt(final int idxElt) {
- return getEvolY(getEvolIdx(idxElt));
+ @Override
+ public EvolutionReguliere getEvolAlongYForElt(int idxElt) {
+ return getEvolutionAlongY(getEvolIdx(idxElt));
}
}
\ No newline at end of file
Modified: trunk/business/dodico-h2d/io/src/main/java/org/fudaa/dodico/rubar/io/RubarVENWriter.java
===================================================================
--- trunk/business/dodico-h2d/io/src/main/java/org/fudaa/dodico/rubar/io/RubarVENWriter.java 2011-11-02 22:58:57 UTC (rev 6605)
+++ trunk/business/dodico-h2d/io/src/main/java/org/fudaa/dodico/rubar/io/RubarVENWriter.java 2011-11-02 23:30:57 UTC (rev 6606)
@@ -9,6 +9,7 @@
import org.fudaa.dodico.fortran.FileOpWriterCharSimpleAbstract;
import org.fudaa.dodico.fortran.FortranWriter;
import org.fudaa.dodico.h2d.resource.H2dResource;
+import org.fudaa.dodico.h2d.rubar.H2dRubarVentInterface;
import org.fudaa.dodico.mesure.EvolutionReguliereInterface;
/**
@@ -18,7 +19,7 @@
*/
public class RubarVENWriter extends FileOpWriterCharSimpleAbstract {
- private void writeVENResult(final RubarVENResult result) {
+ private void writeVENResult(final H2dRubarVentInterface result) {
try {
final FortranWriter w = new FortranWriter(out_);
w.setSpaceBefore(true);
@@ -37,7 +38,7 @@
}
w.writeFields(fmt);
final int[] fmti = new int[] { 8 };
- final int nbEvol = result.getNbEvolX();
+ final int nbEvol = result.getNbEvol();
final int maxAutorise = 20;
final int maxTimeStep=1000;
if (nbEvol > maxAutorise) {
@@ -51,8 +52,8 @@
final CtuluNumberFormatI numbFmt = FortranLib.getFortranFormat(15, 4);
fmt = new int[] { 15, 15, 15 };
for (int i = 0; i < nbEvol; i++) {
- final EvolutionReguliereInterface evolX = result.getEvolX(i);
- final EvolutionReguliereInterface evolY = result.getEvolY(i);
+ final EvolutionReguliereInterface evolX = result.getEvolutionAlongX(i);
+ final EvolutionReguliereInterface evolY = result.getEvolutionAlongY(i);
final int nbVal = evolX.getNbValues();
if(nbVal>maxTimeStep&&!errDone){
errDone=true;
Modified: trunk/business/dodico-h2d/io/src/test/java/org/fudaa/dodico/rubar/io/TestRubarVENFileFormat.java
===================================================================
--- trunk/business/dodico-h2d/io/src/test/java/org/fudaa/dodico/rubar/io/TestRubarVENFileFormat.java 2011-11-02 22:58:57 UTC (rev 6605)
+++ trunk/business/dodico-h2d/io/src/test/java/org/fudaa/dodico/rubar/io/TestRubarVENFileFormat.java 2011-11-02 23:30:57 UTC (rev 6606)
@@ -51,12 +51,12 @@
assertEquals(3, result.getNbEvolX());
assertEquals(3, result.getNbEvolY());
- assertEquals(new double[]{1.0, 1.0}, result.getEvolX(0));
- assertEquals(new double[]{1.0, 0.0}, result.getEvolY(0));
- assertEquals(new double[]{2.0}, result.getEvolX(1));
- assertEquals(new double[]{1.5}, result.getEvolY(1));
- assertEquals(new double[]{1.0, 3.0, 2.0}, result.getEvolX(2));
- assertEquals(new double[]{1.0, 2.0, 3.0}, result.getEvolY(2));
+ assertEquals(new double[]{1.0, 1.0}, result.getEvolutionAlongX(0));
+ assertEquals(new double[]{1.0, 0.0}, result.getEvolutionAlongY(0));
+ assertEquals(new double[]{2.0}, result.getEvolutionAlongX(1));
+ assertEquals(new double[]{1.5}, result.getEvolutionAlongY(1));
+ assertEquals(new double[]{1.0, 3.0, 2.0}, result.getEvolutionAlongX(2));
+ assertEquals(new double[]{1.0, 2.0, 3.0}, result.getEvolutionAlongY(2));
}
private void assertEquals(double[] value, EvolutionReguliere evo)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|