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 : // Moose includes 13 : #include "Positions.h" 14 : #include "BlockRestrictable.h" 15 : 16 : /** 17 : * Positions from centroids of groups of elements (subdomains, extra element ids) in the mesh 18 : */ 19 : class ElementGroupCentroidPositions : public Positions, public BlockRestrictable 20 : { 21 : public: 22 : static InputParameters validParams(); 23 : ElementGroupCentroidPositions(const InputParameters & parameters); 24 144 : virtual ~ElementGroupCentroidPositions() = default; 25 : 26 : void initialize() override; 27 : 28 : MooseMesh & _mesh; 29 : 30 : ///{ 31 : /// How to group elements, to compute centroids for these groups 32 14409 : static MooseEnum groupTypeEnum() 33 : { 34 14409 : return MooseEnum("block extra_id block_and_extra_id", "block"); 35 : } 36 : MooseEnum _group_type; 37 : ///} 38 : 39 : /// Whether blocks are used for the outermost indexing 40 : bool _blocks_in_use; 41 : 42 : /// The names of the extra element ids to use to make groups 43 : std::vector<ExtraElementIDName> _extra_id_names; 44 : /// The indices of the extra element ids to use to make groups 45 : std::vector<unsigned int> _extra_id_indices; 46 : /// The particular extra id values, for each extra id of interest 47 : std::vector<std::vector<unsigned int>> _extra_id_group_indices; 48 : 49 : private: 50 : unsigned int id(const Elem & elem, unsigned int id_index, bool use_subdomains); 51 : };