geoMesh=geoMesh->buildPartOfMySelf(pflArr->begin(),pflArr->end(),true);
}
//
+ geoMesh->writeVTK("geo.vtu");
+ //
MCAuto<MEDCouplingFieldDouble> fakeF(MEDCouplingFieldDouble::New(ON_GAUSS_PT));
fakeF->setMesh(geoMesh);
+ int nbg(loc.getGaussWeights().size());
fakeF->setGaussLocalizationOnType(gt,loc.getRefCoords(),loc.getGaussCoords(),loc.getGaussWeights());
MCAuto<DataArrayDouble> ptsForLoc(fakeF->getLocalizationOfDiscr());
+ {
+ MCAuto<MEDCouplingUMesh> ptsForLoc1(MEDCouplingUMesh::Build0DMeshFromCoords(ptsForLoc));
+ ptsForLoc1->writeVTK("pts.vtu");
+ }
//
MCAuto<DataArrayDouble> rot;
{
MCAuto<MEDCouplingFieldDouble> dir(geoMesh->buildDirectionVectorField());
rot=dir->getArray()->fromCartToSpher();
}
- int nbPts(ptsForLoc->getNumberOfTuples()),nbCompo(ptsForLoc->getNumberOfComponents());
+ int nbCells(geoMesh->getNumberOfCells()),nbCompo(ptsForLoc->getNumberOfComponents());
MCAuto<DataArrayDouble> secPts(section->getCoords()->changeNbOfComponents(nbCompo,0.));
int nbSecPts(secPts->getNumberOfTuples());
{
}
const double CENTER[3]={0.,0.,0.},AX0[3]={0.,0.,1.};
double AX1[3]; AX1[2]=0.;
- std::vector< MCAuto<DataArrayDouble> > arrs(nbPts);
- for(int j=0;j<nbPts;j++)
+ std::vector< MCAuto<DataArrayDouble> > arrs(nbCells*nbg);
+ for(int j=0;j<nbCells;j++)
{
MCAuto<DataArrayDouble> p(secPts->deepCopy());
double ang0(rot->getIJ(j,2));
AX1[0]=-sin(ang0); AX1[1]=cos(ang0);// rot Oy around OZ
double ang1(M_PI/2.-rot->getIJ(j,1));
DataArrayDouble::Rotate3DAlg(CENTER,AX1,ang1,nbSecPts,p->begin(),p->getPointer());
- for(int k=0;k<nbCompo;k++)
- p->applyLin(1.,ptsForLoc->getIJ(j,k),k);
- arrs[j]=p;
+ for(int l=0;l<nbg;l++)
+ {
+ MCAuto<DataArrayDouble> p2(p->deepCopy());
+ for(int k=0;k<nbCompo;k++)
+ p2->applyLin(1.,ptsForLoc->getIJ(j*nbg+l,k),k);
+ arrs[j*nbg+l]=p2;
+ }
}
std::vector<const DataArrayDouble *> arrs2(VecAutoToVecOfCstPt(arrs));
MCAuto<DataArrayDouble> resu(DataArrayDouble::Aggregate(arrs2));
MCAuto<MEDFileMeshSupports> mss(MEDFileMeshSupports::New(fid));
MCAuto<MEDFileStructureElements> mse(MEDFileStructureElements::New(fid,mss));
int nbEntities(mse->getNumberOfNodesPerSE(_geo_type_name));
- _conn=DataArrayInt::New(); _conn->alloc(nCells,nbEntities);
+ _conn=DataArrayInt::New(); _conn->alloc(nCells*nbEntities);
MEDFILESAFECALLERRD0(MEDmeshElementConnectivityRd,(fid,mName.c_str(),dt,it,MED_STRUCT_ELEMENT,_geo_type,MED_NODAL,MED_FULL_INTERLACE,_conn->getPointer()));
+ _conn->applyLin(1,-1);
+ _conn->rearrange(nbEntities);
_common=MEDFileUMeshPerTypeCommon::New();
_common->loadCommonPart(fid,mName.c_str(),dt,it,nCells,geoType,MED_STRUCT_ELEMENT,mrs);
std::vector<std::string> vns(mse->getVarAttsOf(_geo_type_name));