|
From: <de...@us...> - 2003-08-18 11:30:26
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/test/reflux
In directory sc8-pr-cvs1:/tmp/cvs-serv3430/test/reflux
Modified Files:
TestCorEleBth.java TestDunes.java TestINP.java
Log Message:
Maj des projets hydraulique 2d
Index: TestCorEleBth.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/test/reflux/TestCorEleBth.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** TestCorEleBth.java 7 Aug 2003 08:01:42 -0000 1.6
--- TestCorEleBth.java 18 Aug 2003 11:05:20 -0000 1.7
***************
*** 29,43 ****
* @version $Id$
*/
! public class TestCorEleBth extends TestIO
! {
! public TestCorEleBth()
! {
super("corelebth.cor");
}
! public void _interfaceTest(
! CorEleBthInterface _inter)
! {
assertNotNull(_inter);
CorEleBthInterface t= _inter;
--- 29,39 ----
* @version $Id$
*/
! public class TestCorEleBth extends TestIO {
! public TestCorEleBth() {
super("corelebth.cor");
}
! public void _interfaceTest(CorEleBthInterface _inter) {
assertNotNull(_inter);
CorEleBthInterface t= _inter;
***************
*** 68,72 ****
assertEquals(d, dLu, eps_);
//test sur l'element 33
! int[] elems= maill.getElts()[33].getPtIndex();
assertEquals(maill.getEltNb(), 792);
assertEquals(elems.length, 6);
--- 64,68 ----
assertEquals(d, dLu, eps_);
//test sur l'element 33
! int[] elems= maill.getElement(33).getPtIndex();
assertEquals(maill.getEltNb(), 792);
assertEquals(elems.length, 6);
***************
*** 91,98 ****
}
! public static void printAnalyze(String _titre, DodicoAnalyze _analyze)
! {
! if (!_analyze.isEmpty())
! {
System.out.println(_titre);
_analyze.printResume();
--- 87,92 ----
}
! public static void printAnalyze(String _titre, DodicoAnalyze _analyze) {
! if (!_analyze.isEmpty()) {
System.out.println(_titre);
_analyze.printResume();
***************
*** 100,117 ****
}
! public static void main(String[] args)
! {
HashMap arg= DodicoLib.parseArgs(args);
! String fileName= (String) arg.get("-f");
! if (fileName == null)
! fileName= (String) arg.get("-file");
if (fileName == null)
! {
System.err.println("Usage: -file=monFichier.mail -out=monFichierReecrit");
return;
}
File f= new File(fileName);
! if (!f.exists())
! {
System.err.println("Fichier inexistant " + f.getAbsolutePath());
return;
--- 94,108 ----
}
! public static void main(String[] args) {
HashMap arg= DodicoLib.parseArgs(args);
! String fileName= (String)arg.get("-f");
if (fileName == null)
! fileName= (String)arg.get("-file");
! if (fileName == null) {
System.err.println("Usage: -file=monFichier.mail -out=monFichierReecrit");
return;
}
File f= new File(fileName);
! if (!f.exists()) {
System.err.println("Fichier inexistant " + f.getAbsolutePath());
return;
***************
*** 119,124 ****
String base= f.getAbsolutePath();
int temp= base.lastIndexOf('.');
! if (temp < 0)
! {
System.err.println("Erreur.Le fichier ne possede pas d'extension");
return;
--- 110,114 ----
String base= f.getAbsolutePath();
int temp= base.lastIndexOf('.');
! if (temp < 0) {
System.err.println("Erreur.Le fichier ne possede pas d'extension");
return;
***************
*** 126,131 ****
base= base.substring(0, temp);
File cor= new File(base + ".cor");
! if (!cor.exists())
! {
System.err.println(
"Le fichier " + cor.getAbsolutePath() + " n'existe pas");
--- 116,120 ----
base= base.substring(0, temp);
File cor= new File(base + ".cor");
! if (!cor.exists()) {
System.err.println(
"Le fichier " + cor.getAbsolutePath() + " n'existe pas");
***************
*** 133,138 ****
}
File ele= new File(base + ".ele");
! if (!cor.exists())
! {
System.err.println(
"Le fichier " + ele.getAbsolutePath() + " n'existe pas");
--- 122,126 ----
}
File ele= new File(base + ".ele");
! if (!cor.exists()) {
System.err.println(
"Le fichier " + ele.getAbsolutePath() + " n'existe pas");
***************
*** 140,145 ****
}
File bth= new File(base + ".bth");
! if (!cor.exists())
! {
System.err.println(
"Le fichier " + bth.getAbsolutePath() + " n'existe pas");
--- 128,132 ----
}
File bth= new File(base + ".bth");
! if (!cor.exists()) {
System.err.println(
"Le fichier " + bth.getAbsolutePath() + " n'existe pas");
***************
*** 148,152 ****
CorEleBthReader reader= null;
CorEleBthInterface t= null;
! reader= new CorEleBthReader(CorEleBthFileFormat.getInstance());
reader.setIn(cor, ele, bth);
reader.setProgressReceiver(new ProgressionBuAdapter(null));
--- 135,140 ----
CorEleBthReader reader= null;
CorEleBthInterface t= null;
! reader=
! CorEleBthFileFormat.getInstance().getLastVersionImpl().createReader();
reader.setIn(cor, ele, bth);
reader.setProgressReceiver(new ProgressionBuAdapter(null));
***************
*** 156,190 ****
printAnalyze("FICHIERS cor,ele,bth", analyse);
H2dMaillage mail= t.getMaillage();
! if (mail != null)
! {
DodicoLib.printFields(mail, false);
}
! if (t == null)
! {
System.out.println("probl de lecture");
}
! String out= (String) arg.get("-out");
if (out == null)
return;
File corOut= new File(out + ".cor");
! if (corOut.exists())
! {
System.out.println("Le fichier existe deja " + corOut.getAbsolutePath());
return;
}
File eleOut= new File(out + ".ele");
! if (eleOut.exists())
! {
System.out.println("Le fichier existe deja " + eleOut.getAbsolutePath());
return;
}
File bthOut= new File(out + ".bth");
! if (bthOut.exists())
! {
System.out.println("Le fichier existe deja " + bthOut.getAbsolutePath());
return;
}
CorEleBthWriter w= null;
! w= new CorEleBthWriter(CorEleBthFileFormat.getInstance());
w.setFile(corOut, eleOut, bthOut);
w.setProgressReceiver(new ProgressionBuAdapter(null));
--- 144,173 ----
printAnalyze("FICHIERS cor,ele,bth", analyse);
H2dMaillage mail= t.getMaillage();
! if (mail != null) {
DodicoLib.printFields(mail, false);
}
! if (t == null) {
System.out.println("probl de lecture");
}
! String out= (String)arg.get("-out");
if (out == null)
return;
File corOut= new File(out + ".cor");
! if (corOut.exists()) {
System.out.println("Le fichier existe deja " + corOut.getAbsolutePath());
return;
}
File eleOut= new File(out + ".ele");
! if (eleOut.exists()) {
System.out.println("Le fichier existe deja " + eleOut.getAbsolutePath());
return;
}
File bthOut= new File(out + ".bth");
! if (bthOut.exists()) {
System.out.println("Le fichier existe deja " + bthOut.getAbsolutePath());
return;
}
CorEleBthWriter w= null;
! w= CorEleBthFileFormat.getInstance().getLastVersionImpl().createWriter();
w.setFile(corOut, eleOut, bthOut);
w.setProgressReceiver(new ProgressionBuAdapter(null));
***************
*** 199,216 ****
*
*/
! public void testEcriture()
! {
! CorEleBthInterface inter=getInter(fic_);
! File tmpFile=createTempFile();
! FileOperationSynthese syntheseR=CorEleBthFileFormat.getInstance().write(tmpFile, inter, null);
assertNull(syntheseR.getAnalyze());
_interfaceTest(getInter(tmpFile));
-
- }
! public CorEleBthInterface getInter(File _f)
! {
FileOperationSynthese syntheseR= new FileOperationSynthese();
! CorEleBthInterface r=CorEleBthFileFormat.getInstance().read(_f, syntheseR, null);
assertNull(syntheseR.getAnalyze());
return r;
--- 182,202 ----
*
*/
! public void testEcriture() {
! CorEleBthInterface inter= getInter(fic_);
! File tmpFile= createTempFile();
! FileOperationSynthese syntheseR=
! CorEleBthFileFormat.getInstance().getLastVersionImpl().write(
! tmpFile,
! inter,
! null);
assertNull(syntheseR.getAnalyze());
_interfaceTest(getInter(tmpFile));
! }
!
! public CorEleBthInterface getInter(File _f) {
FileOperationSynthese syntheseR= new FileOperationSynthese();
! CorEleBthInterface r=
! CorEleBthFileFormat.getInstance().getLastVersionImpl().read(_f, syntheseR, null);
assertNull(syntheseR.getAnalyze());
return r;
***************
*** 220,225 ****
*
*/
! public void testLecture()
! {
_interfaceTest(getInter(fic_));
--- 206,210 ----
*
*/
! public void testLecture() {
_interfaceTest(getInter(fic_));
Index: TestDunes.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/test/reflux/TestDunes.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** TestDunes.java 7 Aug 2003 08:01:42 -0000 1.7
--- TestDunes.java 18 Aug 2003 11:05:20 -0000 1.8
***************
*** 69,76 ****
assertEquals(pt.getY(), 1d, eps_);
assertEquals(pt.getZ(), 0.1, eps_);
! H2dElement[] elems = t.getMaillage().getElts();
! temp = elems.length;
assertEquals(temp, 9);
! int[] indices = elems[1].getPtIndex();
temp = indices.length;
assertEquals(temp, 3);
--- 69,76 ----
assertEquals(pt.getY(), 1d, eps_);
assertEquals(pt.getZ(), 0.1, eps_);
! //H2dElement[] elems = t.getMaillage().getElts();
! temp = t.getMaillage().getEltNb();
assertEquals(temp, 9);
! int[] indices = t.getMaillage().getElement(1).getPtIndex();
temp = indices.length;
assertEquals(temp, 3);
***************
*** 78,82 ****
assertEquals(indices[1], 0);
assertEquals(indices[2], 5);
! indices = elems[6].getPtIndex();
temp = indices.length;
assertEquals(temp, 3);
--- 78,82 ----
assertEquals(indices[1], 0);
assertEquals(indices[2], 5);
! indices = t.getMaillage().getElement(6).getPtIndex();
temp = indices.length;
assertEquals(temp, 3);
***************
*** 93,97 ****
DunesInterface inter=getInter(fic_);
File tmpFile=createTempFile();
! FileOperationSynthese syntheseR=DunesFileFormat.getInstance().write(tmpFile, inter, null);
assertNull(syntheseR.getAnalyze());
_interfaceTest(getInter(tmpFile));
--- 93,97 ----
DunesInterface inter=getInter(fic_);
File tmpFile=createTempFile();
! FileOperationSynthese syntheseR=DunesFileFormat.getInstance().getLastVersionImpl().write(tmpFile, inter, null);
assertNull(syntheseR.getAnalyze());
_interfaceTest(getInter(tmpFile));
***************
*** 102,106 ****
{
FileOperationSynthese syntheseR= new FileOperationSynthese();
! DunesInterface r=DunesFileFormat.getInstance().read(_f, syntheseR, null);
assertNull(syntheseR.getAnalyze());
if(syntheseR.containsMessages())
--- 102,106 ----
{
FileOperationSynthese syntheseR= new FileOperationSynthese();
! DunesInterface r=DunesFileFormat.getInstance().getLastVersionImpl().read(_f, syntheseR, null);
assertNull(syntheseR.getAnalyze());
if(syntheseR.containsMessages())
***************
*** 140,144 ****
ProgressionBuAdapter progress = new ProgressionBuAdapter(new BuTask());
FileOperationSynthese op=new FileOperationSynthese();
! DunesInterface inter = DunesFileFormat.getInstance().read(f, op, progress);
if(op.containsMessages()) op.getAnalyze().printResume();
fileName = (String) arg.get("-out");
--- 140,144 ----
ProgressionBuAdapter progress = new ProgressionBuAdapter(new BuTask());
FileOperationSynthese op=new FileOperationSynthese();
! DunesInterface inter = DunesFileFormat.getInstance().getLastVersionImpl().read(f, op, progress);
if(op.containsMessages()) op.getAnalyze().printResume();
fileName = (String) arg.get("-out");
***************
*** 154,158 ****
return;
}
! FileOperationSynthese opw=DunesFileFormat.getInstance().write(out, inter, progress);
if(opw.containsMessages()) opw.getAnalyze().printResume();
--- 154,158 ----
return;
}
! FileOperationSynthese opw=DunesFileFormat.getInstance().getLastVersionImpl().write(out, inter, progress);
if(opw.containsMessages()) opw.getAnalyze().printResume();
Index: TestINP.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/test/reflux/TestINP.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** TestINP.java 6 Aug 2003 08:36:31 -0000 1.5
--- TestINP.java 18 Aug 2003 11:05:20 -0000 1.6
***************
*** 52,60 ****
public void _interfaceTest(INPInterface _t)
{
INPInterface t=_t;
assertTrue("5.0".equals(t.getVersion()));
assertEquals(t.getTypeProjet(), H2dProjetType.COURANTOLOGIE_2D);
assertNotNull(t.getEntiteValue());
! assertTrue(t.getEntiteValue().containsKey(t.getDicoModel().getEntite("ITERATION")));
H2dMaillage m=t.getMaillage();
assertEquals(m.getPtsNb(), 1791);
--- 52,61 ----
public void _interfaceTest(INPInterface _t)
{
+ INPFileFormat.INPVersion version=INPFileFormat.getInstance().getLastINPVersionImpl();
INPInterface t=_t;
assertTrue("5.0".equals(t.getVersion()));
assertEquals(t.getTypeProjet(), H2dProjetType.COURANTOLOGIE_2D);
assertNotNull(t.getEntiteValue());
! assertTrue(t.getEntiteValue().containsKey(version.getDico().getEntite("ITERATION")));
H2dMaillage m=t.getMaillage();
assertEquals(m.getPtsNb(), 1791);
***************
*** 67,71 ****
assertEquals(pt.getY(), 7.5,eps_);
assertEquals(pt.getZ(), 12.030303,eps_);
! int[] itemp=t.getMaillage().getPtsExtremitesElement();
assertNotNull("Les points frontiere ne sont pas nuls",itemp);
assertEquals(itemp[5], 18);
--- 68,72 ----
assertEquals(pt.getY(), 7.5,eps_);
assertEquals(pt.getZ(), 12.030303,eps_);
! int[] itemp=t.getPtsExtremitesElement();
assertNotNull("Les points frontiere ne sont pas nuls",itemp);
assertEquals(itemp[5], 18);
***************
*** 103,109 ****
! H2dElement[] elems=t.getMaillage().getElts();
! assertEquals(elems.length, 792);
! itemp=elems[791].getPtIndex();
assertEquals(itemp[0], 1788);
assertEquals(itemp[1], 1789);
--- 104,110 ----
! //H2dElement[] elems=t.getMaillage().getElts();
! assertEquals(t.getMaillage().getEltNb(), 792);
! itemp=t.getMaillage().getElement(791).getPtIndex();
assertEquals(itemp[0], 1788);
assertEquals(itemp[1], 1789);
***************
*** 171,178 ****
Map dtemp=t.getEntiteValue();
assertNotNull(dtemp);
- H2dRefluxDicoModel model=t.getDicoModel();
for(int i=8;i>=0;i--)
{
! DicoEntite ent=model.getCoefContribution(i);
assertNotNull(ent);
assertEquals(Double.parseDouble((String)dtemp.get(ent)) , i,eps_);
--- 172,178 ----
Map dtemp=t.getEntiteValue();
assertNotNull(dtemp);
for(int i=8;i>=0;i--)
{
! DicoEntite ent=version.getCoefContribution(i);
assertNotNull(ent);
assertEquals(Double.parseDouble((String)dtemp.get(ent)) , i,eps_);
***************
*** 206,210 ****
{
FileOperationSynthese syntheseR= new FileOperationSynthese();
! INPInterface r=INPFileFormat.getInstance().read(_f, syntheseR, null);
if(syntheseR.getAnalyze()!=null)
System.out.println( syntheseR.getAnalyze().getResume());
--- 206,210 ----
{
FileOperationSynthese syntheseR= new FileOperationSynthese();
! INPInterface r=INPFileFormat.getInstance().getLastINPVersionImpl().read(_f, syntheseR, null);
if(syntheseR.getAnalyze()!=null)
System.out.println( syntheseR.getAnalyze().getResume());
***************
*** 246,250 ****
FileOperationSynthese syntheseR= new FileOperationSynthese();
! INPInterface inpInter=INPFileFormat.getInstance().read(f, syntheseR, null);
DodicoAnalyze infos = syntheseR.getAnalyze();
if (infos != null)
--- 246,250 ----
FileOperationSynthese syntheseR= new FileOperationSynthese();
! INPInterface inpInter=INPFileFormat.getInstance().getLastINPVersionImpl().read(f, syntheseR, null);
DodicoAnalyze infos = syntheseR.getAnalyze();
if (infos != null)
|