Line data Source code
1 : //* This file is part of the MOOSE framework 2 : //* https://www.mooseframework.org 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 "ElementUserObject.h" 13 : 14 : #include "libmesh/mesh_tools.h" 15 : #include "EulerAngles.h" 16 : 17 : /** 18 : * Computes the average value of a variable on each block 19 : */ 20 : class ComputeBlockOrientationBase : public ElementUserObject 21 : { 22 : public: 23 : ComputeBlockOrientationBase(const InputParameters & parameters); 24 : 25 : static InputParameters validParams(); 26 : 27 : /** 28 : * Given a block ID return the block orientation of that block 29 : * 30 : * Note that accessor functions on UserObjects like this _must_ be const. 31 : * That is because the UserObject system returns const references to objects 32 : * trying to use UserObjects. This is done for parallel correctness. 33 : * 34 : * @return The average value of a variable on that block. 35 : */ 36 : virtual EulerAngles getBlockOrientation(SubdomainID block) const; 37 : 38 : /** 39 : * This is called before execute so you can reset any internal data. 40 : */ 41 : virtual void initialize() override; 42 : 43 : /** 44 : * Called _once_ after execute has been called on all "objects". 45 : */ 46 0 : virtual void finalize() override {}; 47 : 48 : protected: 49 : // This map will hold our averages for each block 50 : std::map<SubdomainID, EulerAngles> _block_ea_values; 51 : };