Back to index

salome-med  6.5.0
Public Member Functions | Static Public Attributes
MEDLoaderDataForTest.MEDLoaderDataForTest Class Reference

List of all members.

Public Member Functions

def build1DMesh_1
def build2DCurveMesh_1
def build2DMesh_1
def build2DMesh_2
def build2DMesh_3
def build3DMesh_1
def build3DSurfMesh_1
def build3DMesh_2
def buildMultiLevelMesh_1
def buildVecFieldOnCells_1
def buildVecFieldOnNodes_1
def buildVecFieldOnGauss_1
def buildVecFieldOnGauss_2
def buildVecFieldOnGauss_2_Simpler
def buildVecFieldOnGaussNE_1

Static Public Attributes

tuple build2DCurveMesh_1 = classmethod(build2DCurveMesh_1)
tuple build2DMesh_1 = classmethod(build2DMesh_1)
tuple build2DMesh_2 = classmethod(build2DMesh_2)
tuple build2DMesh_3 = classmethod(build2DMesh_3)
tuple build3DMesh_1 = classmethod(build3DMesh_1)
tuple build3DSurfMesh_1 = classmethod(build3DSurfMesh_1)
tuple build3DMesh_2 = classmethod(build3DMesh_2)
tuple buildMultiLevelMesh_1 = classmethod(buildMultiLevelMesh_1)
tuple buildVecFieldOnCells_1 = classmethod(buildVecFieldOnCells_1)
tuple buildVecFieldOnNodes_1 = classmethod(buildVecFieldOnNodes_1)
tuple buildVecFieldOnGauss_1 = classmethod(buildVecFieldOnGauss_1)
tuple buildVecFieldOnGauss_2 = classmethod(buildVecFieldOnGauss_2)
tuple buildVecFieldOnGauss_2_Simpler = classmethod(buildVecFieldOnGauss_2_Simpler)
tuple buildVecFieldOnGaussNE_1 = classmethod(buildVecFieldOnGaussNE_1)

Detailed Description

Definition at line 24 of file MEDLoaderDataForTest.py.


Member Function Documentation

Definition at line 25 of file MEDLoaderDataForTest.py.

00025 
00026     def build1DMesh_1(cls):
00027         coords=[ 0.0, 0.3, 0.75, 1.0, 1.4, 1.3 ]
00028         conn=[ 0,1, 1,2, 2,3 , 3,4,5]
00029         mesh=MEDCouplingUMesh.New();
00030         mesh.setName("1DMesh_1");
00031         mesh.setMeshDimension(1);
00032         mesh.allocateCells(4);
00033         mesh.insertNextCell(NORM_SEG2,2,conn[0:2])
00034         mesh.insertNextCell(NORM_SEG2,2,conn[2:4])
00035         mesh.insertNextCell(NORM_SEG2,2,conn[4:6])
00036         mesh.insertNextCell(NORM_SEG3,3,conn[6:9])
00037         mesh.finishInsertingCells();
00038         myCoords=DataArrayDouble.New();
00039         myCoords.setValues(coords,6,1);
00040         myCoords.setInfoOnComponent(0,"tototototototot [m*m*m*m*m*m*m*m]");
00041         mesh.setCoords(myCoords);
00042         return mesh;

Definition at line 43 of file MEDLoaderDataForTest.py.

00043 
00044     def build2DCurveMesh_1(cls):
00045         coords=[ 0.0,0.0, 0.3,0.3, 0.75,0.75, 1.0,1.0, 1.4,1.4, 1.3,1.3 ]
00046         conn=[ 0,1, 1,2, 2,3 , 3,4,5]
00047         mesh=MEDCouplingUMesh.New();
00048         mesh.setName("2DCurveMesh_1");
00049         mesh.setMeshDimension(1);
00050         mesh.allocateCells(4);
00051         mesh.insertNextCell(NORM_SEG2,2,conn[0:2])
00052         mesh.insertNextCell(NORM_SEG2,2,conn[2:4])
00053         mesh.insertNextCell(NORM_SEG2,2,conn[4:6])
00054         mesh.insertNextCell(NORM_SEG3,3,conn[6:9])
00055         mesh.finishInsertingCells();
00056         myCoords=DataArrayDouble.New();
00057         myCoords.setValues(coords,6,2);
00058         mesh.setCoords(myCoords);
00059         return mesh;

Definition at line 60 of file MEDLoaderDataForTest.py.

00060 
00061     def build2DMesh_1(cls):
00062         targetCoords=[-0.3,-0.3, 0.2,-0.3, 0.7,-0.3, -0.3,0.2, 0.2,0.2, 0.7,0.2, -0.3,0.7, 0.2,0.7, 0.7,0.7,
00063                       -0.05,0.95, 0.2,1.2, 0.45,0.95]
00064         targetConn=[1,4,2, 4,5,2, 6,10,8,9,11,7, 0,3,4,1, 6,7,4,3, 7,8,5,4]
00065         targetMesh=MEDCouplingUMesh.New();
00066         targetMesh.setMeshDimension(2);
00067         targetMesh.allocateCells(6);
00068         targetMesh.setName("2DMesh_1");
00069         targetMesh.insertNextCell(NORM_TRI3,3,targetConn[0:3])
00070         targetMesh.insertNextCell(NORM_TRI3,3,targetConn[3:6])
00071         targetMesh.insertNextCell(NORM_TRI6,6,targetConn[6:12])
00072         targetMesh.insertNextCell(NORM_QUAD4,4,targetConn[12:16])
00073         targetMesh.insertNextCell(NORM_QUAD4,4,targetConn[16:20])
00074         targetMesh.insertNextCell(NORM_POLYGON,4,targetConn[20:24])
00075         targetMesh.finishInsertingCells();
00076         myCoords=DataArrayDouble.New();
00077         myCoords.setValues(targetCoords,12,2);
00078         myCoords.setInfoOnComponent(0,"tototototototot [m]");
00079         myCoords.setInfoOnComponent(1,"energie [kW]");
00080         targetMesh.setCoords(myCoords)
00081         return targetMesh;

