#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
offsets=np.memmap(fd,dtype=rd._type_off,mode='r',offset=ref+rd._off_off,shape=(rd._nb_cells,))
offsets=self.__swapIfNecessary(rd._bo,offsets) ; connLgth=offsets[-1] ; offsets2=DataArrayInt(rd._nb_cells+1) ; offsets2.setIJ(0,0,0)
offsets2[1:]=DataArrayInt(offsets)
offsets=np.memmap(fd,dtype=rd._type_off,mode='r',offset=ref+rd._off_off,shape=(rd._nb_cells,))
offsets=self.__swapIfNecessary(rd._bo,offsets) ; connLgth=offsets[-1] ; offsets2=DataArrayInt(rd._nb_cells+1) ; offsets2.setIJ(0,0,0)
offsets2[1:]=DataArrayInt(offsets)
- tmp1=DataArrayInt(len(offsets2),2) ; tmp1[:,0]=1 ; tmp1[:,1]=offsets2 ; tmp1.rearrange(1) ; tmp1.computeOffsets2()
+ tmp1=DataArrayInt(len(offsets2),2) ; tmp1[:,0]=1 ; tmp1[:,1]=offsets2 ; tmp1.rearrange(1) ; tmp1.computeOffsetsFull()
tmp1=DataArrayInt.Range(1,2*len(offsets2),2).buildExplicitArrByRanges(tmp1)
conn=np.memmap(fd,dtype=rd._type_conn,mode='r',offset=ref+rd._off_conn,shape=(connLgth,))
conn=self.__swapIfNecessary(rd._bo,conn)
tmp1=DataArrayInt.Range(1,2*len(offsets2),2).buildExplicitArrByRanges(tmp1)
conn=np.memmap(fd,dtype=rd._type_conn,mode='r',offset=ref+rd._off_conn,shape=(connLgth,))
conn=self.__swapIfNecessary(rd._bo,conn)
conn2[offsets[0:-1]]=types
conn2[tmp1]=DataArrayInt(conn)
m.setConnectivity(conn2,offsets,True)
conn2[offsets[0:-1]]=types
conn2[tmp1]=DataArrayInt(conn)
m.setConnectivity(conn2,offsets,True)
# Fields on nodes and on cells
for spatialDisc,nbEnt,fields in [(ON_NODES,rd._nb_nodes,rd._node_fields),(ON_CELLS,rd._nb_cells,rd._cell_fields)]:
for name,typ,nbCompo,off in fields:
# Fields on nodes and on cells
for spatialDisc,nbEnt,fields in [(ON_NODES,rd._nb_nodes,rd._node_fields),(ON_CELLS,rd._nb_cells,rd._cell_fields)]:
for name,typ,nbCompo,off in fields:
vals=np.memmap(fd,dtype=typ,mode='r',offset=ref+off,shape=(nbEnt*nbCompo))
vals=self.__swapIfNecessary(rd._bo,vals)
arr=DataArrayDouble(np.array(vals,dtype='float64')) ; arr.rearrange(nbCompo)
vals=np.memmap(fd,dtype=typ,mode='r',offset=ref+off,shape=(nbEnt*nbCompo))
vals=self.__swapIfNecessary(rd._bo,vals)
arr=DataArrayDouble(np.array(vals,dtype='float64')) ; arr.rearrange(nbCompo)
f.setTime(self._time[0],self._time[1],0)
ff.appendFieldNoProfileSBT(f)
fs.pushField(ff)
f.setTime(self._time[0],self._time[1],0)
ff.appendFieldNoProfileSBT(f)
fs.pushField(ff)
def __init__(self,fileName,tim=(0.,0)):
msg="The time specified in constructor as 2nd arg should be a tuple containing 2 values 1 float and 1 int !"
def __init__(self,fileName,tim=(0.,0)):
msg="The time specified in constructor as 2nd arg should be a tuple containing 2 values 1 float and 1 int !"