Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/reflux
In directory sc8-pr-cvs1:/tmp/cvs-serv13994/h2d/reflux
Modified Files:
H2dRefluxCLManager.java H2dRefluxParametres.java
Added Files:
H2dRefluxCLListener.java H2dRefluxProjectListener.java
Log Message:
Ajout du pattern command pour annuler des operations
--- NEW FILE: H2dRefluxCLListener.java ---
/*
* @file H2dRefluxCLListener.java
* @creation 23 oct. 2003
* @modification $Date: 2003/10/29 11:41:27 $
* @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.reflux;
import org.fudaa.dodico.h2d.H2dClListener;
/**
* @author deniger
* @version $Id: H2dRefluxCLListener.java,v 1.1 2003/10/29 11:41:27 deniger Exp $
*/
public interface H2dRefluxCLListener extends H2dClListener {}
--- NEW FILE: H2dRefluxProjectListener.java ---
/*
* @file H2dRefluxProjectListener.java
* @creation 23 oct. 2003
* @modification $Date: 2003/10/29 11:41:27 $
* @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.reflux;
import org.fudaa.dodico.h2d.H2dProjectListener;
/**
* @author deniger
* @version $Id: H2dRefluxProjectListener.java,v 1.1 2003/10/29 11:41:27 deniger Exp $
*/
public interface H2dRefluxProjectListener extends H2dProjectListener,H2dRefluxCLListener {}
Index: H2dRefluxCLManager.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/reflux/H2dRefluxCLManager.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** H2dRefluxCLManager.java 8 Oct 2003 11:53:08 -0000 1.3
--- H2dRefluxCLManager.java 29 Oct 2003 11:41:27 -0000 1.4
***************
*** 1 ****
! /*
* @file H2dRefluxBordManager.java
* @creation 21 août 2003
* @modification $Date$
* @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.reflux;
import gnu.trove.TIntObjectHashMap;
import java.util.ArrayList;
import java.util.List;
import org.fudaa.dodico.commun.DodicoAnalyze;
import org.fudaa.dodico.commun.DodicoLib;
import org.fudaa.dodico.h2d.H2dBord;
import org.fudaa.dodico.h2d.H2dBordMutable;
import org.fudaa.dodico.h2d.H2dBorderPerFrontierInterface;
import org.fudaa.dodico.h2d.H2dCLManagerAbstract;
import org.fudaa.dodico.h2d.H2dConditionLimite;
import org.fudaa.dodico.h2d.H2dEvolution;
import org.fudaa.dodico.h2d.H2dMaillage;
import org.fudaa.dodico.h2d.H2dMaillageFrontiere;
import org.fudaa.dodico.h2d.H2dResource;
import org.fudaa.dodico.h2d.type.H2dBordType;
import org.fudaa.dodico.h2d.type.H2dClType;
/**
* @author deniger
* @version $Id$
*/
public class H2dRefluxCLManager extends H2dCLManagerAbstract {
H2dRefluxConditionLimite[] cls_;
/**
*
*/
protected H2dRefluxCLManager(
H2dMaillage _m,
RefluxBordParFrontiere[] _borders,
H2dRefluxConditionLimite[] _cls) {
super(_m, _borders);
cls_= _cls;
}
public H2dRefluxConditionLimite getRefluxCL(int _bordIdx) {
return cls_[_bordIdx];
}
public H2dRefluxConditionLimite[] getRefluxClTableau() {
H2dRefluxConditionLimite[] r= new H2dRefluxConditionLimite[cls_.length];
System.arraycopy(cls_, 0, r, 0, cls_.length);
return r;
}
public H2dRefluxBordIndexGeneral[] getRefluxBord() {
int n= bordByFrontier_.length;
ArrayList r= new ArrayList();
for (int i= 0; i < n; i++) {
r.addAll(
(
(
RefluxBordParFrontiere)bordByFrontier_[i])
.getRefluxIndexGeneralBords(
this,
i));
}
n= r.size();
if (n > 0) {
H2dRefluxBordIndexGeneral[] rfinal= new H2dRefluxBordIndexGeneral[n];
r.toArray(rfinal);
return rfinal;
}
return null;
}
public RefluxBordParFrontiere getRefluxBorderByFrontier(int _idxGeneral) {
return (RefluxBordParFrontiere)getBordPerFrontier(_idxGeneral);
}
public static H2dRefluxCLManager init(
H2dMaillage _maillage,
H2dRefluxBordIndexGeneral[] _bordInit,
H2dRefluxConditionLimite[] _cls,
DodicoAnalyze.Editor _analyze) {
H2dMaillageFrontiere frontieres= _maillage.getPtsFrontiere();
int nbPointFrontiere=frontieres.getNbTotalPt();
//les cls
if (nbPointFrontiere != _cls.length) {
_analyze.addError(
H2dResource.getS("Des conditions limites ne sont pas spécifiées"));
}
H2dRefluxConditionLimite[] cls=
new H2dRefluxConditionLimite[nbPointFrontiere];
int idxPt;
for (H2dMaillageFrontiere.FrontiereIdxIterator it=frontieres.getFrontierIterator();it.hasNext();) {
idxPt= it.next();
H2dRefluxConditionLimite cl=
(H2dRefluxConditionLimite)H2dConditionLimite.getCLFast(idxPt, _cls);
if (cl == null) {
if (_analyze != null)
_analyze.addError(
H2dResource.getS(
"Pas de cl pour le point de bord {0}",
DodicoLib.getString(it.getBoundaryIdx())));
H2dRefluxConditionLimiteMutable clN=
new H2dRefluxConditionLimiteMutable();
clN.setIndexPt(idxPt);
cls[it.getBoundaryIdx()]= clN;
} else {
cls[it.getBoundaryIdx()]= cl;
}
}
int ptId;
H2dBordMutable bordEnCours= null;
H2dBordMutable firstBord= null;
RefluxBordParFrontiere[] bordByFrontier=
new RefluxBordParFrontiere[frontieres.getNbFrontier()];
//le nb de frontiere
int n= frontieres.getNbFrontier();
//Si des bords sont specifie on traite le tout. Sinon que des bords uniques
if (_bordInit != null) {
for (int i= 0; i < n; i++) {
ArrayList bords= new ArrayList();
TIntObjectHashMap indexPtMilieuRugosite= new TIntObjectHashMap();
bordEnCours= null;
firstBord= null;
int nbPt= frontieres.getNbPt(i);
//On prend que les points milieux.
for (int j= 1; j < nbPt; j += 2) {
ptId= frontieres.getIdx(i, j);
H2dRefluxBordIndexGeneral bord=
H2dRefluxBordIndexGeneral.findBordWithIndex(ptId, _bordInit);
H2dBordType bordType=
bord == null ? H2dBordType.SOLIDE : bord.getBord();
if (bordType == H2dBordType.SOLIDE_FROTTEMENT) {
System.err.println("friction boundary found");
indexPtMilieuRugosite.put(
j,
new BordRugositeValeurs(
bord.getRugositeType(),
bord.getRugosite(),
bord.getRugositeTransitoireCourbe()));
}
if (bordEnCours == null) {
bordEnCours= new H2dBordMutable();
bordEnCours.setIdxmaillageFrontiere(i);
bordEnCours.setIdxDeb(j - 1);
bordEnCours.setIdxFin(j + 1);
bordEnCours.setType(bordType);
firstBord= bordEnCours;
bords.add(bordEnCours);
} else {
if (bordType == bordEnCours.getType()) {
bordEnCours.setIdxFin(j + 1);
} else {
bordEnCours= new H2dBordMutable();
bordEnCours.setIdxmaillageFrontiere(i);
bordEnCours.setIdxDeb(j - 1);
bordEnCours.setIdxFin(j + 1);
bordEnCours.setType(bordType);
bords.add(bordEnCours);
}
}
}
if (bordEnCours.getIdxFin() != nbPt) {
if (_analyze != null) {
_analyze.addFatalError(
H2dResource.getS(
"Détermination des bords impossible :erreur dans les indexs"));
}
new Throwable().printStackTrace();
return null;
} else {
bordEnCours.setIdxFin(0);
}
if ((bordEnCours != firstBord)
&& (bordEnCours.getType() == firstBord.getType())) {
firstBord.setIdxDeb(bordEnCours.getIdxDeb());
bords.remove(bordEnCours);
}
bordByFrontier[i]=
new RefluxBordParFrontiere(bords, i, indexPtMilieuRugosite);
}
//bord unique
} else {
for (int i= 0; i < n; i++) {
bordByFrontier[i]=
new RefluxBordParFrontiere(createBordDefautUniqueBord(), i);
}
}
return new H2dRefluxCLManager(_maillage, bordByFrontier, cls);
}
private static H2dBordMutable createBordDefautUniqueBord() {
H2dBordMutable r= new H2dBordMutable();
r.setIdxDeb(0);
r.setIdxFin(0);
r.setType(H2dBordType.SOLIDE);
return r;
}
public static class RefluxBordParFrontiere
implements H2dBorderPerFrontierInterface {
private ArrayList bords_;
private int maillageBordIdx_;
private TIntObjectHashMap indexMilieuRugosite_;
protected RefluxBordParFrontiere(
ArrayList _bords,
int _maillageindex,
TIntObjectHashMap _indexPtMilieuRugosite) {
bords_= _bords;
maillageBordIdx_= _maillageindex;
if ((_indexPtMilieuRugosite != null)
&& (_indexPtMilieuRugosite.size() > 0)) {
indexMilieuRugosite_= _indexPtMilieuRugosite;
}
}
protected RefluxBordParFrontiere(H2dBordMutable _m, int _maillageindex) {
bords_= new ArrayList(10);
bords_.add(_m);
maillageBordIdx_= _maillageindex;
}
public static List getRefluxIndexGeneralBords(
H2dRefluxCLManager _mng,
int _idxFrontier) {
RefluxBordParFrontiere borderByFrontier=
_mng.getRefluxBorderByFrontier(_idxFrontier);
ArrayList l= new ArrayList();
int n= borderByFrontier.bords_.size();
int idxFrontier= borderByFrontier.maillageBordIdx_;
H2dMaillage m= _mng.getMaillage();
H2dRefluxBordIndexGeneral bidxGene;
int[] idx;
H2dMaillageFrontiere frontieres= m.getPtsFrontiere();
for (int i= 0; i < n; i++) {
H2dBord b= borderByFrontier.getBord(i);
H2dBordType bType= b.getType();
if (bType != H2dBordType.SOLIDE) {
//cas bord simple
if (bType != H2dBordType.SOLIDE_FROTTEMENT) {
int deb= b.getIdxDeb();
int fin= b.getIdxFin();
for (int j= deb; j < fin; j += 2) {
bidxGene= new H2dRefluxBordIndexGeneral(bType);
idx= new int[3];
idx[0]= frontieres.getIdx(idxFrontier, j);
idx[1]= frontieres.getIdx(idxFrontier, j + 1);
idx[2]= frontieres.getIdx(idxFrontier, j + 2);
bidxGene.setIndex(idx);
l.add(bidxGene);
}
//bord avec rugosite
} else {
int deb= b.getIdxDeb() + 1;
int fin= b.getIdxFin();
for (int j= deb; j < fin; j += 2) {
bidxGene= new H2dRefluxBordIndexGeneral(bType);
BordRugositeValeurs v=
(BordRugositeValeurs)borderByFrontier.indexMilieuRugosite_.get(
j);
if (v == null) {
//a voir
System.out.println("problem: friction not found");
bidxGene.setRugositeType(H2dClType.PERMANENT);
bidxGene.setRugosite(0);
} else {
bidxGene.setRugositeType(v.getType());
bidxGene.setRugosite(v.getValue());
bidxGene.setRugositeTransitoireCourbe(v.getEvolution());
}
idx= new int[3];
idx[0]= frontieres.getIdx(idxFrontier, j - 1);
idx[1]= frontieres.getIdx(idxFrontier, j);
idx[2]= frontieres.getIdx(idxFrontier, j + 1);
bidxGene.setIndex(idx);
l.add(bidxGene);
}
}
}
}
return l;
}
public BordRugositeValeurs getRugositeValeurs(int _j) {
return (BordRugositeValeurs)indexMilieuRugosite_.get(_j);
}
public int getNbBord() {
return bords_.size();
}
public H2dBord getBord(int _i) {
return (H2dBord)bords_.get(_i);
}
}
public static class BordRugositeValeurs {
double value_;
H2dClType type_;
H2dEvolution evolution_;
public BordRugositeValeurs(
H2dClType _t,
double _value,
H2dEvolution _evol) {
setType(_t);
setValue(_value);
setEvolution(_evol);
}
/**
*
*/
public H2dEvolution getEvolution() {
return evolution_;
}
/**
*
*/
public H2dClType getType() {
return type_;
}
/**
*
*/
public double getValue() {
return value_;
}
/**
*
*/
protected final void setEvolution(H2dEvolution _evolution) {
if (type_ == H2dClType.TRANSITOIRE)
evolution_= _evolution;
}
/**
*
*/
protected final void setType(H2dClType _type) {
type_= _type;
if ((type_ == H2dClType.PERMANENT) || (type_ == H2dClType.LIBRE)) {
evolution_= null;
}
}
/**
*
*/
protected final void setValue(double _d) {
if (type_ == H2dClType.PERMANENT)
value_= _d;
}
}
}
\ No newline at end of file
--- 1 ----
! /*
* @file H2dRefluxBordManager.java
* @creation 21 août 2003
* @modification $Date$
* @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.reflux;
import gnu.trove.TIntObjectHashMap;
import java.util.ArrayList;
import java.util.List;
import org.fudaa.dodico.commun.DodicoAnalyze;
import org.fudaa.dodico.commun.DodicoLib;
import org.fudaa.dodico.h2d.H2dBord;
import org.fudaa.dodico.h2d.H2dBordMutable;
import org.fudaa.dodico.h2d.H2dBorderPerFrontierInterface;
import org.fudaa.dodico.h2d.H2dCLManagerAbstract;
import org.fudaa.dodico.h2d.H2dConditionLimite;
import org.fudaa.dodico.h2d.H2dEvolution;
import org.fudaa.dodico.h2d.H2dMaillage;
import org.fudaa.dodico.h2d.H2dMaillageFrontiere;
import org.fudaa.dodico.h2d.H2dResource;
import org.fudaa.dodico.h2d.type.H2dBordType;
import org.fudaa.dodico.h2d.type.H2dClType;
/**
* @author deniger
* @version $Id$
*/
public class H2dRefluxCLManager extends H2dCLManagerAbstract {
H2dRefluxConditionLimite[] cls_;
/**
*
*/
protected H2dRefluxCLManager(
H2dMaillage _m,
RefluxBordParFrontiere[] _borders,
H2dRefluxConditionLimite[] _cls) {
super(_m, _borders);
cls_= _cls;
}
public void addClListener(H2dRefluxCLListener _l) {
listeners_.add(_l);
}
public void removeClListener(H2dRefluxCLListener _l) {
listeners_.remove(_l);
}
public H2dRefluxConditionLimite getRefluxCL(int _bordIdx) {
return cls_[_bordIdx];
}
public H2dRefluxConditionLimite[] getRefluxClTableau() {
H2dRefluxConditionLimite[] r= new H2dRefluxConditionLimite[cls_.length];
System.arraycopy(cls_, 0, r, 0, cls_.length);
return r;
}
public H2dRefluxBordIndexGeneral[] getRefluxBord() {
int n= bordByFrontier_.length;
ArrayList r= new ArrayList();
for (int i= 0; i < n; i++) {
r.addAll(
(
(
RefluxBordParFrontiere)bordByFrontier_[i])
.getRefluxIndexGeneralBords(
this,
i));
}
n= r.size();
if (n > 0) {
H2dRefluxBordIndexGeneral[] rfinal= new H2dRefluxBordIndexGeneral[n];
r.toArray(rfinal);
return rfinal;
}
return null;
}
public RefluxBordParFrontiere getRefluxBorderByFrontier(int _idxGeneral) {
return (RefluxBordParFrontiere)getBordPerFrontier(_idxGeneral);
}
public static H2dRefluxCLManager init(
H2dMaillage _maillage,
H2dRefluxBordIndexGeneral[] _bordInit,
H2dRefluxConditionLimite[] _cls,
DodicoAnalyze.Editor _analyze) {
H2dMaillageFrontiere frontieres= _maillage.getPtsFrontiere();
int nbPointFrontiere= frontieres.getNbTotalPt();
//les cls
if (nbPointFrontiere != _cls.length) {
_analyze.addError(
H2dResource.getS("Des conditions limites ne sont pas spécifiées"));
}
H2dRefluxConditionLimite[] cls=
new H2dRefluxConditionLimite[nbPointFrontiere];
int idxPt;
for (H2dMaillageFrontiere.FrontiereIdxIterator it=
frontieres.getFrontierIterator();
it.hasNext();
) {
idxPt= it.next();
H2dRefluxConditionLimite cl=
(H2dRefluxConditionLimite)H2dConditionLimite.getCLFast(idxPt, _cls);
if (cl == null) {
if (_analyze != null)
_analyze.addError(
H2dResource.getS(
"Pas de cl pour le point de bord {0}",
DodicoLib.getString(it.getBoundaryIdx())));
H2dRefluxConditionLimiteMutable clN=
new H2dRefluxConditionLimiteMutable();
clN.setIndexPt(idxPt);
cls[it.getBoundaryIdx()]= clN;
} else {
cls[it.getBoundaryIdx()]= cl;
}
}
int ptId;
H2dBordMutable bordEnCours= null;
H2dBordMutable firstBord= null;
RefluxBordParFrontiere[] bordByFrontier=
new RefluxBordParFrontiere[frontieres.getNbFrontier()];
//le nb de frontiere
int n= frontieres.getNbFrontier();
int indexBord=0;
//Si des bords sont specifie on traite le tout. Sinon que des bords uniques
if (_bordInit != null) {
for (int i= 0; i < n; i++) {
ArrayList bords= new ArrayList();
TIntObjectHashMap indexPtMilieuRugosite= new TIntObjectHashMap();
bordEnCours= null;
firstBord= null;
int nbPt= frontieres.getNbPt(i);
//On prend que les points milieux.
for (int j= 1; j < nbPt; j += 2) {
ptId= frontieres.getIdx(i, j);
H2dRefluxBordIndexGeneral bord=
H2dRefluxBordIndexGeneral.findBordWithIndex(ptId, _bordInit);
H2dBordType bordType=
bord == null ? H2dBordType.SOLIDE : bord.getBord();
if (bordType == H2dBordType.SOLIDE_FROTTEMENT) {
System.err.println("friction boundary found");
indexPtMilieuRugosite.put(
j,
new BordRugositeValeurs(
bord.getRugositeType(),
bord.getRugosite(),
bord.getRugositeTransitoireCourbe()));
}
if (bordEnCours == null) {
bordEnCours= new H2dBordMutable();
bordEnCours.setIdxmaillageFrontiere(i);
bordEnCours.setIdxDeb(j - 1);
bordEnCours.setIdxFin(j + 1);
bordEnCours.setType(bordType);
firstBord= bordEnCours;
bords.add(bordEnCours);
} else {
if (bordType == bordEnCours.getType()) {
bordEnCours.setIdxFin(j + 1);
} else {
bordEnCours= new H2dBordMutable();
bordEnCours.setIdxmaillageFrontiere(i);
bordEnCours.setIdxDeb(j - 1);
bordEnCours.setIdxFin(j + 1);
bordEnCours.setType(bordType);
bords.add(bordEnCours);
}
}
}
if (bordEnCours.getIdxFin() != nbPt) {
if (_analyze != null) {
_analyze.addFatalError(
H2dResource.getS(
"Détermination des bords impossible :erreur dans les indexs"));
}
new Throwable().printStackTrace();
return null;
} else {
bordEnCours.setIdxFin(0);
}
if ((bordEnCours != firstBord)
&& (bordEnCours.getType() == firstBord.getType())) {
firstBord.setIdxDeb(bordEnCours.getIdxDeb());
bords.remove(bordEnCours);
}
bordByFrontier[i]=
new RefluxBordParFrontiere(bords, i, indexPtMilieuRugosite);
}
//bord unique
} else {
for (int i= 0; i < n; i++) {
bordByFrontier[i]=
new RefluxBordParFrontiere(createBordDefautUniqueBord(),i);
}
}
return new H2dRefluxCLManager(_maillage, bordByFrontier, cls);
}
private static H2dBordMutable createBordDefautUniqueBord() {
H2dBordMutable r= new H2dBordMutable();
r.setIdxDeb(0);
r.setIdxFin(0);
r.setType(H2dBordType.SOLIDE);
return r;
}
public static class RefluxBordParFrontiere
implements H2dBorderPerFrontierInterface {
private ArrayList bords_;
private int maillageBordIdx_;
private TIntObjectHashMap indexMilieuRugosite_;
protected RefluxBordParFrontiere(
ArrayList _bords,
int _maillageindex,
TIntObjectHashMap _indexPtMilieuRugosite) {
bords_= _bords;
maillageBordIdx_= _maillageindex;
if ((_indexPtMilieuRugosite != null)
&& (_indexPtMilieuRugosite.size() > 0)) {
indexMilieuRugosite_= _indexPtMilieuRugosite;
}
}
protected RefluxBordParFrontiere(H2dBordMutable _m, int _maillageindex) {
bords_= new ArrayList(10);
bords_.add(_m);
maillageBordIdx_= _maillageindex;
}
public static List getRefluxIndexGeneralBords(
H2dRefluxCLManager _mng,
int _idxFrontier) {
RefluxBordParFrontiere borderByFrontier=
_mng.getRefluxBorderByFrontier(_idxFrontier);
ArrayList l= new ArrayList();
int n= borderByFrontier.bords_.size();
int idxFrontier= borderByFrontier.maillageBordIdx_;
H2dMaillage m= _mng.getMaillage();
H2dRefluxBordIndexGeneral bidxGene;
int[] idx;
H2dMaillageFrontiere frontieres= m.getPtsFrontiere();
for (int i= 0; i < n; i++) {
H2dBord b= borderByFrontier.getBord(i);
H2dBordType bType= b.getType();
if (bType != H2dBordType.SOLIDE) {
//cas bord simple
if (bType != H2dBordType.SOLIDE_FROTTEMENT) {
int deb= b.getIdxDeb();
int fin= b.getIdxFin();
for (int j= deb; j < fin; j += 2) {
bidxGene= new H2dRefluxBordIndexGeneral(bType);
idx= new int[3];
idx[0]= frontieres.getIdx(idxFrontier, j);
idx[1]= frontieres.getIdx(idxFrontier, j + 1);
idx[2]= frontieres.getIdx(idxFrontier, j + 2);
bidxGene.setIndex(idx);
l.add(bidxGene);
}
//bord avec rugosite
} else {
int deb= b.getIdxDeb() + 1;
int fin= b.getIdxFin();
for (int j= deb; j < fin; j += 2) {
bidxGene= new H2dRefluxBordIndexGeneral(bType);
BordRugositeValeurs v=
(BordRugositeValeurs)borderByFrontier.indexMilieuRugosite_.get(
j);
if (v == null) {
//a voir
System.out.println("problem: friction not found");
bidxGene.setRugositeType(H2dClType.PERMANENT);
bidxGene.setRugosite(0);
} else {
bidxGene.setRugositeType(v.getType());
bidxGene.setRugosite(v.getValue());
bidxGene.setRugositeTransitoireCourbe(v.getEvolution());
}
idx= new int[3];
idx[0]= frontieres.getIdx(idxFrontier, j - 1);
idx[1]= frontieres.getIdx(idxFrontier, j);
idx[2]= frontieres.getIdx(idxFrontier, j + 1);
bidxGene.setIndex(idx);
l.add(bidxGene);
}
}
}
}
return l;
}
public BordRugositeValeurs getRugositeValeurs(int _j) {
return (BordRugositeValeurs)indexMilieuRugosite_.get(_j);
}
public int getNbBord() {
return bords_.size();
}
public H2dBord getBord(int _i) {
return (H2dBord)bords_.get(_i);
}
/**
*
*/
public H2dBord getBordContainingIdx(int _indexToSearch) {
return null;
}
/**
*
*/
public H2dConditionLimite getCl(int _idxOnThisFrontier) {
return null;
}
/**
*
*/
public int getNbPt() {
return 0;
}
}
public static class BordRugositeValeurs {
double value_;
H2dClType type_;
H2dEvolution evolution_;
public BordRugositeValeurs(
H2dClType _t,
double _value,
H2dEvolution _evol) {
setType(_t);
setValue(_value);
setEvolution(_evol);
}
/**
*
*/
public H2dEvolution getEvolution() {
return evolution_;
}
/**
*
*/
public H2dClType getType() {
return type_;
}
/**
*
*/
public double getValue() {
return value_;
}
/**
*
*/
protected final void setEvolution(H2dEvolution _evolution) {
if (type_ == H2dClType.TRANSITOIRE)
evolution_= _evolution;
}
/**
*
*/
protected final void setType(H2dClType _type) {
type_= _type;
if ((type_ == H2dClType.PERMANENT) || (type_ == H2dClType.LIBRE)) {
evolution_= null;
}
}
/**
*
*/
protected final void setValue(double _d) {
if (type_ == H2dClType.PERMANENT)
value_= _d;
}
}
}
\ No newline at end of file
Index: H2dRefluxParametres.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/h2d/reflux/H2dRefluxParametres.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** H2dRefluxParametres.java 10 Oct 2003 14:43:19 -0000 1.6
--- H2dRefluxParametres.java 29 Oct 2003 11:41:27 -0000 1.7
***************
*** 1 ****
! /*
* @file H2dParametresReflux.java
* @creation 26 juin 2003
* @modification $Date$
* @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.reflux;
import org.fudaa.dodico.commun.DodicoAnalyze;
import org.fudaa.dodico.commun.DodicoLib;
import org.fudaa.dodico.commun.DodicoPermanentList;
import org.fudaa.dodico.commun.ProgressionInterface;
import org.fudaa.dodico.dico.DicoCasFileFormatVersionAbstract;
import org.fudaa.dodico.dico.DicoParams;
import org.fudaa.dodico.h2d.H2dGroupePasTemps;
import org.fudaa.dodico.h2d.H2dParametres;
import org.fudaa.dodico.h2d.H2dProprieteElementaire;
import org.fudaa.dodico.h2d.H2dResource;
import org.fudaa.dodico.h2d.type.H2dBordType;
/**
* Classe contenant les parametres de base.
* Notation:
* cl: condition limite
* pn: propriete nodale.
* @author deniger
* @version $Id$
*/
public class H2dRefluxParametres extends H2dParametres {
public static final DodicoPermanentList BORD_LIST=
new DodicoPermanentList(
DodicoLib.sort(
new H2dBordType[] {
H2dBordType.SOLIDE,
H2dBordType.SOLIDE_FROTTEMENT,
H2dBordType.LIQUIDE_VITESSES_IMPOSEES,
H2dBordType.LIQUIDE_HAUTEUR_IMPOSEE,
H2dBordType.LIQUIDE_HAUTEUR_VITESSES_IMPOSEES,
H2dBordType.LIQUIDE_DEBIT_IMPOSE }));
H2dGroupePasTemps[] gptTemps_;
H2dProprieteElementaire[] propEls_;
/**
*
*/
private H2dRefluxParametres(DicoParams _p) {
super(_p);
}
public DodicoPermanentList getBordList(){
return BORD_LIST;
}
public H2dRefluxCLManager getRefluxClManager(){
return (H2dRefluxCLManager)getCLManager();
}
public H2dRefluxConditionLimite getRefluxCL(int _indexPtFrontiere) {
return getRefluxClManager().getRefluxCL(_indexPtFrontiere);
}
public H2dRefluxConditionLimite[] getRefluxCLTableau() {
return getRefluxClManager().getRefluxClTableau();
}
public int getProprietesElementairesNb() {
return propEls_.length;
}
public H2dProprieteElementaire getProprieteElementaire(int _i) {
return propEls_[_i];
}
public H2dProprieteElementaire[] getProprieteElementaireTab() {
H2dProprieteElementaire[] r= new H2dProprieteElementaire[propEls_.length];
System.arraycopy(propEls_, 0, r, 0, propEls_.length);
return r;
}
public int getGroupePasTempsNb() {
return gptTemps_.length;
}
public H2dGroupePasTemps getGroupePasTemps(int _i) {
return gptTemps_[_i];
}
public H2dGroupePasTemps[] getGroupePasTempsTab() {
H2dGroupePasTemps[] r= new H2dGroupePasTemps[gptTemps_.length];
System.arraycopy(gptTemps_, 0, r, 0, gptTemps_.length);
return r;
}
//DEBUG A Continuer
public boolean contientPnTransitoire() {
return false;
}
//DEBUG A Continuer
public boolean contientClTransitoire() {
return false;
}
public static H2dRefluxParametres init(
H2dRefluxSourceInterface _inter,
ProgressionInterface _prog,
DicoCasFileFormatVersionAbstract _ft,
DodicoAnalyze.Editor _analyze) {
if (_prog != null) {
_prog.setDesc(H2dResource.getS("Analyse données"));
_prog.setProgression(0);
}
if (_ft == null) {
_analyze.addFatalError(H2dResource.getS("Version non spécifiée"));
return null;
}
DicoParams params= new DicoParams(_inter.getEntiteValue(), _ft);
H2dRefluxParametres r= new H2dRefluxParametres(params);
r.setMaillage(_inter.getMaillage(),_prog,_analyze);
if (r.getMaillage() == null) {
_analyze.addFatalError(H2dResource.getS("Maillage non spécifié"));
return null;
}
//Classement de cl
//Classement de bord
H2dRefluxCLManager bords=
H2dRefluxCLManager.init(
r.getMaillage(),
_inter.getBords(),
_inter.getConditionLimite(),
_analyze);
if (_prog != null) {
_prog.setProgression(60);
}
r.setClManager(bords);
//sauv des prop elementaires
r.propEls_= _inter.getPropElementaires();
//sauv groupe pas de temps
r.gptTemps_= _inter.getGroupePasTemps();
if (_prog != null) {
_prog.setProgression(100);
}
if (DodicoLib.DEBUG)
System.out.println("End of data analyze");
return r;
}
}
\ No newline at end of file
--- 1 ----
! /*
* @file H2dParametresReflux.java
* @creation 26 juin 2003
* @modification $Date$
* @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.reflux;
import org.fudaa.dodico.commun.DodicoAnalyze;
import org.fudaa.dodico.commun.DodicoLib;
import org.fudaa.dodico.commun.DodicoPermanentList;
import org.fudaa.dodico.commun.ProgressionInterface;
import org.fudaa.do...
[truncated message content] |