Definition at line 82 of file MEDLoaderDataForTest.py.

00082 
00083     def build2DMesh_2(cls):
00084         targetCoords=[-0.3,-0.3, 0.2,-0.3, 0.7,-0.3, -0.3,0.2, 0.2,0.2, 0.7,0.2, -0.3,0.7, 0.2,0.7, 0.7,0.7,
00085                       -0.05,0.95, 0.2,1.2, 0.45,0.95]
00086         targetConn=[1,4,2, 4,5,2, 6,10,8,9,11,7, 0,3,4,1, 6,7,4,3, 7,8,5,4]
00087         targetMesh=MEDCouplingUMesh.New();
00088         targetMesh.setMeshDimension(2);
00089         targetMesh.allocateCells(5);
00090         targetMesh.setName("2DMesh_2");
00091         targetMesh.insertNextCell(NORM_TRI3,3,targetConn[0:3])
00092         targetMesh.insertNextCell(NORM_TRI3,3,targetConn[3:6])
00093         targetMesh.insertNextCell(NORM_QUAD4,4,targetConn[12:16])
00094         targetMesh.insertNextCell(NORM_QUAD4,4,targetConn[16:20])
00095         targetMesh.insertNextCell(NORM_TRI6,6,targetConn[6:12])
00096         targetMesh.finishInsertingCells();
00097         myCoords=DataArrayDouble.New();
00098         myCoords.setValues(targetCoords,12,2);
00099         myCoords.setInfoOnComponent(0,"toto [m]");
00100         myCoords.setInfoOnComponent(1,"energie [kW]");
00101         targetMesh.setCoords(myCoords);
00102         return targetMesh;

Definition at line 104 of file MEDLoaderDataForTest.py.

00104 
00105     def build2DMesh_3(cls):
00106         targetCoords=[-0.3,-0.3, 0.2,-0.3, 0.7,-0.3, -0.3,0.2, 0.2,0.2, 0.7,0.2, -0.3,0.7, 0.2,0.7, 0.7,0.7,
00107                       -0.05,0.95, 0.2,1.2, 0.45,0.95]
00108         targetConn=[1,4,2, 4,5,2, 6,10,8,9,11,7, 0,3,4,1, 6,7,4,3, 7,8,5,4]
00109         targetMesh=MEDCouplingUMesh.New();
00110         targetMesh.setMeshDimension(2);
00111         targetMesh.allocateCells(13);
00112         targetMesh.setName("2DMesh_3");
00113         targetMesh.insertNextCell(NORM_TRI3,3,targetConn[0:3])
00114         targetMesh.insertNextCell(NORM_TRI3,3,targetConn[3:6])
00115         targetMesh.insertNextCell(NORM_TRI3,3,targetConn[0:3])
00116         targetMesh.insertNextCell(NORM_TRI3,3,targetConn[3:6])
00117         targetMesh.insertNextCell(NORM_TRI3,3,targetConn[0:3])
00118         targetMesh.insertNextCell(NORM_TRI3,3,targetConn[3:6])
00119         targetMesh.insertNextCell(NORM_QUAD4,4,targetConn[12:16])
00120         targetMesh.insertNextCell(NORM_QUAD4,4,targetConn[16:20])
00121         targetMesh.insertNextCell(NORM_QUAD4,4,targetConn[12:16])
00122         targetMesh.insertNextCell(NORM_QUAD4,4,targetConn[16:20])
00123         targetMesh.insertNextCell(NORM_TRI6,6,targetConn[6:12])
00124         targetMesh.insertNextCell(NORM_TRI6,6,targetConn[6:12])
00125         targetMesh.insertNextCell(NORM_TRI6,6,targetConn[6:12])
00126         targetMesh.finishInsertingCells();
00127         myCoords=DataArrayDouble.New();
00128         myCoords.setValues(targetCoords,12,2);
00129         myCoords.setInfoOnComponent(0,"toto [m]");
00130         myCoords.setInfoOnComponent(1,"energie [kW]");
00131         targetMesh.setCoords(myCoords);
00132         return targetMesh;

Definition at line 133 of file MEDLoaderDataForTest.py.

