move parallel mesh interface

This commit is contained in:
Joachim Schoeberl 2011-08-29 10:09:11 +00:00
parent 71c6645567
commit 7c088f5f6f
8 changed files with 149 additions and 10 deletions

View File

@ -209,10 +209,10 @@ namespace netgen
class DummySurface : public Surface
{
virtual double CalcFunctionValue (const Point<3> & point) const
virtual double CalcFunctionValue (const Point<3> & /* point */) const
{ return 0; }
virtual void CalcGradient (const Point<3> & point, Vec<3> & grad) const
virtual void CalcGradient (const Point<3> & /* point */, Vec<3> & grad) const
{ grad = Vec<3> (0,0,0); }
virtual Point<3> GetSurfacePoint () const
@ -221,7 +221,7 @@ namespace netgen
virtual double HesseNorm () const
{ return 0; }
virtual void Project (Point<3> & p) const
virtual void Project (Point<3> & /* p */) const
{ ; }
virtual void Print (ostream & ost) const

View File

@ -2,7 +2,7 @@ noinst_HEADERS = acisgeom.hpp gprim.hpp meshing.hpp occgeom.hpp \
visual.hpp csg.hpp incvis.hpp myadt.hpp opti.hpp geometry2d.hpp \
linalg.hpp mydefs.hpp parallel.hpp stlgeom.hpp mystdlib.h
include_HEADERS = nginterface.h nginterface_v2.hpp parallelinterface.hpp
include_HEADERS = nginterface.h nginterface_v2.hpp
AM_CPPFLAGS =
METASOURCES = AUTO

View File

@ -294,6 +294,38 @@ extern "C" {
/* void Ng_SetGhostEdge ( const int ednum, const bool aisghost ); */
/* void Ng_SetGhostFace ( const int fanum, const bool aisghost ); */
// the folling functions are 0-base !!
int NgPar_GetLoc2Glob_VolEl ( int locnum );
// int NgPar_GetDistantNodeNums ( int nt, int locnum, int * procs, int * distnum);
// number on distant processor
// gibt anzahl an distant pnums zurueck
// * pnums entspricht ARRAY<int[2] >
int NgPar_GetDistantNodeNums ( int nodetype, int locnum, int * pnums );
int NgPar_GetNDistantNodeNums ( int nodetype, int locnum );
int NgPar_GetDistantPNum ( int proc, int locnum ) ;
int NgPar_GetDistantEdgeNum ( int proc, int locnum ) ;
int NgPar_GetDistantFaceNum ( int proc, int locnum ) ;
int NgPar_GetDistantElNum ( int proc, int locnum );
bool NgPar_IsExchangeFace ( int fnr ) ;
bool NgPar_IsExchangeVert ( int vnum );
bool NgPar_IsExchangeEdge ( int ednum );
bool NgPar_IsExchangeElement ( int elnum );
void NgPar_PrintParallelMeshTopology ();
bool NgPar_IsElementInPartition ( int elnum, int dest );
bool NgPar_IsGhostFace ( int facenum );
bool NgPar_IsGhostEdge ( int edgenum );
#endif
namespace netgen {

View File

@ -1,3 +1,6 @@
gibt's nicht mehr
#ifndef FILE_PARALLELINTERFACE
#define FILE_PARALLELINTERFACE

View File

@ -1013,6 +1013,110 @@ int Ng_Overlap ()
// return mesh->GetParallelTopology() . Overlap();
}
int NgPar_GetLoc2Glob_VolEl ( int locnum )
{
return mesh -> GetParallelTopology().GetLoc2Glob_VolEl ( locnum+1) -1;
}
// gibt anzahl an distant pnums zurueck
// * pnums entspricht ARRAY<int[2] >
int NgPar_GetDistantNodeNums ( int nodetype, int locnum, int * distnums )
{
int size;
switch ( nodetype )
{
case 0:
size = mesh->GetParallelTopology().GetDistantPNums( locnum+1, distnums );
break;
case 1:
size = mesh->GetParallelTopology().GetDistantEdgeNums( locnum+1, distnums );
break;
case 2:
size = mesh->GetParallelTopology().GetDistantFaceNums( locnum+1, distnums );
break;
case 3:
size = mesh->GetParallelTopology().GetDistantElNums( locnum+1, distnums );
break;
default:
cerr << "NgPar_GetDistantNodeNums() Unknown nodetype " << nodetype << endl;
size = -1;
}
// 0 - based
for ( int i = 0; i < size; i++ )
distnums[2*i+1]--;
return size;
}
int NgPar_GetNDistantNodeNums ( int nodetype, int locnum )
{
switch ( nodetype )
{
case 0:
return mesh->GetParallelTopology().GetNDistantPNums( locnum+1 );
case 1:
return mesh->GetParallelTopology().GetNDistantEdgeNums( locnum+1 );
case 2:
return mesh->GetParallelTopology().GetNDistantFaceNums( locnum+1 );
case 3:
return mesh->GetParallelTopology().GetNDistantElNums( locnum+1 );
}
return -1;
}
int NgPar_GetDistantPNum ( int proc, int locpnum )
{
return mesh->GetParallelTopology().GetDistantPNum( proc, locpnum+1) - 1;
}
int NgPar_GetDistantEdgeNum ( int proc, int locpnum )
{
return mesh->GetParallelTopology().GetDistantEdgeNum( proc, locpnum+1) - 1;
}
int NgPar_GetDistantFaceNum ( int proc, int locpnum )
{
return mesh->GetParallelTopology().GetDistantFaceNum (proc, locpnum+1 ) - 1;
}
int NgPar_GetDistantElNum ( int proc, int locelnum )
{
return mesh->GetParallelTopology().GetDistantElNum (proc, locelnum+1 ) - 1;
}
bool NgPar_IsExchangeFace ( int fnr )
{
return (mesh->GetParallelTopology().GetNDistantFaceNums( fnr+1 ) > 0);
// return mesh->GetParallelTopology().IsExchangeFace ( fnr+1 );
}
bool NgPar_IsExchangeVert ( int vnum )
{
return (mesh->GetParallelTopology().GetNDistantPNums( vnum+1 ) > 0);
// return mesh->GetParallelTopology().IsExchangeVert ( vnum+1 );
}
bool NgPar_IsExchangeEdge ( int ednum )
{
return (mesh->GetParallelTopology().GetNDistantEdgeNums( ednum+1 ) > 0);
// return mesh->GetParallelTopology().IsExchangeEdge ( ednum+1 );
}
bool NgPar_IsExchangeElement ( int elnum )
{
return (mesh->GetParallelTopology().GetNDistantElNums( elnum+1 ) > 0);
// return mesh->GetParallelTopology().IsExchangeElement ( elnum+1 );
}
void NgPar_PrintParallelMeshTopology ()
{
mesh -> GetParallelTopology().Print ();
}
#endif
void Ng_SetRefinementFlag (int ei, int flag)

View File

@ -262,7 +262,7 @@ public:
bool Inside (const Point<2> & p) const;
bool SameSide (const Point<2> & lp1, const Point<2> & lp2,
const Array<int> * testfaces = NULL) const
const Array<int> * /* testfaces */ = NULL) const
{
return Inside (lp1) == Inside (lp2);
}

View File

@ -24,7 +24,7 @@ namespace netgen
virtual const Refinement & GetRefinement () const;
virtual void Save (string filename) const;
virtual void SaveToMeshFile (ostream & ost) const { ; }
virtual void SaveToMeshFile (ostream & /* ost */) const { ; }
};
@ -36,10 +36,10 @@ namespace netgen
public:
virtual ~GeometryRegister();
virtual NetgenGeometry * Load (string filename) const = 0;
virtual NetgenGeometry * LoadFromMeshFile (istream & ist) const { return NULL; }
virtual class VisualScene * GetVisualScene (const NetgenGeometry * geom) const
virtual NetgenGeometry * LoadFromMeshFile (istream & /* ist */) const { return NULL; }
virtual class VisualScene * GetVisualScene (const NetgenGeometry * /* geom */) const
{ return NULL; }
virtual void SetParameters (Tcl_Interp * interp) { ; }
virtual void SetParameters (Tcl_Interp * /* interp */) { ; }
};
extern DLL_HEADER Array<GeometryRegister*> geometryregister;

View File

@ -3,7 +3,7 @@ include_HEADERS =
AM_CPPFLAGS = -I$(top_srcdir)/libsrc/include -I$(top_srcdir)/libsrc/interface -DOPENGL -D$(TOGL_WINDOWINGSYSTEM) $(TCL_INCLUDES) $(MPI_INCLUDES) $(FFMPEG_INCLUDES) $(JPEGLIB_INCLUDES)
bin_PROGRAMS = netgen
netgen_SOURCES = demoview.cpp ngappinit.cpp onetcl.cpp parallelfunc.cpp parallelinterface.cpp ngpkg.cpp demoview.hpp parallelfunc.hpp togl_1_7.h
netgen_SOURCES = demoview.cpp ngappinit.cpp onetcl.cpp parallelfunc.cpp ngpkg.cpp demoview.hpp parallelfunc.hpp togl_1_7.h
# nginterface.cpp nginterface_v2.cpp
netgen_LDADD = $(top_builddir)/libsrc/visualization/libvisual.a \