BubbleBase::BubbleBase(const InputParameters & parameters) :Kernel(parameters), _names(getParam<std::vector<VariableName> >("coupled_conc")), _this_var(getParam<NonlinearVariableName>("variable")), _atoms(getParam<std::vector<Real> >("coupled_atoms")), _widths(getParam<std::vector<Real> >("coupled_widths")) { _G = coupledComponents("coupled_conc"); if ( _G != coupledComponents("coupled_rad") ) mooseError("From BubbleBase: The number of coupled concentrations does not match coupled radii."); if ( _G != _atoms.size() ) mooseError("From BubbleBase: The number of coupled concentrations does not match atom sizes list."); for ( unsigned int i=0; i<_G; ++i ) { _c.push_back( &coupledValue("coupled_conc", i) ); _r.push_back( &coupledValue("coupled_rad", i) ); } // Determine which group current kernel acts on _g = -1; for ( unsigned int i=0; i<_G; ++i ) { if ( _names[i].compare(_this_var) == 0 ) { _g = i; break; } } if (_g == -1) mooseError("From BubbleBase: Variable not found in coupled_conc list. Check the list."); mooseDoOnce( displayBubbleInfo() ); }
bool FauxGrainTracker::doesFeatureIntersectBoundary(unsigned int /*feature_id*/) const { mooseDoOnce(mooseWarning("FauxGrainTracker::doesFeatureIntersectboundary() is unimplemented")); return false; }
Real FeatureFloodCount::getNodalValue(dof_id_type node_id, unsigned int var_idx, bool show_var_coloring) const { mooseDoOnce(mooseWarning("Please call getEntityValue instead")); return getEntityValue(node_id, var_idx, show_var_coloring); }
std::vector<std::vector<std::pair<unsigned int, unsigned int> > > NodalFloodCount::getElementalValues(unsigned int /*elem_id*/) const { std::vector<std::vector<std::pair<unsigned int, unsigned int> > > empty; mooseDoOnce(mooseWarning("Method not implemented")); return empty; }
void Material::resetQpProperties() { if (!_compute) mooseDoOnce(mooseWarning("You disabled the computation of this (", name(), ") material by MOOSE, but have not overridden the 'resetQpProperties' " "method, this can lead to unintended values being set for material " "property values.")); }
MultiAppTransfer::MultiAppTransfer(const InputParameters & parameters) : Transfer(parameters), _multi_app(_fe_problem.getMultiApp(getParam<MultiAppName>("multi_app"))), _direction(getParam<MooseEnum>("direction")), _displaced_source_mesh(false), _displaced_target_mesh(false) { bool check = getParam<bool>("check_multiapp_execute_on"); if (check && (getExecuteOnEnum() != _multi_app->getExecuteOnEnum())) mooseDoOnce(mooseWarning("MultiAppTransfer execute_on flags do not match associated Multiapp " "execute_on flags")); }
Real FauxGrainTracker::getEntityValue(dof_id_type entity_id, FeatureFloodCount::FieldType field_type, std::size_t var_idx) const { if (var_idx == FeatureFloodCount::invalid_size_t) var_idx = 0; mooseAssert(var_idx < _n_vars, "Index out of range"); switch (field_type) { case FieldType::UNIQUE_REGION: case FieldType::VARIABLE_COLORING: { auto entity_it = _entity_id_to_var_num.find(entity_id); if (entity_it != _entity_id_to_var_num.end()) return entity_it->second; else return -1; break; } case FieldType::CENTROID: { if (_periodic_node_map.size()) mooseDoOnce(mooseWarning( "Centroids are not correct when using periodic boundaries, contact the MOOSE team")); // If this element contains the centroid of one of features, return it's index const auto * elem_ptr = _mesh.elemPtr(entity_id); for (MooseIndex(_vars) var_num = 0; var_num < _n_vars; ++var_num) { const auto centroid = _centroid.find(var_num); if (centroid != _centroid.end()) if (elem_ptr->contains_point(centroid->second)) return 1; } return 0; } // We don't want to error here because this should be a drop in replacement for the real grain // tracker. // Instead we'll just return zero and continue default: return 0; } return 0; }
void Factory::deprecatedMessage(const std::string obj_name) { std::map<std::string, time_t>::iterator time_it = _deprecated_time.find(obj_name); // If the object is not deprecated return if (time_it == _deprecated_time.end()) return; // Get the current time time_t now; time(&now); // Get the stop time time_t t_end = time_it->second; // Message storage std::ostringstream msg; std::map<std::string, std::string>::iterator name_it = _deprecated_name.find(obj_name); // Expired object if (now > t_end) { msg << "***** Invalid Object: " << obj_name << " *****\n"; msg << "Expired on " << ctime(&t_end); // Append replacement object, if it exsits if (name_it != _deprecated_name.end()) msg << "Upadate your application using the '" << name_it->second << "' object"; // Produce the error message mooseError(msg.str()); } // Expiring object else { // Build the basic message msg << "Deprecated Object: " << obj_name << "\n"; msg << "This object will be removed on " << ctime(&t_end); // Append replacement object, if it exsits if (name_it != _deprecated_name.end()) msg << "Replaced " << obj_name << " with " << name_it->second; // Produce the error message mooseDoOnce(mooseWarning(msg.str())); } }
const std::vector<std::pair<unsigned int, unsigned int> > & GrainTracker::getElementalValues(dof_id_type elem_id) const { const std::map<dof_id_type, std::vector<std::pair<unsigned int, unsigned int> > >::const_iterator pos = _elemental_data.find(elem_id); if (pos != _elemental_data.end()) return pos->second; else { #if DEBUG mooseDoOnce(Moose::out << "Elemental values not in structure for elem: " << elem_id << " this may be normal."); #endif return _empty; } }
MultiAppTransfer::MultiAppTransfer(const InputParameters & parameters) : /** * Here we need to remove the special option that indicates to the user that this object will follow it's associated * Multiapp execute_on. This non-standard option is not understood by SetupInterface. In the absence of any execute_on * parameters, will populate the execute_on MultiMooseEnum with the values from the associated MultiApp (see execFlags). */ Transfer(removeSpecialOption(parameters)), _multi_app(_fe_problem.getMultiApp(getParam<MultiAppName>("multi_app"))), _direction(getParam<MooseEnum>("direction")), _displaced_source_mesh(false), _displaced_target_mesh(false) { if (execFlags() != _multi_app->execFlags()) mooseDoOnce(mooseWarning("MultiAppTransfer execute_on flags do not match associated Multiapp execute_on flags")); }
void AddCoupledSolidKinSpeciesAction::act() { mooseDoOnce(printReactions()); std::vector<bool> primary_participation(_primary_species.size(), false); std::vector<std::string> solid_kin_species(_reactions.size()); std::vector<Real> weight; // Loop through reactions for (unsigned int j = 0; j < _reactions.size(); ++j) { std::vector<std::string> tokens; // Parsing each reaction MooseUtils::tokenize(_reactions[j], tokens, 1, "+="); if (tokens.size() == 0) mooseError("Empty reaction specified."); std::vector<Real> stos(tokens.size() - 1); std::vector<VariableName> rxn_species(tokens.size() - 1); for (unsigned int k = 0; k < tokens.size(); ++k) { std::vector<std::string> stos_primary_species; MooseUtils::tokenize(tokens[k], stos_primary_species, 1, "()"); if (stos_primary_species.size() == 2) { Real coef; std::istringstream iss(stos_primary_species[0]); iss >> coef; stos[k] = coef; rxn_species[k] = stos_primary_species[1]; // Check the participation of primary species for (unsigned int i = 0; i < _primary_species.size(); ++i) if (rxn_species[k] == _primary_species[i]) primary_participation[i] = true; } else solid_kin_species[j] = stos_primary_species[0]; }
bool TimeSequenceStepperFailTest::converged() { // The goal is to fail exactly one timestep which matches its // original sequence point order, other than the initial condition. // This can only happen once, since after you fail, you are no // longer on the original time sequence (off by one or more). Since // this can only happen once, we only check the [1]th sequence // point. (Having fewer than two sequence points doesn't really // make sense...) mooseAssert(_original_time_sequence.size() > 1, "Must have at least two sequence points!"); if (_t_step == 1 && MooseUtils::absoluteFuzzyEqual(_time, _original_time_sequence[1])) { mooseDoOnce(Moose::out << "TimeSequenceStepperFailTest: Simulating failed solve of first timestep.\n"); return false; } return TimeStepper::converged(); }
const std::vector<std::pair<unsigned int, unsigned int> > & NodalFloodCount::getNodalValues(unsigned int /*node_id*/) const { mooseDoOnce(mooseWarning("Method not implemented")); return _empty; }
void Material::initQpStatefulProperties() { mooseDoOnce(mooseWarning(std::string("Material \"") + _name + "\" declares one or more stateful properties but initQpStatefulProperties() was not overridden in the derived class.")); }
const std::vector<std::pair<unsigned int, unsigned int> > & FeatureFloodCount::getElementalValues(dof_id_type /*elem_id*/) const { mooseDoOnce(mooseWarning("Method not implemented")); return _empty; }
Real NodalFloodCount::getElementalValue(unsigned int /*element_id*/) const { mooseDoOnce(mooseWarning("Method not implemented")); return 0; }
Real FeatureFloodCount::getEntityValue(dof_id_type entity_id, FieldType field_type, std::size_t var_index) const { auto use_default = false; if (var_index == invalid_size_t) { use_default = true; var_index = 0; } mooseAssert(var_index < _maps_size, "Index out of range"); switch (field_type) { case FieldType::UNIQUE_REGION: { const auto entity_it = _feature_maps[var_index].find(entity_id); if (entity_it != _feature_maps[var_index].end()) return entity_it->second; // + _region_offsets[var_index]; else return -1; } case FieldType::VARIABLE_COLORING: { const auto entity_it = _var_index_maps[var_index].find(entity_id); if (entity_it != _var_index_maps[var_index].end()) return entity_it->second; else return -1; } case FieldType::GHOSTED_ENTITIES: { const auto entity_it = _ghosted_entity_ids.find(entity_id); if (entity_it != _ghosted_entity_ids.end()) return entity_it->second; else return -1; } case FieldType::HALOS: { if (!use_default) { const auto entity_it = _halo_ids[var_index].find(entity_id); if (entity_it != _halo_ids[var_index].end()) return entity_it->second; } else { // Showing halos in reverse order for backwards compatibility for (auto map_num = _maps_size; map_num-- /* don't compare greater than zero for unsigned */; ) { const auto entity_it = _halo_ids[map_num].find(entity_id); if (entity_it != _halo_ids[map_num].end()) return entity_it->second; } } return -1; } case FieldType::CENTROID: { if (_periodic_node_map.size()) mooseDoOnce(mooseWarning("Centroids are not correct when using periodic boundaries, contact the MOOSE team")); // If this element contains the centroid of one of features, return one const auto * elem_ptr = _mesh.elemPtr(entity_id); for (const auto & feature : _feature_sets) { if (feature._status == Status::INACTIVE) continue; if (elem_ptr->contains_point(feature._centroid)) return 1; } return 0; } default: return 0; } }
Problem & Executioner::problem() { mooseDoOnce(mooseWarning("This method is deprecated, use feProblem() instead")); return _fe_problem; }
Real FeatureFloodCount::getElementalValue(dof_id_type /*element_id*/) const { mooseDoOnce(mooseWarning("Method not implemented")); return 0; }