00133 
00134     def build3DMesh_1(cls):
00135         coords=[0.,0.,0., 1.,1.,0., 1.,1.25,0., 0.,1.,0., 1.,1.5,0., 2.,0.,0., 2.,1.,0., 1.,2.,0., 0.,2.,0., 3.,1.,0.,
00136                 3.,2.,0., 0.,1.,0., 1.,3.,0., 2.,2.,0., 2.,3.,0.,
00137                 0.,0.,1., 1.,1.,1., 1.,1.25,1., 0.,1.,1., 1.,1.5,1., 2.,0.,1., 2.,1.,1., 1.,2.,1., 0.,2.,1., 3.,1.,1.,
00138                 3.,2.,1., 0.,1.,1., 1.,3.,1., 2.,2.,1., 2.,3.,1.,
00139                 0.,0.,2., 1.,1.,2., 1.,1.25,2., 0.,1.,2., 1.,1.5,2., 2.,0.,2., 2.,1.,2., 1.,2.,2., 0.,2.,2., 3.,1.,2.,
00140         3.,2.,2., 0.,1.,2., 1.,3.,2., 2.,2.,2., 2.,3.,2.,
00141                 0.,0.,3., 1.,1.,3., 1.,1.25,3., 0.,1.,3., 1.,1.5,3., 2.,0.,3., 2.,1.,3., 1.,2.,3., 0.,2.,3., 3.,1.,3.,
00142                 3.,2.,3., 0.,1.,3., 1.,3.,3., 2.,2.,3., 2.,3.,3.]
00143         conn=[
00144             # 0
00145             0,11,1,3,15,26,16,18,   1,2,4,7,13,6,-1,1,16,21,6,-1,6,21,28,13,-1,13,7,22,28,-1,7,4,19,22,-1,4,2,17,19,-1,2,1,16,17,-1,16,21,28,22,19,17,
00146             1,6,5,3,16,21,20,18,   13,10,9,6,28,25,24,21,
00147             11,8,7,4,2,1,-1,11,26,16,1,-1,1,16,17,2,-1,2,17,19,4,-1,4,19,22,7,-1,7,8,23,22,-1,8,11,26,23,-1,26,16,17,19,22,23,
00148             7,12,14,13,22,27,29,28,
00149             # 1
00150             15,26,16,18,30,41,31,33,   16,17,19,22,28,21,-1,16,31,36,21,-1,21,36,43,28,-1,28,22,37,43,-1,22,19,34,37,-1,19,17,32,34,-1,17,16,31,32,-1,31,36,43,37,34,32,
00151             16,21,20,18,31,36,35,33,   28,25,24,21,43,40,39,36,
00152             26,23,22,19,17,16,-1,26,41,31,16,-1,16,31,32,17,-1,17,32,34,19,-1,19,34,37,22,-1,22,23,38,37,-1,23,26,41,38,-1,41,31,32,34,37,38,
00153             22,27,29,28,37,42,44,43,
00154             # 2
00155             30,41,31,33,45,56,46,48,  31,32,34,37,43,36,-1,31,46,51,36,-1,36,51,58,43,-1,43,37,52,58,-1,37,34,49,52,-1,34,32,47,49,-1,32,31,46,47,-1,46,51,58,52,49,47,
00156             31,36,35,33,46,51,50,48,  43,40,39,36,58,55,54,51,
00157             41,38,37,34,32,31,-1,41,56,46,31,-1,31,46,47,32,-1,32,47,49,34,-1,34,49,52,37,-1,37,38,53,52,-1,38,41,56,53,-1,56,46,47,49,52,53,
00158             37,42,44,43,52,57,59,58]
00159         #
00160         ret=MEDCouplingUMesh.New();
00161         ret.setName("3DMesh_1");
00162         ret.setMeshDimension(3);
00163         ret.allocateCells(18);
00164         #
00165         ret.insertNextCell(NORM_HEXA8,8,conn[0:8])
00166         ret.insertNextCell(NORM_HEXA8,8,conn[51:59])
00167         ret.insertNextCell(NORM_HEXA8,8,conn[59:67])
00168         ret.insertNextCell(NORM_HEXA8,8,conn[110:118])
00169         #
00170         ret.insertNextCell(NORM_HEXA8,8,conn[118:126])
00171         ret.insertNextCell(NORM_HEXA8,8,conn[169:177])
00172         ret.insertNextCell(NORM_HEXA8,8,conn[177:185])
00173         ret.insertNextCell(NORM_HEXA8,8,conn[228:236])
00174         #
00175         ret.insertNextCell(NORM_HEXA8,8,conn[236:244])
00176         ret.insertNextCell(NORM_HEXA8,8,conn[287:295])
00177         ret.insertNextCell(NORM_HEXA8,8,conn[295:303])
00178         ret.insertNextCell(NORM_HEXA8,8,conn[346:354])
00179         #
00180         ret.insertNextCell(NORM_POLYHED,43,conn[8:51])
00181         ret.insertNextCell(NORM_POLYHED,43,conn[67:110])
00182         ret.insertNextCell(NORM_POLYHED,43,conn[126:169])
00183         ret.insertNextCell(NORM_POLYHED,43,conn[185:228])
00184         ret.insertNextCell(NORM_POLYHED,43,conn[244:287])
00185         ret.insertNextCell(NORM_POLYHED,43,conn[303:346])
00186         #
00187         ret.finishInsertingCells();
00188         myCoords=DataArrayDouble.New();
00189         myCoords.setValues(coords,60,3);
00190         myCoords.setInfoOnComponent(0,"titi [m]");
00191         myCoords.setInfoOnComponent(1,"density power [MW/m^3]");
00192         myCoords.setInfoOnComponent(2,"t [kW]");
00193         ret.setCoords(myCoords);
00194         return ret;
    

Definition at line 217 of file MEDLoaderDataForTest.py.

