Skip to content
Snippets Groups Projects
Commit ab383e0c authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

pp

parent 14bd21cd
No related branches found
No related tags found
No related merge requests found
// Gmsh - Copyright (C) 1997-2012 C. Geuzaine, J.-F. Remacle
//
// See the LICENSE.txt file for license information. Please report all
// bugs and problems to <gmsh@geuz.org>.
#include "meshGFaceBoundaryLayers.h" #include "meshGFaceBoundaryLayers.h"
#include "GModel.h" #include "GModel.h"
#include "GRegion.h" #include "GRegion.h"
...@@ -9,7 +14,7 @@ ...@@ -9,7 +14,7 @@
// //
// ^ ni // ^ ni
// | // |
// | // |
// +-----------------+ // +-----------------+
// bi / // bi /
...@@ -27,7 +32,7 @@ static double solidAngle (SVector3 &ni, SVector3 &nj, ...@@ -27,7 +32,7 @@ static double solidAngle (SVector3 &ni, SVector3 &nj,
double a = atan2(sina.norm(),cosa); double a = atan2(sina.norm(),cosa);
double sign = dot (nj, bibj); double sign = dot (nj, bibj);
return sign > 0 ? fabs (a) : -fabs(a); return sign > 0 ? fabs (a) : -fabs(a);
} }
BoundaryLayerColumns* buildAdditionalPoints3D_CAD_BASED (GRegion *gr) { BoundaryLayerColumns* buildAdditionalPoints3D_CAD_BASED (GRegion *gr) {
} }
...@@ -61,7 +66,7 @@ BoundaryLayerColumns* buildAdditionalPoints3D (GRegion *gr) ...@@ -61,7 +66,7 @@ BoundaryLayerColumns* buildAdditionalPoints3D (GRegion *gr)
while(itf != faces.end()){ while(itf != faces.end()){
if (blf->isFaceBL((*itf)->tag())){ if (blf->isFaceBL((*itf)->tag())){
printf("FACE %d is a boundary layer face %d triangles\n",(*itf)->tag(),(*itf)->triangles.size()); printf("FACE %d is a boundary layer face %d triangles\n",(*itf)->tag(),(*itf)->triangles.size());
for(unsigned int i = 0; i< (*itf)->triangles.size(); i++) for(unsigned int i = 0; i< (*itf)->triangles.size(); i++)
for(unsigned int j = 0; j< 3; j++){ for(unsigned int j = 0; j< 3; j++){
if ((*itf)->triangles[i]->getVertex(j)->onWhat()->dim() != 3){ if ((*itf)->triangles[i]->getVertex(j)->onWhat()->dim() != 3){
_columns->_non_manifold_faces.insert(std::make_pair((*itf)->triangles[i]->getVertex(j),(*itf)->triangles[i])); _columns->_non_manifold_faces.insert(std::make_pair((*itf)->triangles[i]->getVertex(j),(*itf)->triangles[i]));
...@@ -73,7 +78,7 @@ BoundaryLayerColumns* buildAdditionalPoints3D (GRegion *gr) ...@@ -73,7 +78,7 @@ BoundaryLayerColumns* buildAdditionalPoints3D (GRegion *gr)
++itf; ++itf;
} }
printf("%d vertices \n",_vertices.size()); printf("%d vertices \n",_vertices.size());
// assume that the initial mesh has been created i.e. that there exist // assume that the initial mesh has been created i.e. that there exist
// tetrahedra inside the domain. Tetrahedra are used to define // tetrahedra inside the domain. Tetrahedra are used to define
// exterior normals // exterior normals
...@@ -87,8 +92,8 @@ BoundaryLayerColumns* buildAdditionalPoints3D (GRegion *gr) ...@@ -87,8 +92,8 @@ BoundaryLayerColumns* buildAdditionalPoints3D (GRegion *gr)
MVertex *v2 = f.getVertex(2); MVertex *v2 = f.getVertex(2);
MVertex *v3 = 0; MVertex *v3 = 0;
for (int k=0;k<4;k++){ for (int k=0;k<4;k++){
if (gr->tetrahedra[i]->getVertex(k) != v0 && if (gr->tetrahedra[i]->getVertex(k) != v0 &&
gr->tetrahedra[i]->getVertex(k) != v1 && gr->tetrahedra[i]->getVertex(k) != v1 &&
gr->tetrahedra[i]->getVertex(k) != v2 ){ gr->tetrahedra[i]->getVertex(k) != v2 ){
v3 = gr->tetrahedra[i]->getVertex(k); v3 = gr->tetrahedra[i]->getVertex(k);
} }
...@@ -102,9 +107,9 @@ BoundaryLayerColumns* buildAdditionalPoints3D (GRegion *gr) ...@@ -102,9 +107,9 @@ BoundaryLayerColumns* buildAdditionalPoints3D (GRegion *gr)
if (sign > 0)it->second = n; if (sign > 0)it->second = n;
else it->second = n*(-1.0); else it->second = n*(-1.0);
} }
} }
} }
// for all boundry points // for all boundry points
for (std::set<MVertex*>::iterator it = _vertices.begin(); it != _vertices.end() ; ++it){ for (std::set<MVertex*>::iterator it = _vertices.begin(); it != _vertices.end() ; ++it){
std::vector<MTriangle*> _connections; std::vector<MTriangle*> _connections;
...@@ -115,7 +120,7 @@ BoundaryLayerColumns* buildAdditionalPoints3D (GRegion *gr) ...@@ -115,7 +120,7 @@ BoundaryLayerColumns* buildAdditionalPoints3D (GRegion *gr)
_connections.push_back (itm->second); _connections.push_back (itm->second);
_allDirs.push_back (_normals[itm->second->getFace(0)]); _allDirs.push_back (_normals[itm->second->getFace(0)]);
} }
// a list of normals is associated to a given vertex // a list of normals is associated to a given vertex
SPoint3 p ((*it)->x(),(*it)->y(),(*it)->z()); SPoint3 p ((*it)->x(),(*it)->y(),(*it)->z());
std::vector<std::vector<int> > groupsOfDirections; std::vector<std::vector<int> > groupsOfDirections;
...@@ -129,7 +134,7 @@ BoundaryLayerColumns* buildAdditionalPoints3D (GRegion *gr) ...@@ -129,7 +134,7 @@ BoundaryLayerColumns* buildAdditionalPoints3D (GRegion *gr)
SPoint3 bj = _connections[iDir]->barycenter(); SPoint3 bj = _connections[iDir]->barycenter();
SVector3 nj = _allDirs[iDir]; SVector3 nj = _allDirs[iDir];
double angle = solidAngle (ni,nj,bi,bj); double angle = solidAngle (ni,nj,bi,bj);
// those two directions are // those two directions are
if (angle < _treshold){ if (angle < _treshold){
found = true; found = true;
groupsOfDirections[j].push_back(i); groupsOfDirections[j].push_back(i);
...@@ -144,8 +149,8 @@ BoundaryLayerColumns* buildAdditionalPoints3D (GRegion *gr) ...@@ -144,8 +149,8 @@ BoundaryLayerColumns* buildAdditionalPoints3D (GRegion *gr)
groupsOfDirections.push_back(newDir); groupsOfDirections.push_back(newDir);
} }
} }
std::vector<SVector3> shoot; std::vector<SVector3> shoot;
for (unsigned int j=0;j<groupsOfDirections.size();j++){ for (unsigned int j=0;j<groupsOfDirections.size();j++){
SVector3 n; SVector3 n;
...@@ -156,7 +161,7 @@ BoundaryLayerColumns* buildAdditionalPoints3D (GRegion *gr) ...@@ -156,7 +161,7 @@ BoundaryLayerColumns* buildAdditionalPoints3D (GRegion *gr)
n.normalize(); n.normalize();
shoot.push_back(n); shoot.push_back(n);
} }
// now create the BL points // now create the BL points
for (unsigned int DIR=0;DIR<shoot.size();DIR++){ for (unsigned int DIR=0;DIR<shoot.size();DIR++){
SVector3 n = shoot[DIR]; SVector3 n = shoot[DIR];
......
// Gmsh - Copyright (C) 1997-2012 C. Geuzaine, J.-F. Remacle
//
// See the LICENSE.txt file for license information. Please report all
// bugs and problems to <gmsh@geuz.org>.
#include "PView.h" #include "PView.h"
#include "PViewData.h" #include "PViewData.h"
#include "PViewAsSimpleFunction.h" #include "PViewAsSimpleFunction.h"
double PViewEvaluator::operator() (const double x, const double y, const double z) const{
double PViewEvaluator::operator() (const double x, const double y, const double z) const
{
PViewData * pvd = _pv->getData(); PViewData * pvd = _pv->getData();
double value; double value;
bool found = pvd->searchScalar(x,y,z,&value,_step); bool found = pvd->searchScalar(x, y, z, &value, _step);
if (found) return value; if (found) return value;
return 1.e22; return 1.e22;
} }
// Gmsh - Copyright (C) 1997-2012 C. Geuzaine, J.-F. Remacle
//
// See the LICENSE.txt file for license information. Please report all
// bugs and problems to <gmsh@geuz.org>.
#ifndef _PVIEW_AS_SIMPLEFUNCTION_H #ifndef _PVIEW_AS_SIMPLEFUNCTION_H
#define _PVIEW_AS_SIMPLEFUNCTION_H #define _PVIEW_AS_SIMPLEFUNCTION_H
#include "simpleFunction.h" #include "simpleFunction.h"
class PView; class PView;
class PViewEvaluator : public simpleFunction<double> { class PViewEvaluator : public simpleFunction<double> {
PView *_pv; PView *_pv;
int _step; int _step;
public: public:
PViewEvaluator (PView *pv) : _pv(pv),_step(0) {} PViewEvaluator (PView *pv) : _pv(pv), _step(0) {}
double operator() (const double x, const double y, const double z) const; double operator() (const double x, const double y, const double z) const;
void setStep (int s) {_step=s;} void setStep (int s) { _step = s; }
}; };
#endif #endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment