sequential fixes

This commit is contained in:
Joachim Schoeberl 2012-07-05 13:02:01 +00:00
parent 6bb2a37939
commit a7d1c6c657
7 changed files with 22 additions and 5 deletions

View File

@ -7,6 +7,7 @@
#include <mystdlib.h> #include <mystdlib.h>
#include <myadt.hpp> #include <myadt.hpp>
namespace netgen namespace netgen
{ {

View File

@ -46,6 +46,8 @@ namespace netgen
{ {
public: public:
SplineSeg () { ; } SplineSeg () { ; }
///
virtual ~SplineSeg() { ; }
/// calculates length of curve /// calculates length of curve
virtual double Length () const; virtual double Length () const;
/// returns point at curve, 0 <= t <= 1 /// returns point at curve, 0 <= t <= 1

View File

@ -28,7 +28,7 @@ namespace netgen
raw_data.Append(D); raw_data.Append(D);
// raw_data.Append(elto0); // raw_data.Append(elto0);
raw_data.Append(splines.Size()); raw_data.Append(splines.Size());
for(int i=0; i<splines.Size(); i++) for(int i=0; i<splines.Size(); i++)
splines[i]->GetRawData(raw_data); splines[i]->GetRawData(raw_data);
} }

View File

@ -232,9 +232,10 @@ void Ng_LoadMeshFromStream ( istream & input )
void Ng_LoadMesh (const char * filename) void Ng_LoadMesh (const char * filename)
{ {
#ifdef PARALLEL
MPI_Comm_size(MPI_COMM_WORLD, &ntasks); MPI_Comm_size(MPI_COMM_WORLD, &ntasks);
MPI_Comm_rank(MPI_COMM_WORLD, &id); MPI_Comm_rank(MPI_COMM_WORLD, &id);
#endif
if (id == 0) if (id == 0)
{ {
if ( (strlen (filename) > 4) && if ( (strlen (filename) > 4) &&
@ -251,17 +252,21 @@ void Ng_LoadMesh (const char * filename)
ifstream infile(filename); ifstream infile(filename);
Ng_LoadMeshFromStream(infile); Ng_LoadMeshFromStream(infile);
#ifdef PARALLEL
if (ntasks > 1) if (ntasks > 1)
{ {
// MyMPI_SendCmd ("mesh"); // MyMPI_SendCmd ("mesh");
mesh -> Distribute(); mesh -> Distribute();
} }
#endif
} }
#ifdef PARALLEL
else else
{ {
mesh.Reset (new Mesh()); mesh.Reset (new Mesh());
mesh->SendRecvMesh(); mesh->SendRecvMesh();
} }
#endif
} }
void Ng_LoadMeshFromString (const char * mesh_as_string) void Ng_LoadMeshFromString (const char * mesh_as_string)

View File

@ -729,7 +729,7 @@ namespace netgen
mesh[pi1] = pnew; mesh[pi1] = pnew;
PointGeomInfo gi; PointGeomInfo gi;
bool gi_set(false); // bool gi_set(false);
Element2d *el1p(NULL); Element2d *el1p(NULL);
@ -744,7 +744,7 @@ namespace netgen
if ((*el1p)[l] == pi1) if ((*el1p)[l] == pi1)
{ {
gi = el1p->GeomInfoPi (l+1); gi = el1p->GeomInfoPi (l+1);
gi_set = true; // gi_set = true;
} }
// (*testout) << "Connect point " << pi2 << " to " << pi1 << "\n"; // (*testout) << "Connect point " << pi2 << " to " << pi1 << "\n";

View File

@ -38,11 +38,20 @@ namespace netgen {
namespace netgen namespace netgen
{ {
int id = 0, ntasks = 1;
// MPI_Comm mesh_comm; // MPI_Comm mesh_comm;
} }
#endif #endif
namespace netgen
{
int id = 0, ntasks = 1;
}
/* /*
// should not be needed (occ currently requires it) // should not be needed (occ currently requires it)
namespace netgen { namespace netgen {

View File

@ -35,7 +35,7 @@ using netgen::RegisterUserFormats;
namespace netgen namespace netgen
{ {
int id, ntasks; // int id, ntasks;
MPI_Comm mesh_comm; MPI_Comm mesh_comm;
} }