Skip to content

Commit

Permalink
Minor clean-up to DataProbes and the inactiveSelector interface (#480)
Browse files Browse the repository at this point in the history
* No longer require inactive node from data probes given Real::get_inactive_selector():

  stk::mesh::Selector otherInactiveSelector = (
    metaData_->universal_part()
    & !(stk::mesh::selectUnion(interiorPartVec_))
    & !(stk::mesh::selectUnion(bcPartVec_)));

The above filters all nodes that are not of interest. The Overset aspect is not shown above..

Notes:

a) Data probes created in previous simulations prevail in subsequent
   even if the data probe in the new run is not created.

For example, in a previous run, a data probe was created:

For probe name: los_one Node Identifiers:
      562       563       564       565

In the subsequent run, these nodes still show up in the universal part:

BEGIN universal selector output:
  562 563 564 565 etc...
END   universal selector output:

However, are selected out:

BEGIN inactive selector output:
  562 563 564 565
END inactive selector output:

All is well with these extra nodes not killing the linear system setup.
See below...

b) I am trying to clean up this in a separate project to allow for clean
   restarts with changing around data probe order/definitons.
  • Loading branch information
spdomin authored Nov 21, 2019
1 parent 5c13fa7 commit a396a87
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 46 deletions.
12 changes: 1 addition & 11 deletions include/DataProbePostProcessing.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,6 @@ class DataProbePostProcessing
void review(
const DataProbeInfo *probeInfo);

// we want these nodes to be excluded from anything of importance
void create_inactive_selector();

// create the transfer and hold the vector in the DataProbePostProcessing class
void create_transfer();

Expand All @@ -155,9 +152,6 @@ class DataProbePostProcessing
// provide a 3x3 * 3x1 multiply
void mat_vec(const std::vector<double> &coord, const std::vector<double> &R, std::vector<double> &newCoord);

// provide the inactive selector
stk::mesh::Selector &get_inactive_selector();

// hold the realm
Realm &realm_;

Expand All @@ -174,11 +168,7 @@ class DataProbePostProcessing

// vector of specifications
std::vector<DataProbeSpecInfo *> dataProbeSpecInfo_;

// hold all the parts; provide a selector
stk::mesh::PartVector allTheParts_;
stk::mesh::Selector inactiveSelector_;


// hold the transfers
Transfers *transfers_;
};
Expand Down
35 changes: 0 additions & 35 deletions src/DataProbePostProcessing.C
Original file line number Diff line number Diff line change
Expand Up @@ -626,8 +626,6 @@ DataProbePostProcessing::initialize()
}
}

create_inactive_selector();

create_transfer();
}

Expand All @@ -646,30 +644,6 @@ DataProbePostProcessing::register_field(
stk::mesh::put_field_on_mesh(*toField, *part, fieldSize, nullptr);
}

//--------------------------------------------------------------------------
//-------- create_inactive_selector ----------------------------------------
//--------------------------------------------------------------------------
void
DataProbePostProcessing::create_inactive_selector()
{
for ( size_t idps = 0; idps < dataProbeSpecInfo_.size(); ++idps ) {

DataProbeSpecInfo *probeSpec = dataProbeSpecInfo_[idps];

for ( size_t k = 0; k < probeSpec->dataProbeInfo_.size(); ++k ) {

DataProbeInfo *probeInfo = probeSpec->dataProbeInfo_[k];

// loop over probes... one part per probe
for ( int j = 0; j < probeInfo->numProbes_; ++j ) {
allTheParts_.push_back(probeInfo->part_[j]);
}
}
}

inactiveSelector_ = stk::mesh::selectUnion(allTheParts_);
}

//--------------------------------------------------------------------------
//-------- create_transfer -------------------------------------------------
//--------------------------------------------------------------------------
Expand Down Expand Up @@ -854,15 +828,6 @@ DataProbePostProcessing::provide_output(
}
}

//--------------------------------------------------------------------------
//-------- get_inactive_selector -------------------------------------------
//--------------------------------------------------------------------------
stk::mesh::Selector &
DataProbePostProcessing::get_inactive_selector()
{
return inactiveSelector_;
}

void
DataProbePostProcessing::compute_R(
const double theta, const std::vector<double> &u, std::vector<double> &R )
Expand Down

0 comments on commit a396a87

Please sign in to comment.