Line data Source code
1 : /**********************************************************************/ 2 : /* DO NOT MODIFY THIS HEADER */ 3 : /* MAGPIE - Mesoscale Atomistic Glue Program for Integrated Execution */ 4 : /* */ 5 : /* Copyright 2017 Battelle Energy Alliance, LLC */ 6 : /* ALL RIGHTS RESERVED */ 7 : /**********************************************************************/ 8 : 9 : #pragma once 10 : 11 : #include "MyTRIMRasterizer.h" 12 : #include "MooseMyTRIMMaterial.h" 13 : 14 : #include "mytrim/sample.h" 15 : #include "mytrim/ion.h" 16 : #include "mytrim/element.h" 17 : 18 : class MooseMesh; 19 : 20 : /** 21 : * MyTRIM sample class that uses PointLocator lookups on a MooseMesh to 22 : * fetch and dynamically prepare material data from a MyTRIMRasterizer. 23 : * A new MooseMyTRIMSample class has to be constructed for every timestep the 24 : * TRIM simulation is run if the mesh has changed. 25 : */ 26 : class MooseMyTRIMSample : public MyTRIM_NS::SampleBase 27 : { 28 : public: 29 : MooseMyTRIMSample(const MyTRIMRasterizer &, const MooseMesh &, MyTRIM_NS::SimconfType *); 30 : 31 : /// average crossections for current ion 32 : virtual void averages(const MyTRIM_NS::IonBase * pka); 33 : 34 : /// interface called by MyTRIM to look up material data 35 : virtual MyTRIM_NS::MaterialBase * lookupMaterial(Point & pos); 36 : 37 : /// get the simulation dimension 38 198 : unsigned int getDim() { return _dim; } 39 : 40 : protected: 41 : /// the rasterizer provides average concentrations for each element 42 : const MyTRIMRasterizer & _rasterizer; 43 : 44 : /// trim simulation parameters 45 : const MyTRIMRasterizer::TrimParameters & _trim_parameters; 46 : 47 : /// number of elements used in the problem 48 : unsigned int _nvars; 49 : 50 : /// mesh of the simulation domain 51 : const MooseMesh & _mesh; 52 : 53 : /// dimension of the mesh 54 : const unsigned int _dim; 55 : 56 : /// point locator to determine element pointers form locations 57 : std::unique_ptr<PointLocatorBase> _pl; 58 : 59 : ///@{ material cache maps 60 : typedef std::map<const Elem *, MooseMyTRIMMaterial> MaterialsCache; 61 : MaterialsCache _materials_master_cache; 62 : std::map<MyTRIM_NS::IonBase, MaterialsCache> _per_pka_materials_cache; 63 : ///@} 64 : 65 : /// current ion (for on-the fly averaging) 66 : const MyTRIM_NS::IonBase * _current_ion; 67 : 68 : /// internal state object for the TRIM simulation 69 : MyTRIM_NS::SimconfType * _simconf; 70 : };