00217 
00218     def build3DMesh_2(cls):
00219         m3dsurfBase=MEDLoaderDataForTest.build3DSurfMesh_1();
00220         numbers=[0,1,2,3,5]
00221         m3dsurf=m3dsurfBase.buildPartOfMySelf(numbers,False);
00222         m1dBase=MEDLoaderDataForTest.build1DMesh_1();
00223         numbers2=[0,1,2,3]
00224         m1d=m1dBase.buildPartOfMySelf(numbers2,False);
00225         m1d.changeSpaceDimension(3);
00226         vec=[0.,1.,0.]
00227         pt=[0.,0.,0.]
00228         m1d.rotate(pt,vec,-pi/2.);
00229         ret=m3dsurf.buildExtrudedMesh(m1d,0);
00230         return ret;

Definition at line 195 of file MEDLoaderDataForTest.py.

00195 
00196     def build3DSurfMesh_1(cls):
00197         targetCoords=[-0.3,-0.3,-0.3, 0.2,-0.3,-0.3, 0.7,-0.3,-0.3, -0.3,0.2,-0.3, 0.2,0.2,-0.3, 0.7,0.2,-0.3, -0.3,0.7,-0.3, 0.2,0.7,-0.3, 0.7,0.7,-0.3
00198                       ,-0.05,0.95,-0.3, 0.2,1.2,-0.3, 0.45,0.95,-0.3]
00199         targetConn=[1,4,2, 4,5,2, 6,10,8,9,11,7, 0,3,4,1, 6,7,4,3, 7,8,5,4]
00200         targetMesh=MEDCouplingUMesh.New();
00201         targetMesh.setMeshDimension(2);
00202         targetMesh.allocateCells(6);
00203         targetMesh.setName("3DSurfMesh_1");
00204         targetMesh.insertNextCell(NORM_TRI3,3,targetConn[0:3])
00205         targetMesh.insertNextCell(NORM_TRI3,3,targetConn[3:6])
00206         targetMesh.insertNextCell(NORM_QUAD4,4,targetConn[12:16])
00207         targetMesh.insertNextCell(NORM_QUAD4,4,targetConn[16:20])
00208         targetMesh.insertNextCell(NORM_TRI6,6,targetConn[6:12])
00209         targetMesh.insertNextCell(NORM_POLYGON,4,targetConn[20:24])
00210         targetMesh.finishInsertingCells();
00211         myCoords=DataArrayDouble.New();
00212         myCoords.setValues(targetCoords,12,3);
00213         myCoords.setInfoOnComponent(0,"toto [m]");
00214         myCoords.setInfoOnComponent(2,"ff [km]");#component 1 is not set for test
00215         targetMesh.setCoords(myCoords);
00216         return targetMesh;
    

Definition at line 231 of file MEDLoaderDataForTest.py.

00231 
00232     def buildMultiLevelMesh_1(cls):
00233         coo=[10.,0.,10.,1.25,10.,2.5,10.,3.75,10.,5.,8.75,0.,8.75,1.25,8.75,2.5,8.75,3.75,8.75,5.,7.5,0.,7.5,1.25,7.5,2.5,7.5,3.75,7.5,5.,6.25,0.,6.25,1.25,6.25,2.5,6.25,3.75,6.25,5.,5.,0.,5.,1.25,5.,2.5,5.,3.75,5.,5.,3.75,0.,3.75,1.25,3.75,2.5,3.75,3.75,3.75,5.,2.5,0.,2.5,1.25,2.5,2.5,2.5,3.75,2.5,5.,1.25,0.,1.25,1.25,1.25,2.5,1.25,3.75,1.25,5.,0.,1.25,0.,2.5,0.,3.75,0.,5.,0.,0.,0.,5.,10.,5.,0.,10.,10.,10.,5.,5.,5.,5.,5.,10.,5.,10.,0.625,5.,1.25,5.,1.875,5.,2.5,5.,3.125,5.,3.75,5.,4.375,5.,5.,6.25,5.,7.5,5.,8.75,4.375,10.,3.75,10.,3.125,10.,2.5,10.,1.875,10.,1.25,10.,0.625,10.,0.,8.75,0.,7.5,0.,6.25,4.375,6.25,4.375,7.5,4.375,8.75,3.75,6.25,3.75,7.5,3.75,8.75,3.125,6.25,3.125,7.5,3.125,8.75,2.5,6.25,2.5,7.5,2.5,8.75,1.875,6.25,1.875,7.5,1.875,8.75,1.25,6.25,1.25,7.5,1.25,8.75,0.625,6.25,0.625,7.5,0.625,8.75,5.625,5.,6.25,5.,6.875,5.,7.5,5.,8.125,5.,8.75,5.,9.375,5.,10.,6.25,10.,7.5,10.,8.75,9.375,10.,8.75,10.,8.125,10.,7.5,10.,6.875,10.,6.25,10.,5.625,10.,5.,8.75,5.,7.5,5.,6.25,9.375,6.25,9.375,7.5,9.375,8.75,8.75,6.25,8.75,7.5,8.75,8.75,8.125,6.25,8.125,7.5,8.125,8.75,7.5,6.25,7.5,7.5,7.5,8.75,6.875,6.25,6.875,7.5,6.875,8.75,6.25,6.25,6.25,7.5,6.25,8.75,5.625,6.25,5.625,7.5,5.625,8.75]
00234         coo2=DataArrayDouble.New()
00235         coo2.setValues(coo,135,2)
00236         coo2=coo2.changeNbOfComponents(3,0.)
00237         coo2.setInfoOnComponent(0,"X [INCONNUE]")
00238         coo2.setInfoOnComponent(1,"Y [INCONNUE]")
00239         coo2.setInfoOnComponent(2,"Z [INCONNUE]")
00240         c2tri=[0,1,6,0,6,5,1,2,6,2,7,6,2,3,8,2,8,7,3,4,8,4,9,8,5,6,11,5,11,10,6,7,11,7,12,11,7,8,13,7,13,12,8,9,13,9,14,13,10,11,16,10,16,15,11,12,16,12,17,16,12,13,18,12,18,17,13,14,18,14,19,18,15,16,21,15,21,20,16,17,21,17,22,21,17,18,23,17,23,22,18,19,23,19,24,23,20,21,26,20,26,25,21,22,26,22,27,26,22,23,28,22,28,27,23,24,28,24,29,28,25,26,31,25,31,30,26,27,31,27,32,31,27,28,33,27,33,32,28,29,33,29,34,33,30,31,36,30,36,35,31,32,36,32,37,36,32,33,38,32,38,37,33,34,38,34,39,38,35,36,40,35,40,44,36,37,40,37,41,40,37,38,42,37,42,41,38,39,42,39,43,42]
00241         c2quad4=[46,101,114,100,101,102,115,114,102,103,116,115,103,48,104,116,100,114,117,99,114,115,118,117,115,116,119,118,116,104,105,119,99,117,120,98,117,118,121,120,118,119,122,121,119,105,106,122,98,120,123,97,120,121,124,123,121,122,125,124,122,106,107,125,97,123,126,96,123,124,127,126,124,125,128,127,125,107,108,128,96,126,129,95,126,127,130,129,127,128,131,130,128,108,109,131,95,129,132,94,129,130,133,132,130,131,134,133,131,109,110,134,94,132,113,50,132,133,112,113,133,134,111,112,134,110,51,111,49,60,73,59,60,61,74,73,61,62,75,74,62,52,63,75,59,73,76,58,73,74,77,76,74,75,78,77,75,63,64,78,58,76,79,57,76,77,80,79,77,78,81,80,78,64,65,81,57,79,82,56,79,80,83,82,80,81,84,83,81,65,66,84,56,82,85,55,82,83,86,85,83,84,87,86,84,66,67,87,55,85,88,54,85,86,89,88,86,87,90,89,87,67,68,90,54,88,91,53,88,89,92,91,89,90,93,92,90,68,69,93,53,91,72,45,91,92,71,72,92,93,70,71,93,69,47,70]
00242         m2=MEDCouplingUMesh.New("ma",2)
00243         m2.setCoords(coo2)
00244         m2.allocateCells(128)
00245         nbTri=len(c2tri)/3
00246         for i in xrange(nbTri):
00247             m2.insertNextCell(NORM_TRI3,3,c2tri[3*i:3*i+3])
00248             pass
00249         nbQua=len(c2quad4)/4
00250         for i in xrange(nbQua):
00251             m2.insertNextCell(NORM_QUAD4,4,c2quad4[4*i:4*i+4])
00252             pass
00253         m2.finishInsertingCells()
00254         m2.setDescription("CREE PAR CODE_ASTER")
00255         m1=MEDCouplingUMesh.New("ma",1)
00256         m1.setCoords(coo2)
00257         c1seg=[0,1,1,2,2,3,3,4,4,9,9,14,14,19,19,24,24,29,29,34,34,39,39,43,43,42,42,41,41,40,40,44,44,35,35,30,30,25,25,20,20,15,15,10,10,5,5,0,43,39,39,34,34,29,29,24,24,19,19,14,14,9,9,4,45,53,53,54,54,55,55,56,56,57,57,58,58,59,59,49,49,60,60,61,61,62,62,52,52,63,63,64,64,65,65,66,66,67,67,68,68,69,69,47,47,70,70,71,71,72,72,45,50,94,94,95,95,96,96,97,97,98,98,99,99,100,100,46,46,101,101,102,102,103,103,48,48,104,104,105,105,106,106,107,107,108,108,109,109,110,110,51,51,111,111,112,112,113,113,50]
00258         m1.allocateCells(80)
00259         for i in xrange(80):
00260             m1.insertNextCell(NORM_SEG2,2,c1seg[2*i:2*i+2])
00261             pass
00262         m1.finishInsertingCells()
00263         m1.setDescription("CREE PAR CODE_ASTER")
00264         m0=MEDCouplingUMesh.New("ma",0)
00265         m0.setCoords(coo2)
00266         c0pt=[44,0,47,48]
00267         m0.allocateCells(4)
00268         for i in xrange(4):
00269             m0.insertNextCell(NORM_POINT1,1,[c0pt[i]])
00270             pass
00271         m0.finishInsertingCells()
00272         f2=DataArrayInt.New()
00273         f2.alloc(128,1)
00274         f2[:64]=-1
00275         f2[64:96]=-2
00276         f2[96:]=-3
00277         f1=DataArrayInt.New()
00278         f1.alloc(80,1)
00279         f1[:4]=-8
00280         f1[4:12]=-9
00281         f1[12:16]=-10
00282         f1[16:24]=-11
00283         f1[24:28]=-12
00284         f1[28:32]=-13
00285         f1[32:40]=-14
00286         f1[40:44]=-15
00287         f1[44:52]=-16
00288         f1[52:56]=-17
00289         f1[56:64]=-18
00290         f1[64:68]=-19
00291         f1[68:76]=-20
00292         f1[76:]=-21
00293         f0=DataArrayInt.New()
00294         f0.setValues([-4,-5,-6,-7],4,1)
00295         p=DataArrayInt.New()
00296         p.alloc(135,1)
00297         p.fillWithZero()
00298         p1=DataArrayInt.New()
00299         p1.alloc(13,1)
00300         p1.iota(1)
00301         p[[0,4,24,43,44,45,46,47,48,49,50,51,52]]=p1
00302         n2=DataArrayInt.New()
00303         n2.alloc(128,1)
00304         n2.iota(1)
00305         n1=DataArrayInt.New()
00306         n1.alloc(80,1)
00307         n1.iota(133)
00308         n0=DataArrayInt.New()
00309         n0.alloc(4,1)
00310         n0.iota(129)
00311         fns=['A1A2____________________________', 'A1______________________________', 'A2A4____________________________', 'A2______________________________', 'A3A1____________________________', 'A3C5____________________________', 'A3______________________________', 'A4A3____________________________', 'A4______________________________', 'B1C1____________________________', 'B1______________________________', 'B2B4____________________________', 'B2______________________________', 'B3B1____________________________', 'B3______________________________', 'B4C3____________________________', 'B4______________________________', 'C1C4____________________________', 'C1______________________________', 'C2B2____________________________', 'C2______________________________', 'C3C2____________________________', 'C3______________________________', 'C4B3____________________________', 'C4______________________________', 'C5A4____________________________', 'C5______PMMA____________________', 'FAMILLE_ZERO', 'MESH____APPS____AP1_____________', 'MESH____APPS____AP2_____________', 'MESH____APPS____AP3_____________', 'MESH____APPS____AP4_____________', 'MESH____DALQ1___DALLE___________', 'MESH____DALQ2___DALLE___________', 'MESH____DALT3___DALLE___________']
00312         fids=[-11, 5, -8, 1, -10, -12, 4, -9, 2, -14, 6, -19, 7, -17, 8, -20, 9, -15, 10, -18, 11, -21, 12, -16, 13, -13, 3, 0, -4, -5, -6, -7, -3, -2, -1]
00313         grpns=['A1', 'A1A2', 'A2', 'A2A4', 'A3', 'A3A1', 'A3C5', 'A4', 'A4A3', 'AP1', 'AP2', 'AP3', 'AP4', 'APPS', 'B1', 'B1C1', 'B2', 'B2B4', 'B3', 'B3B1', 'B4', 'B4C3', 'C1', 'C1C4', 'C2', 'C2B2', 'C3', 'C3C2', 'C4', 'C4B3', 'C5', 'C5A4', 'DALLE', 'DALQ1', 'DALQ2', 'DALT3', 'MESH', 'PMMA']
00314         famIdsPerGrp=[[5],[-11],[1],[-8],[4],[-10],[-12],[2],[-9],[-4],[-5],[-6],[-7],[-4,-5,-6,-7],[6],[-14],[7],[-19],[8],[-17],[9],[-20],[10],[-15],[11],[-18],[12],[-21],[13],[-16],[3],[-13],[-3,-2,-1],[-3],[-2],[-1],[-4,-5,-6,-7,-3,-2,-1],[3]]
00315         return m2,m1,m0,f2,f1,f0,p,n2,n1,n0,fns,fids,grpns,famIdsPerGrp

