[MOAB-dev] commit/MOAB: tautges: If no coordinates are given for structured mesh, initialize coords with
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Wed Sep 11 17:11:07 CDT 2013
1 new commit in MOAB:
https://bitbucket.org/fathomteam/moab/commits/feb87883f724/
Changeset: feb87883f724
Branch: master
User: tautges
Date: 2013-09-12 00:11:01
Summary: If no coordinates are given for structured mesh, initialize coords with
parametric locations. Doesn't take any extra storage, since coords space
is always allocated anyway.
Affected #: 1 file
diff --git a/src/ScdInterface.cpp b/src/ScdInterface.cpp
index 1441e51..4dd7c5b 100644
--- a/src/ScdInterface.cpp
+++ b/src/ScdInterface.cpp
@@ -145,11 +145,13 @@ ErrorCode ScdInterface::construct_box(HomCoord low, HomCoord high, const double
rval = create_scd_sequence(low, high, MBVERTEX, 0, new_box);
ERRORR(rval, "Trouble creating scd vertex sequence.");
- if (num_coords && coords) {
- // set the vertex coordinates
- double *xc, *yc, *zc;
- rval = new_box->get_coordinate_arrays(xc, yc, zc);
- ERRORR(rval, "Couldn't get vertex coordinate arrays.");
+ // set the vertex coordinates
+ double *xc, *yc, *zc;
+
+ rval = new_box->get_coordinate_arrays(xc, yc, zc);
+ ERRORR(rval, "Couldn't get vertex coordinate arrays.");
+
+ if (coords && num_coords) {
unsigned int i = 0;
for (int kl = low[2]; kl <= high[2]; kl++) {
@@ -165,6 +167,23 @@ ErrorCode ScdInterface::construct_box(HomCoord low, HomCoord high, const double
}
}
}
+ else {
+ unsigned int i = 0;
+ for (int kl = low[2]; kl <= high[2]; kl++) {
+ for (int jl = low[1]; jl <= high[1]; jl++) {
+ for (int il = low[0]; il <= high[0]; il++) {
+ xc[i] = (double) il;
+ if (new_box->box_size()[1])
+ yc[i] = (double) jl;
+ else yc[i] = 0.0;
+ if (new_box->box_size()[2])
+ zc[i] = (double) kl;
+ else zc[i] = 0.0;
+ i++;
+ }
+ }
+ }
+ }
// create element sequence
Core *mbcore = dynamic_cast<Core*>(mbImpl);
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