Skip to content

Commit

Permalink
Fix issue#154 : remove Face meshing properties directional, orthogona…
Browse files Browse the repository at this point in the history
…l, rotational
  • Loading branch information
lelandaisb committed Dec 6, 2024
1 parent 3a1ebc9 commit 7ea979f
Show file tree
Hide file tree
Showing 32 changed files with 16 additions and 2,316 deletions.
3 changes: 0 additions & 3 deletions Docs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ set(DOXYGEN_DIRS
${PROJECT_SOURCE_DIR}/src/Core/protected/Topo/EdgeMeshingPropertyGlobalInterpolate.h
${PROJECT_SOURCE_DIR}/src/Core/protected/Topo/EdgeMeshingPropertyTabulated.h
${PROJECT_SOURCE_DIR}/src/Core/protected/Topo/EdgeMeshingPropertyBeta.h
${PROJECT_SOURCE_DIR}/src/Core/protected/Topo/FaceMeshingPropertyDirectional.h
${PROJECT_SOURCE_DIR}/src/Core/protected/Topo/FaceMeshingPropertyOrthogonal.h
${PROJECT_SOURCE_DIR}/src/Core/protected/Topo/FaceMeshingPropertyRotational.h
${PROJECT_SOURCE_DIR}/src/Core/protected/Topo/FaceMeshingPropertyTransfinite.h
${PROJECT_SOURCE_DIR}/src/Core/protected/Topo/FaceMeshingPropertyDelaunayGMSH.h
${PROJECT_SOURCE_DIR}/src/Core/protected/Topo/FaceMeshingPropertyQuadPairing.h
Expand Down
1 change: 0 additions & 1 deletion src/Core/Internal/ImportMDLImplementation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,6 @@ void ImportMDLImplementation::performTopo(Internal::InfoCommand* icmd)
}
// sélection de la méthode transfinie ou directionnelle si possible
m_icmd->addTopoInfoEntity (coface, Internal::InfoCommand::CREATED);
coface->selectBasicMeshLaw(m_icmd);

} else {
// cas non-structuré
Expand Down
4 changes: 0 additions & 4 deletions src/Core/Internal/ServiceGeomToTopo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,6 @@ bool ServiceGeomToTopo::convertBlockStructured(const int ni, const int nj, const
if (bloc->structurable()){
bloc->structure(m_icmd);

bloc->selectBasicMeshLaw(m_icmd);

// cas où le nombre de bras est donné par l'utilisateur
if (ni>0 && nj>0 && nk>0){
std::vector<Topo::CoEdge*> coedges;
Expand Down Expand Up @@ -114,8 +112,6 @@ bool ServiceGeomToTopo::convertCoFaceStructured()
if (coface->structurable()){
coface->structure(m_icmd);

coface->selectBasicMeshLaw(m_icmd);

return false; // ok
}
else
Expand Down
134 changes: 3 additions & 131 deletions src/Core/Mesh/MeshImplementationStructured.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
#include "Topo/TopoHelper.h"
#include "Topo/EdgeMeshingPropertyUniform.h"
#include "Topo/EdgeMeshingPropertyTabulated.h"
#include "Topo/FaceMeshingPropertyDirectional.h"
#include "Topo/FaceMeshingPropertyOrthogonal.h"
#include "Topo/FaceMeshingPropertyRotational.h"
#include "Topo/BlockMeshingData.h"
#include "Topo/TopoHelper.h"

Expand Down Expand Up @@ -71,10 +68,6 @@ void MeshImplementation::preMeshStrutured(Topo::Block* bl)
{
std::cout <<"Maillage du bloc structuré "<<bl->getName()<<" avec la méthode "
<< bl->getMeshLawName();
if (bl->getMeshLaw() == Topo::BlockMeshingProperty::rotational
|| bl->getMeshLaw() == Topo::BlockMeshingProperty::directional
|| bl->getMeshLaw() == Topo::BlockMeshingProperty::orthogonal)
std::cout << " et direction "<<(short)bl->getBlockMeshingProperty()->getDir();
std::cout << std::endl;

std::vector<std::string> groupsName;
Expand Down Expand Up @@ -511,137 +504,16 @@ void MeshImplementation::preMeshStrutured(Topo::CoFace* coface)

}// end for cote<4

if (coface->getMeshLaw() == Topo::CoFaceMeshingProperty::transfinite)
if (coface->getMeshLaw() == Topo::CoFaceMeshingProperty::transfinite) {
discretiseTransfinie(nbBrasI, nbBrasJ, l_points);
else if (coface->getMeshLaw() == Topo::CoFaceMeshingProperty::rotational){
Utils::Math::Point axis1;
Utils::Math::Point axis2;
Topo::FaceMeshingPropertyRotational* prop =
dynamic_cast<Topo::FaceMeshingPropertyRotational*>(coface->getCoFaceMeshingProperty());
CHECK_NULL_PTR_ERROR(prop);
prop->getAxis(axis1, axis2);
uint dir = prop->getDir();

discretiseRotation(nbBrasI, nbBrasJ, 0, l_points, axis1, axis2, dir);

}
else if (coface->getMeshLaw() == Topo::CoFaceMeshingProperty::directional
|| coface->getMeshLaw() == Topo::CoFaceMeshingProperty::orthogonal){

Topo::CoEdgeMeshingProperty *empI, *empJ;
Topo::FaceMeshingPropertyDirectional* prop =
dynamic_cast<Topo::FaceMeshingPropertyDirectional*>(coface->getCoFaceMeshingProperty());
CHECK_NULL_PTR_ERROR(prop);
uint dir = prop->getDir();
Topo::CoEdgeMeshingProperty *empDir[2];

// il faut retrouver si possible la discrétisation depuis une arête
// on peut se permettre de reconstruire une loi uniforme pour les directions
// qui ne sont pas celle de la discrétisation
if (dir == 0){
bool is_inverted;
empDir[1] = new Topo::EdgeMeshingPropertyUniform(nbBrasJ);
Topo::CoEdgeMeshingProperty * empTmp = coface->getMeshingProperty(Topo::CoFace::i_dir, is_inverted);
// si elle est interpolée, on s'en passe
if (empTmp && empTmp->getMeshLaw() != Topo::CoEdgeMeshingProperty::interpolate){
empDir[0] = empTmp->clone();
if (is_inverted)
empDir[0]->setDirect(!empDir[0]->getDirect());
}
else
empDir[0] = 0;

} else {
bool is_inverted;
empDir[0] = new Topo::EdgeMeshingPropertyUniform(nbBrasI);
Topo::CoEdgeMeshingProperty * empTmp = coface->getMeshingProperty(Topo::CoFace::j_dir, is_inverted);
// si elle est interpolée, on s'en passe
if (empTmp && empTmp->getMeshLaw() != Topo::CoEdgeMeshingProperty::interpolate){
empDir[1] = empTmp->clone();
if (is_inverted)
empDir[1]->setDirect(!empDir[1]->getDirect());
}
else
empDir[1] = 0;
}

// si la discrétisation est nulle (cas interpolée ou composée), on la remplace par une version tabulée
if (empDir[dir] == 0){
std::vector<Topo::CoEdge* > coedges;
Topo::Vertex* vtx1;
Topo::Vertex* vtx2;
std::map<Topo::CoEdge*,uint> ratios;
if (dir == 0){
Topo::Edge* edge = coface->getEdge(1);
edge->getCoEdges(coedges);
vtx1 = coface->getVertex(1);
vtx2 = coface->getVertex(2);
for (uint i=0; i<coedges.size(); i++)
ratios[coedges[i]] = edge->getRatio(coedges[i]);

}
else {
Topo::Edge* edge = coface->getEdge(0);
edge->getCoEdges(coedges);
vtx1 = coface->getVertex(1);
vtx2 = coface->getVertex(0);
for (uint i=0; i<coedges.size(); i++)
ratios[coedges[i]] = edge->getRatio(coedges[i]);
}

// ordonne les coedges
std::vector<Topo::CoEdge* > coedges_between;
Topo::TopoHelper::getCoEdgesBetweenVertices(vtx1, vtx2, coedges, coedges_between);

std::vector<Utils::Math::Point> edge_points;
Topo::TopoHelper::getPoints(vtx1, vtx2, coedges_between, ratios, edge_points);

// calcul des longueurs des bras
std::vector<double> tabulation;
for (uint i=1; i<edge_points.size(); i++)
tabulation.push_back(edge_points[i].length(edge_points[i-1]));

// création d'une discrétisation basée sur les points des discrétisations des arêtes
empDir[dir] = new Topo::EdgeMeshingPropertyTabulated(tabulation);


} // end if ((dir == 0 && empDir[0] == 0) || (dir == 1 && empDir[1] == 0))

if (coface->getMeshLaw() == Topo::CoFaceMeshingProperty::orthogonal){
Topo::FaceMeshingPropertyOrthogonal* fmp = dynamic_cast<Topo::FaceMeshingPropertyOrthogonal*>(prop);
CHECK_NULL_PTR_ERROR(fmp);
uint side = fmp->getSide();
uint nbLayers = fmp->getNbLayers();
// recherche de la surface / laquelle il faut être orthogonal
// on ne connait pas la normale à une courbe ...
Geom::Surface* surface = 0;
Topo::Edge* edge = coface->getEdge(dir+side*2);
std::vector<Topo::CoEdge*> coedges;
edge->getCoEdges(coedges);
//std::cout<<"orthogonal pour "<<coface->getName()<<" dir="<<dir<<", side="<<side<<" edge="<<edge->getName()<<std::endl;
for (uint i=0; i<coedges.size(); i++)
if (coedges[i]->getGeomAssociation() != 0){
surface = dynamic_cast<Geom::Surface*>(coedges[i]->getGeomAssociation());
//std::cout<<" surface trouvée à partir de "<<coedges[i]->getName()<<std::endl;
}

discretiseOrthogonalPuisCourbe(empDir[0], empDir[1], l_points, dir, side, nbLayers, surface);
}
else
discretiseDirection(empDir[0], empDir[1], l_points, dir);

for (uint i=0; i<2; i++)
delete empDir[i];

}
else {
} else {
throw TkUtil::Exception (TkUtil::UTF8String ("Erreur interne dans MeshImplementation::meshStrutured pour face, type de maillage invalide", TkUtil::Charset::UTF_8));
}


// on ne fait pas de projection sur la surface pour les discrétisations
// directionnelles et rotationnelles
if (coface->getGeomAssociation() && coface->getMeshLaw() > Topo::CoFaceMeshingProperty::rotational){
if (coface->getGeomAssociation()){
#ifdef _DEBUG_MESH
std::cout <<" Projection des noeuds de la coface "<<coface->getName()<<" sur la surface "<<coface->getGeomAssociation()->getName()<<std::endl;
#endif
Expand Down
30 changes: 0 additions & 30 deletions src/Core/Topo/Block.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
#include "Topo/TopoDisplayRepresentation.h"
#include "Topo/CommandEditTopo.h"
#include "Topo/EdgeMeshingPropertyUniform.h"
#include "Topo/FaceMeshingPropertyDirectional.h"
#include "Topo/FaceMeshingPropertyRotational.h"
#include "Topo/FaceMeshingPropertyTransfinite.h"
#include "Topo/FaceMeshingPropertyDelaunayGMSH.h"
#include "Topo/BlockMeshingPropertyTransfinite.h"
Expand Down Expand Up @@ -3446,34 +3444,6 @@ getRatios(std::map<CoEdge*,uint> &ratios)
} // end for i<getNbFaces()
}
/*----------------------------------------------------------------------------*/
void Block::
selectBasicMeshLaw(Internal::InfoCommand* icmd, bool forceCompute)
{
#ifdef _DEBUG2
std::cout<<"selectBasicMeshLaw pour "<<getName()<<" cas d'un bloc avec MeshLaw à "<<getMeshLawName()<<std::endl;
#endif
std::vector<Topo::CoEdge* > iCoedges[3];
getOrientedCoEdges(iCoedges[0], iCoedges[1], iCoedges[2]);

std::vector<Topo::Vertex* > sommets;
getHexaVertices(sommets);

// une des 3 directions convient-elle ?
for (uint j=0; j<3; j++){
std::vector<std::vector<CoEdge* > > coedges_dirs;
for (uint k=0; k<4; k++){
std::vector<CoEdge* > coedges_dir1;

TopoHelper::getCoEdgesBetweenVertices(sommets[TopoHelper::tabIndVtxByEdgeAndDirOnBlock[j][k][0]],
sommets[TopoHelper::tabIndVtxByEdgeAndDirOnBlock[j][k][1]],
iCoedges[j],
coedges_dir1);
coedges_dirs.push_back(coedges_dir1);

} // end for k
} // end for j
}
/*----------------------------------------------------------------------------*/
Utils::Math::Point Block::getBarycentre() const
{
Utils::Math::Point barycentre;
Expand Down
Loading

0 comments on commit 7ea979f

Please sign in to comment.