Definition at line 316 of file MEDLoaderDataForTest.py.

00316 
00317     def buildVecFieldOnCells_1(cls):
00318         mesh=MEDLoaderDataForTest.build3DSurfMesh_1();
00319         nbOfCells=mesh.getNumberOfCells();
00320         f1=MEDCouplingFieldDouble.New(ON_CELLS,ONE_TIME);
00321         f1.setName("VectorFieldOnCells");
00322         f1.setMesh(mesh);
00323         array=DataArrayDouble.New();
00324         arr1=[0.,10.,20.,1.,11.,21.,2.,12.,22.,3.,13.,23.,4.,14.,24.,5.,15.,25.]
00325         array.setValues(arr1,nbOfCells,3);
00326         array.setInfoOnComponent(0,"power [MW/m^3]");
00327         array.setInfoOnComponent(1,"density [g/cm^3]");
00328         array.setInfoOnComponent(2,"temperature [K]");
00329         f1.setArray(array);
00330         tmp=array.getPointer();
00331         f1.setTime(2.,0,1);
00332         f1.checkCoherency();
00333         return f1;

Definition at line 352 of file MEDLoaderDataForTest.py.

00352 
00353     def buildVecFieldOnGauss_1(cls):
00354         _a=0.446948490915965;
00355         _b=0.091576213509771;
00356         _p1=0.11169079483905;
00357         _p2=0.0549758718227661;
00358         refCoo1=[ 0.,0., 1.,0., 0.,1. ]
00359         gsCoo1=[ 2*_b-1, 1-4*_b, 2*_b-1, 2.07*_b-1, 1-4*_b,
00360                  2*_b-1, 1-4*_a, 2*_a-1, 2*_a-1, 1-4*_a, 2*_a-1, 2*_a-1 ];
00361         wg1=[ 4*_p2, 4*_p2, 4*_p2, 4*_p1, 4*_p1, 4*_p1 ]
00362         _refCoo1=refCoo1;
00363         _gsCoo1=gsCoo1;
00364         _wg1=wg1;
00365         m=MEDLoaderDataForTest.build2DMesh_2();
00366         f=MEDCouplingFieldDouble.New(ON_GAUSS_PT,ONE_TIME);
00367         f.setTime(3.14,1,5);
00368         f.setMesh(m);
00369         f.setGaussLocalizationOnType(NORM_TRI3,_refCoo1,_gsCoo1,_wg1);
00370         refCoo2=[-1.0,1.0, -1.0,-1.0, 1.0,-1.0, -1.0,0.0, 0.0,-1.0, 0.0,0.0 ]
00371         _refCoo2=refCoo2;
00372         _gsCoo1=_gsCoo1[0:6];
00373         _gsCoo2=_gsCoo1
00374         _wg1=_wg1[0:3];
00375         _wg2=_wg1
00376         refCoo3=[ 0.,0., 1.,0., 1.,1., 0.,1. ]
00377         _refCoo3=refCoo3;
00378         _gsCoo1=_gsCoo1[0:4];
00379         _wg1=_wg1[0:2];
00380         f.setGaussLocalizationOnType(NORM_QUAD4,_refCoo3,_gsCoo1,_wg1);
00381         f.setGaussLocalizationOnType(NORM_TRI6,_refCoo2,_gsCoo2,_wg2);
00382         array=DataArrayDouble.New();
00383         array.alloc(19,2);
00384         ptr=array.getPointer();
00385         for i in xrange(19*2):
00386             array.setIJ(0,i,float(i+7));
00387             pass
00388         f.setArray(array);
00389         f.setName("MyFirstFieldOnGaussPoint");
00390         array.setInfoOnComponent(0,"power [MW/m^3]");
00391         array.setInfoOnComponent(1,"density");
00392         f.checkCoherency();
00393         return f;

