Line data Source code
1 : //* This file is part of the MOOSE framework 2 : //* https://mooseframework.inl.gov 3 : //* 4 : //* All rights reserved, see COPYRIGHT for full restrictions 5 : //* https://github.com/idaholab/moose/blob/master/COPYRIGHT 6 : //* 7 : //* Licensed under LGPL 2.1, please see LICENSE for details 8 : //* https://www.gnu.org/licenses/lgpl-2.1.html 9 : 10 : #pragma once 11 : 12 : #include "ElementSubdomainModifier.h" 13 : #include "TimedElementSubdomainModifier.h" 14 : #include "DelimitedFileReader.h" 15 : 16 : /** 17 : * Modifies elements from entire subdomains based on user input or file input 18 : */ 19 : class TimedSubdomainModifier : public TimedElementSubdomainModifier 20 : { 21 : public: 22 : static InputParameters validParams(); 23 : 24 : TimedSubdomainModifier(const InputParameters & parameters); 25 : 26 : protected: 27 432 : virtual std::vector<Real> getTimes() override { return _times; } 28 : 29 : virtual SubdomainID computeSubdomainID() override; 30 : 31 : private: 32 : void buildFromParameters(); 33 : void buildFromFile(); 34 : 35 : SubdomainID getSubdomainIDAndCheck(const std::string & subdomain_name); 36 : 37 : /// Times to change the subdomains on. If the time steps do not align with the times, 38 : /// the subdomain changes will happen at the end of the time step. 39 : /// The sort order of this vector must match _blocks_from and _blocks_to. 40 : std::vector<Real> _times; 41 : 42 : /// Source subdomains to change from 43 : std::vector<SubdomainID> _blocks_from; 44 : /// Target subdomains to change the source subdomains to 45 : std::vector<SubdomainID> _blocks_to; 46 : };