|
From: <de...@us...> - 2003-09-02 08:37:36
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d
In directory sc8-pr-cvs1:/tmp/cvs-serv8494
Modified Files:
H2dBord.java H2dEvolution.java
H2dEvolutionFrontiereLiquide.java H2dMaillage.java
H2dMaillageFrontiere.java H2dProprieteElementaire.java
H2dProprieteNodale.java
Log Message:
Nouvelle version de support pour le metier Hydraulique 2d
Index: H2dBord.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/H2dBord.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** H2dBord.java 22 Aug 2003 15:51:12 -0000 1.3
--- H2dBord.java 2 Sep 2003 08:37:22 -0000 1.4
***************
*** 9,12 ****
--- 9,14 ----
package org.fudaa.dodico.h2d;
+ import gnu.trove.TIntIterator;
+
import org.fudaa.dodico.h2d.type.H2dBordType;
***************
*** 48,51 ****
--- 50,102 ----
+ type_;
}
+
+ public static final class BordIndexIterator{
+ private int nbPt_;
+ private H2dBord bd_;
+ private int indexEnCours_;
+ private int indexFinal_;
+ public BordIndexIterator(){
+ }
+
+ public BordIndexIterator(int _nbPt,H2dBord _b){
+ set(_nbPt,_b);
+ }
+
+ public final void set(int _nbPt,H2dBord _b){
+ nbPt_=_nbPt;
+ bd_=_b;
+ if(_b.isUnique()){
+ indexEnCours_=0;
+ indexFinal_=nbPt_-1;
+ }
+ else if(_b.idxDeb_>_b.idxFin_){
+ indexEnCours_=_b.idxDeb_;
+ indexFinal_=nbPt_+_b.idxFin_;
+ }
+ else
+ {
+ indexEnCours_=_b.idxDeb_;
+ indexFinal_=_b.idxFin_;
+ }
+ }
+
+ public boolean hasNext(){
+ return indexEnCours_<=indexFinal_;
+ }
+
+ public int next(){
+ if(indexEnCours_>indexFinal_) throw new IllegalAccessError("iterateur termine");
+ int r=(indexEnCours_<nbPt_)?indexEnCours_:indexEnCours_-nbPt_;
+ indexEnCours_++;
+ return r;
+ }
+
+
+ }
+
+ public BordIndexIterator createIterator(int _nb){
+ return new BordIndexIterator(_nb,this);
+ }
+
/**
***************
*** 83,86 ****
--- 134,149 ----
public int getIdxFrontiere() {
return IdxmaillageFrontiere_;
+ }
+
+ public int getNPointInBord(int _nbPoint) {
+ if (idxFin_> idxDeb_)
+ return idxFin_- idxDeb_+ 1;
+ else {
+ return idxFin_
+ + 1
+ + _nbPoint
+ - idxDeb_;
+ }
+
}
Index: H2dEvolution.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/H2dEvolution.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** H2dEvolution.java 4 Jul 2003 13:07:25 -0000 1.1
--- H2dEvolution.java 2 Sep 2003 08:37:22 -0000 1.2
***************
*** 10,13 ****
--- 10,14 ----
import org.fudaa.dodico.commun.DodicoDoubleDoubleSortedList;
+ import org.fudaa.dodico.commun.DodicoLib;
/**
***************
*** 15,20 ****
* @version $Id$
*/
! public class H2dEvolution
! {
String nom_;
String unite_;
--- 16,20 ----
* @version $Id$
*/
! public class H2dEvolution {
String nom_;
String unite_;
***************
*** 24,78 ****
*
*/
! public H2dEvolution()
! {
! list_ = new DodicoDoubleDoubleSortedList();
}
! public H2dEvolution(int _n)
! {
! list_ = new DodicoDoubleDoubleSortedList(_n);
}
! public H2dEvolution(String _nom)
! {
this();
! nom_ = _nom;
}
! public void add(double t_, double _value)
! {
list_.put(t_, _value);
}
! public int getPasTempNb()
! {
return list_.size();
}
! public double getPasDeTemps(int _index)
! {
return list_.getKeyAtIndex(_index);
}
! public double getQuickPasDeTemps(int _index)
! {
return list_.getQuickKeyAtIndex(_index);
}
! public double getValue(int _index)
! {
return list_.getValueAtIndex(_index);
}
! public double getQuickValue(int _index)
! {
return list_.getQuickValueAtIndex(_index);
}
/**
*
*/
! public String getNom()
! {
return nom_;
}
--- 24,72 ----
*
*/
! public H2dEvolution() {
! list_= new DodicoDoubleDoubleSortedList();
}
! public H2dEvolution(int _n) {
! list_= new DodicoDoubleDoubleSortedList(_n);
}
! public H2dEvolution(String _nom) {
this();
! nom_= _nom;
}
! protected void add(double t_, double _value) {
list_.put(t_, _value);
}
! public int getPasTempNb() {
return list_.size();
}
! public double getPasDeTemps(int _index) {
return list_.getKeyAtIndex(_index);
}
! public double getQuickPasDeTemps(int _index) {
return list_.getQuickKeyAtIndex(_index);
}
! public double getValue(int _index) {
return list_.getValueAtIndex(_index);
}
! public double getQuickValue(int _index) {
return list_.getQuickValueAtIndex(_index);
}
+ protected void ensureCapacity(int _c) {
+ list_.ensureCapacity(_c);
+ }
+
/**
*
*/
! public String getNom() {
return nom_;
}
***************
*** 81,86 ****
*
*/
! public String getUnite()
! {
return unite_;
}
--- 75,79 ----
*
*/
! public String getUnite() {
return unite_;
}
***************
*** 89,95 ****
*
*/
! public void setNom(String _string)
! {
! nom_ = _string;
}
--- 82,87 ----
*
*/
! public void setNom(String _string) {
! nom_= _string;
}
***************
*** 97,103 ****
*
*/
! public void setUnite(String _string)
! {
! unite_ = _string;
}
--- 89,127 ----
*
*/
! public void setUnite(String _string) {
! unite_= _string;
! }
!
! /**
! *
! */
! public String toString() {
! return nom_
! + DodicoLib.ESPACE
! + "nb= "
! + list_.size()
! + " unite= "
! + unite_;
! }
!
! public String getDescriptionTotale() {
! StringBuffer b= new StringBuffer();
! b.append(toString()).append(DodicoLib.LINE_SEP);
! StringBuffer t= new StringBuffer();
! StringBuffer v= new StringBuffer();
!
! for (int i= 0; i < list_.size(); i++) {
! if (i > 0) {
! t.append(",");
! v.append(",");
! }
! t.append(list_.getQuickKeyAtIndex(i));
! v.append(list_.getQuickValueAtIndex(i));
! }
! b.append("temps=[").append(t.toString()).append("]").append(
! DodicoLib.LINE_SEP);
! b.append("valeurs=[").append(v.toString()).append("]").append(
! DodicoLib.LINE_SEP);
! return b.toString();
}
Index: H2dEvolutionFrontiereLiquide.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/H2dEvolutionFrontiereLiquide.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** H2dEvolutionFrontiereLiquide.java 4 Jul 2003 13:07:25 -0000 1.1
--- H2dEvolutionFrontiereLiquide.java 2 Sep 2003 08:37:22 -0000 1.2
***************
*** 55,59 ****
*
*/
! public void setIndexFrontiere(int _i)
{
indexFrontiere_ = _i;
--- 55,59 ----
*
*/
! protected void setIndexFrontiere(int _i)
{
indexFrontiere_ = _i;
Index: H2dMaillage.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/H2dMaillage.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** H2dMaillage.java 22 Aug 2003 15:51:12 -0000 1.4
--- H2dMaillage.java 2 Sep 2003 08:37:22 -0000 1.5
***************
*** 308,313 ****
int n= elts_.length;
if (_inter != null) {
- _inter.setProgression(0);
_inter.setDesc("Recherche des aretes de contours");
}
TIntArrayList segment= new TIntArrayList(pts_.length * 6 * 2);
--- 308,313 ----
int n= elts_.length;
if (_inter != null) {
_inter.setDesc("Recherche des aretes de contours");
+ _inter.setProgression(0);
}
TIntArrayList segment= new TIntArrayList(pts_.length * 6 * 2);
Index: H2dMaillageFrontiere.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/H2dMaillageFrontiere.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** H2dMaillageFrontiere.java 22 Aug 2003 15:51:12 -0000 1.1
--- H2dMaillageFrontiere.java 2 Sep 2003 08:37:22 -0000 1.2
***************
*** 46,49 ****
--- 46,61 ----
}
+ /**
+ * Renvoie le nombre totals de point des frontieres.
+ */
+ public int getTotalPtNb(){
+ int r=0;
+ for(int i=bords_.length-1;i>=0;i--){
+ r+=bords_[i].length;
+ }
+ return r;
+
+ }
+
/**
Index: H2dProprieteElementaire.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/H2dProprieteElementaire.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** H2dProprieteElementaire.java 4 Jul 2003 13:07:25 -0000 1.1
--- H2dProprieteElementaire.java 2 Sep 2003 08:37:22 -0000 1.2
***************
*** 9,24 ****
package org.fudaa.dodico.h2d;
- import org.fudaa.dodico.h2d.type.H2dVariableType;
-
import gnu.trove.TIntArrayList;
import gnu.trove.TIntDoubleHashMap;
import gnu.trove.TIntObjectHashMap;
/**
* @author deniger
* @version $Id$
*/
! public class H2dProprieteElementaire extends H2dProprieteNodale
! {
TIntArrayList indiceLibre_;
TIntObjectHashMap indiceTransitoireEvolution_;
--- 9,24 ----
package org.fudaa.dodico.h2d;
import gnu.trove.TIntArrayList;
import gnu.trove.TIntDoubleHashMap;
import gnu.trove.TIntObjectHashMap;
+ import org.fudaa.dodico.h2d.type.H2dClType;
+ import org.fudaa.dodico.h2d.type.H2dVariableType;
+
/**
* @author deniger
* @version $Id$
*/
! public class H2dProprieteElementaire extends H2dProprieteNodale {
TIntArrayList indiceLibre_;
TIntObjectHashMap indiceTransitoireEvolution_;
***************
*** 27,47 ****
*
*/
! public H2dProprieteElementaire(String _nom,H2dVariableType _varType,TIntArrayList _indiceLibre,TIntDoubleHashMap _indiceFixeValeur,TIntObjectHashMap _indiceTransitoireEvolution)
! {
! super(_varType,_nom);
! indiceLibre_=_indiceLibre;
indiceLibre_.sort();
! indicePermanentValeur_=_indiceFixeValeur;
! indiceTransitoireEvolution_=_indiceTransitoireEvolution;
}
!
! public int getValeurTransitoireNb()
! {
return indiceTransitoireEvolution_.size();
}
!
! public int getValeurLibreNb()
! {
! return indiceLibre_.size();
}
--- 27,70 ----
*
*/
! public H2dProprieteElementaire(
! String _nom,
! H2dVariableType _varType,
! TIntArrayList _indiceLibre,
! TIntDoubleHashMap _indiceFixeValeur,
! TIntObjectHashMap _indiceTransitoireEvolution) {
! super(_varType, _nom);
! indiceLibre_= _indiceLibre;
indiceLibre_.sort();
! indicePermanentValeur_= _indiceFixeValeur;
! indiceTransitoireEvolution_= _indiceTransitoireEvolution;
}
!
! public int getValeurTransitoireNb() {
return indiceTransitoireEvolution_.size();
}
!
!
! public int getValeurLibreNb() {
! return indiceLibre_ == null ? 0 : indiceLibre_.size();
! }
!
! /**
! * Renvoie le type de variable pour l'element d'indice i.
! * @return permanent si non transitoire et non libre.
! */
! public H2dClType getTypeForEltIdx(int _i) {
! if ((indiceTransitoireEvolution_ != null)
! && (indiceTransitoireEvolution_.contains(_i)))
! return H2dClType.TRANSITOIRE;
! else if ((indiceLibre_ != null) && (indiceLibre_.binarySearch(_i) >= 0))
! return H2dClType.LIBRE;
! return H2dClType.PERMANENT;
! }
!
!
! public H2dEvolution getTransitoireEvol(int _eltIdx) {
! if (indiceTransitoireEvolution_ != null)
! return (H2dEvolution)indiceTransitoireEvolution_.get(_eltIdx);
! return null;
}
Index: H2dProprieteNodale.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/H2dProprieteNodale.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** H2dProprieteNodale.java 4 Jul 2003 13:07:25 -0000 1.1
--- H2dProprieteNodale.java 2 Sep 2003 08:37:22 -0000 1.2
***************
*** 19,114 ****
* @version $Id$
*/
! public class H2dProprieteNodale
! {
! String nom_;
! H2dVariableType variableType_;
! String unite_;
! double defaultValue_;
! TIntDoubleHashMap indicePermanentValeur_;
! /**
! *
! */
! public H2dProprieteNodale(String _nom)
! {
! nom_ = _nom;
! }
! public H2dProprieteNodale(H2dVariableType _var)
! {
! variableType_ = _var;
! nom_ = variableType_.getNom();
! }
!
! public H2dProprieteNodale(H2dVariableType _var,String _nom)
! {
! variableType_ = _var;
! if(_nom==null)
! {
!
! nom_ = variableType_.getNom();
! }
! else
! {
! nom_=_nom;
}
}
! public void computeFixe()
! {
! if (indicePermanentValeur_.size() != 0)
! {
! TSameDouble test = new TSameDouble();
! indicePermanentValeur_.forEachValue(test);
! if (test.isPermanent())
! {
! defaultValue_ = test.getPermanentValue();
! indicePermanentValeur_.clear();
! }
!
}
}
! public static class TSameDouble implements TDoubleProcedure
! {
! private boolean r = true;
! private boolean first = true;
! private double value;
! public boolean isPermanent()
! {
! return r;
! }
! public double getPermanentValue()
! {
! return value;
}
! public boolean execute(double _d)
! {
! if (first)
! {
! value = _d;
! first = false;
! return true;
! }
! else
! {
! if (_d != value)
! {
! r=false;
! return false;
! }
! else
! return true;
}
}
! }
!
! public double getPermanentValueForIndex(int _i)
! {
! return indicePermanentValeur_.get(_i);
}
--- 19,90 ----
* @version $Id$
*/
! public class H2dProprieteNodale {
! public static class TSameDouble implements TDoubleProcedure {
! private boolean first= true;
! private boolean r= true;
! private double value;
! public boolean execute(double _d) {
! if (first) {
! value= _d;
! first= false;
! return true;
! } else {
! if (_d != value) {
! r= false;
! return false;
! } else
! return true;
}
}
! public double getPermanentValue() {
! return value;
}
+ public boolean isPermanent() {
+ return r;
+ }
}
+ double defaultValue_;
+ TIntDoubleHashMap indicePermanentValeur_;
+ String nom_;
+ String unite_;
+ H2dVariableType variableType_;
! public H2dProprieteNodale(H2dVariableType _var) {
! variableType_= _var;
! nom_= variableType_.getNom();
! }
! public H2dProprieteNodale(H2dVariableType _var, String _nom) {
! variableType_= _var;
! if (_nom == null) {
! nom_= variableType_.getNom();
! } else {
! nom_= _nom;
}
+ }
! /**
! *
! */
! public H2dProprieteNodale(String _nom) {
! nom_= _nom;
! }
!
! public void computeFixe() {
! if (indicePermanentValeur_.size() != 0) {
! TSameDouble test= new TSameDouble();
! indicePermanentValeur_.forEachValue(test);
! if (test.isPermanent()) {
! defaultValue_= test.getPermanentValue();
! indicePermanentValeur_.clear();
}
+
}
!
}
***************
*** 116,121 ****
*
*/
! public double getDefaultValue()
! {
return defaultValue_;
}
--- 92,96 ----
*
*/
! public double getDefaultValue() {
return defaultValue_;
}
***************
*** 124,130 ****
*
*/
! public int getPermanentNb()
! {
! return indicePermanentValeur_.size();
}
--- 99,104 ----
*
*/
! public String getNom() {
! return nom_;
}
***************
*** 132,138 ****
*
*/
! public String getNom()
! {
! return nom_;
}
--- 106,120 ----
*
*/
! public int getPermanentSpecifieNb() {
! return indicePermanentValeur_.size();
! }
!
! public double getPermanentValueForIndex(int _i) {
! if ((indicePermanentValeur_ != null) && (indicePermanentValeur_.size()>0)){
! return indicePermanentValeur_.get(_i);
! }
! else{
! return defaultValue_;
! }
}
***************
*** 140,145 ****
*
*/
! public String getUnite()
! {
return unite_;
}
--- 122,126 ----
*
*/
! public String getUnite() {
return unite_;
}
***************
*** 148,153 ****
*
*/
! public H2dVariableType getVariableType()
! {
return variableType_;
}
--- 129,133 ----
*
*/
! public H2dVariableType getVariableType() {
return variableType_;
}
|