[MOAB-dev] commit/MOAB: iulian07: intersection changes
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Tue Oct 8 09:56:44 CDT 2013
1 new commit in MOAB:
https://bitbucket.org/fathomteam/moab/commits/d4602b43e08d/
Changeset: d4602b43e08d
Branch: master
User: iulian07
Date: 2013-10-08 16:53:38
Summary: intersection changes
make it less verbose; output only at most 4 processor results
also, do not report polygon correction, unless in debug flag mode
do not bail out if the intersection points are not settled
Affected #: 2 files
diff --git a/tools/mbcslam/Intx2Mesh.cpp b/tools/mbcslam/Intx2Mesh.cpp
index 6faa94a..d9db131 100644
--- a/tools/mbcslam/Intx2Mesh.cpp
+++ b/tools/mbcslam/Intx2Mesh.cpp
@@ -381,8 +381,12 @@ ErrorCode Intx2Mesh::intersect_meshes(EntityHandle mbset1, EntityHandle mbset2,
}
// before cleaning up , we need to settle the position of the intersection points
// on the boundary edges
+ // this needs to be collective, so we should maybe wait something
rval = correct_intersection_points_positions();
- ERRORR(rval, "can't correct position");
+ if (rval!=MB_SUCCESS)
+ {
+ std::cout << "can't correct position, Intx2Mesh.cpp \n";
+ }
clean();
return MB_SUCCESS;
}
@@ -480,7 +484,6 @@ ErrorCode Intx2Mesh::initialize_local_kdtree(EntityHandle euler_set)
<< dep << std::endl;
#endif
- return result;
return MB_SUCCESS;
}
// this will work in parallel only
@@ -1365,11 +1368,14 @@ void Intx2Mesh::correct_polygon(EntityHandle * nodes, int & nP)
if (nodes[i]==nodes[nextIndex])
{
// we need to reduce nP, and collapse nodes
- std::cout<<" nodes duplicated in list: " ;
- for (int j=0; j<nP; j++)
- std::cout<<nodes[j] << " " ;
- std::cout<<"\n";
- std::cout<<" node " << nodes[i] << " at index " << i << " is duplicated" << "\n";
+ if (dbg_1)
+ {
+ std::cout<<" nodes duplicated in list: " ;
+ for (int j=0; j<nP; j++)
+ std::cout<<nodes[j] << " " ;
+ std::cout<<"\n";
+ std::cout<<" node " << nodes[i] << " at index " << i << " is duplicated" << "\n";
+ }
// this will work even if we start from 1 2 3 1; when i is 3, we find nextIndex is 0, then next thing does nothing
// (nP-1 is 3, so k is already >= nP-1); it will result in nodes -> 1, 2, 3
for (int k=i; k<nP-1; k++)
diff --git a/tools/mbcslam/intx_mpas.cpp b/tools/mbcslam/intx_mpas.cpp
index ab50ce9..6888cb3 100644
--- a/tools/mbcslam/intx_mpas.cpp
+++ b/tools/mbcslam/intx_mpas.cpp
@@ -42,6 +42,7 @@ double gtol = 1.e-9; // this is for geometry tolerance
double radius = 1.;// in m: 6371220.
double t = 0.1, delta_t = 0.05; // check the script
+bool Verbose = false;
ErrorCode manufacture_lagrange_mesh_on_sphere(Interface * mb,
EntityHandle euler_set)
@@ -153,6 +154,11 @@ int main(int argc, char **argv)
flux_form= true;
index++;
}
+ if (!strcmp(argv[index], "-v"))
+ {
+ Verbose = true;
+ index++;
+ }
index++;
}
@@ -207,17 +213,22 @@ int main(int argc, char **argv)
rval = worker.create_departure_mesh_2nd_alg(euler_set, covering_lagr_set);
CHECK_ERR(rval);
- std::stringstream lagrIni;
- lagrIni<<"def0" << rank<<".h5m";
- rval = mb.write_file(lagrIni.str().c_str(), 0, 0, &covering_lagr_set, 1);
+ if (Verbose)
+ {
+ std::stringstream lagrIni;
+ lagrIni<<"def0" << rank<<".h5m";
+ rval = mb.write_file(lagrIni.str().c_str(), 0, 0, &covering_lagr_set, 1);
+ }
rval = enforce_convexity(&mb, covering_lagr_set, rank);
if (MB_SUCCESS != rval)
return 1;
-
- std::stringstream ste;
- ste<<"lagr0" << rank<<".h5m";
- rval = mb.write_file(ste.str().c_str(), 0, 0, &euler_set, 1);
+ if (Verbose)
+ {
+ std::stringstream ste;
+ ste<<"lagr0" << rank<<".h5m";
+ rval = mb.write_file(ste.str().c_str(), 0, 0, &euler_set, 1);
+ }
if (MB_SUCCESS != rval)
std::cout << "can't write lagr set\n";
@@ -230,12 +241,15 @@ int main(int argc, char **argv)
if (MB_SUCCESS != rval)
return 1;
- std::string opts_write("");
- std::stringstream outf;
- outf << "intersect0" << rank << ".h5m";
- rval = mb.write_file(outf.str().c_str(), 0, 0, &outputSet, 1);
- if (MB_SUCCESS != rval)
- std::cout << "can't write output\n";
+ if (rank<=4)
+ {
+ std::string opts_write("");
+ std::stringstream outf;
+ outf << "intersect0" << rank << ".h5m";
+ rval = mb.write_file(outf.str().c_str(), 0, 0, &outputSet, 1);
+ if (MB_SUCCESS != rval)
+ std::cout << "can't write output\n";
+ }
double intx_area = area_on_sphere_lHuiller(&mb, outputSet, radius);
double arrival_area = area_on_sphere_lHuiller(&mb, euler_set, radius);
std::cout << " Arrival area: " << arrival_area
Repository URL: https://bitbucket.org/fathomteam/moab/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
More information about the moab-dev
mailing list