inline ACMIEntityPositionData *ACMITape::CurrentFeaturePositionHead(int index) { long positionOffset; ACMIEntityPositionData *pd; ACMIEntityData *e; // F4Assert(_tape != NULL); // F4Assert(index >= 0 && index < _tapeHdr.numFeat); e = FeatureData( index ); positionOffset = e->firstPositionDataOffset; pd = positionOffset == 0 ? NULL : (ACMIEntityPositionData *) ( ((char *)_tape) + positionOffset ); return pd; }
void FeatureFloodCount::flood(const DofObject * dof_object, int current_idx, FeatureData * feature) { if (dof_object == NULL) return; // Retrieve the id of the current entity dof_id_type entity_id = dof_object->id(); // Has this entity already been marked? - if so move along if (_entities_visited[current_idx].find(entity_id) != _entities_visited[current_idx].end()) return; // Mark this entity as visited _entities_visited[current_idx][entity_id] = true; // Determine which threshold to use based on whether this is an established region Real threshold = feature ? _step_connecting_threshold : _step_threshold; // Get the value of the current variable for the current entity Real entity_value; if (_is_elemental) { const Elem * elem = static_cast<const Elem *>(dof_object); std::vector<Point> centroid(1, elem->centroid()); _fe_problem.reinitElemPhys(elem, centroid, 0); entity_value = _vars[current_idx]->sln()[0]; } else entity_value = _vars[current_idx]->getNodalValue(*static_cast<const Node *>(dof_object)); // This node hasn't been marked, is it in a feature? We must respect // the user-selected value of _use_less_than_threshold_comparison. if (_use_less_than_threshold_comparison && (entity_value < threshold)) return; if (!_use_less_than_threshold_comparison && (entity_value > threshold)) return; /** * If we reach this point (i.e. we haven't returned early from this routine), * we've found a new mesh entity that's part of a feature. */ unsigned int map_num = _single_map_mode ? 0 : current_idx; processor_id_type rank = processor_id(); // New Feature (we need to create it and add it to our data structure) if (!feature) _partial_feature_sets[rank][map_num].push_back(FeatureData(current_idx)); // Get a handle to the feature we will update (always the last feature in the data structure) feature = &_partial_feature_sets[rank][map_num].back(); // Insert the current entity into the local ids map feature->_local_ids.insert(entity_id); if (_is_elemental) visitElementalNeighbors(static_cast<const Elem *>(dof_object), current_idx, feature, /*recurse =*/true); else visitNodalNeighbors(static_cast<const Node *>(dof_object), current_idx, feature, /*recurse =*/true); }