Definition at line 394 of file MEDLoaderDataForTest.py.

00394 
00395     def buildVecFieldOnGauss_2(cls):
00396         _a=0.446948490915965;
00397         _b=0.091576213509771;
00398         _p1=0.11169079483905;
00399         _p2=0.0549758718227661;
00400         refCoo1=[ 0.,0., 1.,0., 0.,1. ]
00401         gsCoo1=[ 2*_b-1, 1-4*_b, 2*_b-1, 2.07*_b-1, 1-4*_b,
00402                  2*_b-1, 1-4*_a, 2*_a-1, 2*_a-1, 1-4*_a, 2*_a-1, 2*_a-1 ];
00403         wg1=[ 4*_p2, 4*_p2, 4*_p2, 4*_p1, 4*_p1, 4*_p1 ]
00404         _refCoo1=refCoo1;
00405         _gsCoo1=gsCoo1;
00406         _wg1=wg1;
00407         m=MEDLoaderDataForTest.build2DMesh_3();
00408         f=MEDCouplingFieldDouble.New(ON_GAUSS_PT,ONE_TIME);
00409         f.setTime(3.14,1,5);
00410         f.setMesh(m);
00411         di=DataArrayInt.New(); di.setValues([0,2,3],3,1)
00412         f.setGaussLocalizationOnCells(di,_refCoo1,_gsCoo1,_wg1)
00413         _wg1[-1]*=2
00414         f.setGaussLocalizationOnCells([1,5],_refCoo1,_gsCoo1,_wg1);
00415         _wg1[-1]*=2
00416         f.setGaussLocalizationOnCells([4],_refCoo1,_gsCoo1,_wg1);
00417         refCoo2=[-1.0,1.0, -1.0,-1.0, 1.0,-1.0, -1.0,0.0, 0.0,-1.0, 0.0,0.0 ]
00418         _refCoo2=refCoo2;
00419         _gsCoo1=_gsCoo1[0:6];
00420         _gsCoo2=_gsCoo1
00421         _wg1=_wg1[0:3];
00422         _wg2=_wg1
00423         refCoo3=[ 0.,0., 1.,0., 1.,1., 0.,1. ]
00424         _refCoo3=refCoo3;
00425         _gsCoo1=_gsCoo1[0:4];
00426         _wg1=_wg1[0:2];
00427         f.setGaussLocalizationOnCells([6,7,8],_refCoo3,_gsCoo1,_wg1);
00428         _wg1[-1]*=2
00429         f.setGaussLocalizationOnCells([9],_refCoo3,_gsCoo1,_wg1);
00430         f.setGaussLocalizationOnType(NORM_TRI6,_refCoo2,_gsCoo2,_wg2);
00431         array=DataArrayDouble.New();
00432         array.alloc(53,2);
00433         ptr=array.getPointer();
00434         for i in xrange(53*2):
00435             array.setIJ(0,i,float(i+7));
00436             pass
00437         f.setArray(array);
00438         f.setName("MyFirstFieldOnGaussPoint");
00439         array.setInfoOnComponent(0,"power [MW/m^3]");
00440         array.setInfoOnComponent(1,"density");
00441         f.checkCoherency();
00442         return f;

Definition at line 444 of file MEDLoaderDataForTest.py.

