Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/type
In directory sc8-pr-cvs1:/tmp/cvs-serv23146/h2d/type
Modified Files:
H2dResolutionMethodType.java H2dResolutionSchemaType.java
H2dVariableType.java
Log Message:
Ajout de fonctionnalites au modele h2d
Index: H2dResolutionMethodType.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/type/H2dResolutionMethodType.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** H2dResolutionMethodType.java 25 Nov 2003 10:11:37 -0000 1.2
--- H2dResolutionMethodType.java 11 Dec 2003 12:41:27 -0000 1.3
***************
*** 8,13 ****
--- 8,15 ----
*/
package org.fudaa.dodico.h2d.type;
+ import java.util.Collections;
import java.util.Iterator;
import java.util.List;
+
import org.fudaa.dodico.commun.DodicoLib;
import org.fudaa.dodico.commun.DodicoPermanentList;
***************
*** 19,43 ****
public class H2dResolutionMethodType extends H2dEnumType {
public static H2dResolutionMethodType LINEAIRE=
! new H2dResolutionMethodType(1, H2dResource.getS("Linéaire"), "LINEAIRE");
public static H2dResolutionMethodType NEWTON_RAPHSON=
new H2dResolutionMethodType(
2,
H2dResource.getS("Newton Raphson"),
! "NEWTON");
public static H2dResolutionMethodType NEWTON_RAPHSON_BCD=
new H2dResolutionMethodType(
3,
! H2dResource.getS("Newton Raphson banc découvrant"),
! "NEWTON_BCD");
public static H2dResolutionMethodType SELECT_LUMPING=
new H2dResolutionMethodType(
4,
H2dResource.getS("Select Lumping"),
! "SELUMP");
public static H2dResolutionMethodType SELECT_LUMPING_BCD=
new H2dResolutionMethodType(
5,
! H2dResource.getS("Select Lumping banc découvrant"),
! "SELUMP_BCD");
public static final List LIST=
new DodicoPermanentList(
--- 21,61 ----
public class H2dResolutionMethodType extends H2dEnumType {
public static H2dResolutionMethodType LINEAIRE=
! new H2dResolutionMethodType(
! 1,
! H2dResource.getS("Linéaire"),
! "LINEAIRE",null);
public static H2dResolutionMethodType NEWTON_RAPHSON=
new H2dResolutionMethodType(
2,
H2dResource.getS("Newton Raphson"),
! "NEWTON",
! new H2dVariableType[] {
! H2dVariableType.RELAXATION,
! H2dVariableType.PRECISION_METHOD,
! H2dVariableType.NB_MAX_IT_METHOD });
public static H2dResolutionMethodType NEWTON_RAPHSON_BCD=
new H2dResolutionMethodType(
3,
! H2dResource.getS("Newton Raphson banc c/d"),
! "NEWTON_BCD",
! new H2dVariableType[] {
! H2dVariableType.RELAXATION,
! H2dVariableType.PRECISION_METHOD,
! H2dVariableType.NB_MAX_IT_METHOD,
! H2dVariableType.VISCOSITE,
! H2dVariableType.PRECISION_BCD_METHOD });
public static H2dResolutionMethodType SELECT_LUMPING=
new H2dResolutionMethodType(
4,
H2dResource.getS("Select Lumping"),
! "SELUMP",null);
public static H2dResolutionMethodType SELECT_LUMPING_BCD=
new H2dResolutionMethodType(
5,
! H2dResource.getS("Select Lumping banc c/d"),
! "SELUMP_BCD",
! new H2dVariableType[] {
! H2dVariableType.VISCOSITE,
! H2dVariableType.PRECISION_BCD_METHOD });
public static final List LIST=
new DodicoPermanentList(
***************
*** 50,60 ****
SELECT_LUMPING_BCD }));
private String refluxId_;
/**
* @param _id
* @param _nom
*/
! public H2dResolutionMethodType(int _id, String _nom, String _refluxId) {
super(_id, _nom);
refluxId_= _refluxId;
}
public static H2dResolutionMethodType getTypeForRefluxId(String _id) {
--- 68,85 ----
SELECT_LUMPING_BCD }));
private String refluxId_;
+ private DodicoPermanentList var_;
/**
* @param _id
* @param _nom
*/
! public H2dResolutionMethodType(
! int _id,
! String _nom,
! String _refluxId,
! H2dVariableType[] _var) {
super(_id, _nom);
refluxId_= _refluxId;
+ if (_var != null)
+ var_= new DodicoPermanentList(DodicoLib.sort(_var));
}
public static H2dResolutionMethodType getTypeForRefluxId(String _id) {
***************
*** 72,75 ****
--- 97,111 ----
public String getRefluxId() {
return refluxId_;
+ }
+
+ public DodicoPermanentList getVarList() {
+ return var_;
+ }
+
+ public boolean isUsed(H2dVariableType _t) {
+ return (var_ != null) && (Collections.binarySearch(var_, _t) >= 0);
+ }
+ public boolean needViscosity() {
+ return isUsed(H2dVariableType.VISCOSITE);
}
}
Index: H2dResolutionSchemaType.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/type/H2dResolutionSchemaType.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** H2dResolutionSchemaType.java 25 Nov 2003 10:11:37 -0000 1.2
--- H2dResolutionSchemaType.java 11 Dec 2003 12:41:27 -0000 1.3
***************
*** 8,11 ****
--- 8,12 ----
*/
package org.fudaa.dodico.h2d.type;
+ import java.util.Collections;
import java.util.Iterator;
import java.util.List;
***************
*** 18,21 ****
--- 19,30 ----
*/
public class H2dResolutionSchemaType extends H2dEnumType {
+ public static DodicoPermanentList TRANSITOIRE_VAR=
+ new DodicoPermanentList(
+ DodicoLib.sort(
+ new H2dVariableType[] {
+ H2dVariableType.FREQUENCE_PRINT_SCHEMA,
+ H2dVariableType.COEF_SCHEMA,
+ H2dVariableType.NB_TIME_STEP_SCHEMA,
+ H2dVariableType.VALUE_TIME_STEP_SCHEMA }));
public static H2dResolutionSchemaType STATIONNAIRE=
new H2dResolutionSchemaType(
***************
*** 36,40 ****
new H2dResolutionMethodType[] {
H2dResolutionMethodType.SELECT_LUMPING,
! H2dResolutionMethodType.SELECT_LUMPING_BCD });
public static H2dResolutionSchemaType EULER=
new H2dResolutionSchemaType(
--- 45,50 ----
new H2dResolutionMethodType[] {
H2dResolutionMethodType.SELECT_LUMPING,
! H2dResolutionMethodType.SELECT_LUMPING_BCD },
! TRANSITOIRE_VAR);
public static H2dResolutionSchemaType EULER=
new H2dResolutionSchemaType(
***************
*** 45,49 ****
H2dResolutionMethodType.NEWTON_RAPHSON,
H2dResolutionMethodType.NEWTON_RAPHSON_BCD,
! H2dResolutionMethodType.LINEAIRE });
public static final List LIST=
new DodicoPermanentList(
--- 55,60 ----
H2dResolutionMethodType.NEWTON_RAPHSON,
H2dResolutionMethodType.NEWTON_RAPHSON_BCD,
! H2dResolutionMethodType.LINEAIRE },
! TRANSITOIRE_VAR);
public static final List LIST=
new DodicoPermanentList(
***************
*** 59,64 ****
--- 70,81 ----
return null;
}
+ public static H2dResolutionSchemaType[] getRefluxTranSchema() {
+ return new H2dResolutionSchemaType[] {
+ H2dResolutionSchemaType.EULER,
+ H2dResolutionSchemaType.KAWAHARA };
+ }
String refluxId_;
DodicoPermanentList methodeList_;
+ DodicoPermanentList varList_;
/**
* @param _id
***************
*** 70,79 ****
String refluxId,
H2dResolutionMethodType[] _methode) {
super(_id, _nom);
refluxId_= refluxId;
! methodeList_= new DodicoPermanentList(_methode);
}
public boolean isSupported(H2dResolutionMethodType _methode) {
! return methodeList_.contains(_methode);
}
public String getRefluxId() {
--- 87,115 ----
String refluxId,
H2dResolutionMethodType[] _methode) {
+ this(_id, _nom, refluxId, _methode, null);
+ }
+ public H2dResolutionSchemaType(
+ int _id,
+ String _nom,
+ String refluxId,
+ H2dResolutionMethodType[] _methode,
+ DodicoPermanentList _var) {
super(_id, _nom);
refluxId_= refluxId;
! methodeList_= new DodicoPermanentList(DodicoLib.sort(_methode));
! if (_var != null)
! varList_= _var;
}
public boolean isSupported(H2dResolutionMethodType _methode) {
! return Collections.binarySearch(methodeList_, _methode) >= 0;
! }
! public DodicoPermanentList getMethodList() {
! return methodeList_;
! }
! public DodicoPermanentList getVarList() {
! return varList_;
! }
! public boolean isUsed(H2dVariableType _t) {
! return (varList_ != null) && (Collections.binarySearch(varList_, _t) >= 0);
}
public String getRefluxId() {
Index: H2dVariableType.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/type/H2dVariableType.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** H2dVariableType.java 25 Nov 2003 10:11:37 -0000 1.6
--- H2dVariableType.java 11 Dec 2003 12:41:27 -0000 1.7
***************
*** 23,26 ****
--- 23,34 ----
return _c.getQ();
}
+ public boolean canBeTransient(){
+ return true;
+ }
+
+ public String getCommonUnit(){
+ return "m3/s";
+
+ }
};
public static final H2dVariableType COTE_EAU=
***************
*** 29,32 ****
--- 37,48 ----
return _c.getH();
}
+ public boolean canBeTransient(){
+ return true;
+ }
+
+ public String getCommonUnit(){
+ return "m";
+
+ }
};
public static final H2dVariableType TRACEUR=
***************
*** 35,38 ****
--- 51,62 ----
return _c.getTracer();
}
+ public boolean canBeTransient(){
+ return true;
+ }
+
+ public String getCommonUnit(){
+ return "g/l";
+
+ }
};
public static final H2dVariableType TRACEUR_COEF_A=
***************
*** 41,44 ****
--- 65,73 ----
return _c.getTracerCoeffA();
}
+
+ public String getCommonUnit(){
+ return DodicoLib.EMPTY_STRING;
+
+ }
};
public static final H2dVariableType TRACEUR_COEF_B=
***************
*** 47,50 ****
--- 76,85 ----
return _c.getTracerCoeffB();
}
+
+ public String getCommonUnit(){
+ return DodicoLib.EMPTY_STRING;
+
+ }
+
};
public static final H2dVariableType VITESSE_U=
***************
*** 53,56 ****
--- 88,99 ----
return _c.getU();
}
+ public boolean canBeTransient(){
+ return true;
+ }
+
+ public String getCommonUnit(){
+ return "m/s";
+
+ }
};
public static final H2dVariableType VITESSE_V=
***************
*** 59,62 ****
--- 102,113 ----
return _c.getV();
}
+ public boolean canBeTransient(){
+ return true;
+ }
+
+ public String getCommonUnit(){
+ return "m/s";
+
+ }
};
public static final H2dVariableType RUGOSITE=
***************
*** 89,106 ****
return _c.getVelocity();
}
};
- private static DodicoPermanentList LIST_REFLUX;
- public static List LIST_REFLUX() {
- if (LIST_REFLUX == null)
- LIST_REFLUX=
- new DodicoPermanentList(
- DodicoLib.sort(
- new H2dVariableType[] {
- ALPHA_LONGUEUR_MELANGE,
- RUGOSITE,
- VISCOSITE,
- PERTE_CHARGE }));
- return LIST_REFLUX;
- }
public final static boolean isTracerVariable(H2dVariableType _t) {
return (_t == H2dVariableType.TRACEUR)
--- 140,200 ----
return _c.getVelocity();
}
+
+ public String getCommonUnit(){
+ return "m/s";
+
+ }
+ };
+ public static final H2dVariableType RELAXATION=
+ new H2dVariableType(13, H2dResource.getS("Relaxation"), null) {
+ public double getValue(H2dVariableTypeContainer _c) {
+ return 0;
+ }
+ };
+ public static final H2dVariableType PRECISION_METHOD=
+ new H2dVariableType(13, H2dResource.getS("Précision"), null) {
+ public double getValue(H2dVariableTypeContainer _c) {
+ return 0;
+ }
+ };
+ public static final H2dVariableType PRECISION_BCD_METHOD=
+ new H2dVariableType(14, H2dResource.getS("Précision banc c/d"), null) {
+ public double getValue(H2dVariableTypeContainer _c) {
+ return 0;
+ }
+ };
+ public static final H2dVariableType NB_MAX_IT_METHOD=
+ new H2dVariableType(15, H2dResource.getS("Nombre d'itération max"), null) {
+ public double getValue(H2dVariableTypeContainer _c) {
+ return 0;
+ }
+ public boolean isInteger(){return true;}
+ };
+ public static final H2dVariableType FREQUENCE_PRINT_SCHEMA=
+ new H2dVariableType(16, H2dResource.getS("Fréquence impression"), null) {
+ public double getValue(H2dVariableTypeContainer _c) {
+ return 0;
+ }
+ public boolean isInteger(){return true;}
+ };
+ public static final H2dVariableType COEF_SCHEMA=
+ new H2dVariableType(17, H2dResource.getS("Coefficient schéma"), null) {
+ public double getValue(H2dVariableTypeContainer _c) {
+ return 0;
+ }
+ };
+ public static final H2dVariableType NB_TIME_STEP_SCHEMA=
+ new H2dVariableType(18, H2dResource.getS("Nombre de pas de temps"), null) {
+ public double getValue(H2dVariableTypeContainer _c) {
+ return 0;
+ }
+ public boolean isInteger(){return true;}
+ };
+ public static final H2dVariableType VALUE_TIME_STEP_SCHEMA=
+ new H2dVariableType(19, H2dResource.getS("Valeur pas de temps"), null) {
+ public double getValue(H2dVariableTypeContainer _c) {
+ return 0;
+ }
};
public final static boolean isTracerVariable(H2dVariableType _t) {
return (_t == H2dVariableType.TRACEUR)
***************
*** 125,128 ****
--- 219,232 ----
return _o == null ? false : (_o.id_ == id_);
}
+
+ public boolean canBeTransient(){
+ return false;
+ }
+
+ public String getCommonUnit(){
+ return DodicoLib.EMPTY_STRING;
+ }
+
+ public boolean isInteger(){return false;}
public abstract double getValue(H2dVariableTypeContainer _container);
}
|