00444 
00445     def buildVecFieldOnGauss_2_Simpler(cls):
00446         _a=0.446948490915965;
00447         _b=0.091576213509771;
00448         _p1=0.11169079483905;
00449         _p2=0.0549758718227661;
00450         refCoo1=[ 0.,0., 1.,0., 0.,1. ]
00451         gsCoo1=[ 2*_b-1, 1-4*_b, 2*_b-1, 2.07*_b-1, 1-4*_b,
00452                  2*_b-1, 1-4*_a, 2*_a-1, 2*_a-1, 1-4*_a, 2*_a-1, 2*_a-1 ];
00453         wg1=[ 4*_p2, 4*_p2, 4*_p2, 4*_p1, 4*_p1, 4*_p1 ]
00454         _refCoo1=refCoo1;
00455         _gsCoo1=gsCoo1;
00456         _wg1=wg1;
00457         m=MEDLoaderDataForTest.build2DMesh_3();
00458         f=MEDCouplingFieldDouble.New(ON_GAUSS_PT,ONE_TIME);
00459         f.setTime(3.14,1,5);
00460         f.setMesh(m);
00461         di=DataArrayInt.New(); di.setValues([0,1,2],3,1)
00462         f.setGaussLocalizationOnCells(di,_refCoo1,_gsCoo1,_wg1)
00463         _wg1[-1]*=2
00464         f.setGaussLocalizationOnCells([3,4],_refCoo1,_gsCoo1,_wg1);
00465         _wg1[-1]*=2
00466         f.setGaussLocalizationOnCells([5],_refCoo1,_gsCoo1,_wg1);
00467         refCoo2=[-1.0,1.0, -1.0,-1.0, 1.0,-1.0, -1.0,0.0, 0.0,-1.0, 0.0,0.0 ]
00468         _refCoo2=refCoo2;
00469         _gsCoo1=_gsCoo1[0:6];
00470         _gsCoo2=_gsCoo1
00471         _wg1=_wg1[0:3];
00472         _wg2=_wg1
00473         refCoo3=[ 0.,0., 1.,0., 1.,1., 0.,1. ]
00474         _refCoo3=refCoo3;
00475         _gsCoo1=_gsCoo1[0:4];
00476         _wg1=_wg1[0:2];
00477         f.setGaussLocalizationOnCells([6,7,8],_refCoo3,_gsCoo1,_wg1);
00478         _wg1[-1]*=2
00479         f.setGaussLocalizationOnCells([9],_refCoo3,_gsCoo1,_wg1);
00480         f.setGaussLocalizationOnType(NORM_TRI6,_refCoo2,_gsCoo2,_wg2);
00481         array=DataArrayDouble.New();
00482         array.alloc(53,2);
00483         ptr=array.getPointer();
00484         for i in xrange(53*2):
00485             array.setIJ(0,i,float(i+7));
00486             pass
00487         f.setArray(array);
00488         f.setName("MyFirstFieldOnGaussPoint");
00489         array.setInfoOnComponent(0,"power [MW/m^3]");
00490         array.setInfoOnComponent(1,"density");
00491         f.checkCoherency();
00492         return f;

Definition at line 493 of file MEDLoaderDataForTest.py.

00493 
00494     def buildVecFieldOnGaussNE_1(cls):
00495         m=MEDLoaderDataForTest.build2DMesh_2();
00496         f=MEDCouplingFieldDouble.New(ON_GAUSS_NE,ONE_TIME);
00497         f.setTime(3.14,1,5);
00498         f.setMesh(m);
00499         array=DataArrayDouble.New();
00500         array.alloc(20,2);
00501         for i in xrange(2*20):
00502             array.setIJ(0,i,float(i+8));
00503         f.setArray(array);
00504         array.setInfoOnComponent(0,"power [W]");
00505         array.setInfoOnComponent(1,"temperature");
00506         f.setName("MyFieldOnGaussNE");
00507         f.checkCoherency();
00508         return f;
    

Definition at line 334 of file MEDLoaderDataForTest.py.

00334 
00335     def buildVecFieldOnNodes_1(cls):
00336         mesh=MEDLoaderDataForTest.build3DSurfMesh_1();
00337         nbOfNodes=mesh.getNumberOfNodes();
00338         f1=MEDCouplingFieldDouble.New(ON_NODES,ONE_TIME);
00339         f1.setName("VectorFieldOnNodes");
00340         f1.setMesh(mesh);
00341         array=DataArrayDouble.New();
00342         f1.setArray(array);
00343         arr1=[70.,80.,90.,71.,81.,91.,72.,82.,92.,73.,83.,93.,74.,84.,94.,75.,85.,95.,
00344         1000.,10010.,10020.,1001.,10011.,10021.,1002.,10012.,10022.,1003.,10013.,10023.,1004.,10014.,10024.,1005.,10015.,10025.]
00345         array.setValues(arr1,nbOfNodes,3);
00346         array.setInfoOnComponent(0,"power [MW/m^3]");
00347         array.setInfoOnComponent(1,"density [g/cm^3]");
00348         array.setInfoOnComponent(2,"temperature [K]");
00349         f1.setTime(2.12,2,3);
00350         f1.checkCoherency();
00351         return f1;


Member Data Documentation

Definition at line 510 of file MEDLoaderDataForTest.py.

Definition at line 511 of file MEDLoaderDataForTest.py.

Definition at line 512 of file MEDLoaderDataForTest.py.

Definition at line 513 of file MEDLoaderDataForTest.py.

Definition at line 514 of file MEDLoaderDataForTest.py.

Definition at line 516 of file MEDLoaderDataForTest.py.

Definition at line 515 of file MEDLoaderDataForTest.py.

Definition at line 517 of file MEDLoaderDataForTest.py.

Definition at line 518 of file MEDLoaderDataForTest.py.

Definition at line 520 of file MEDLoaderDataForTest.py.

Definition at line 521 of file MEDLoaderDataForTest.py.

Definition at line 522 of file MEDLoaderDataForTest.py.

Definition at line 523 of file MEDLoaderDataForTest.py.

Definition at line 519 of file MEDLoaderDataForTest.py.


The documentation for this class was generated from the following file: