2121#include < array>
2222#include < string>
2323
24- typedef std::vector<int > IntVec; // !< General integer vector
25- typedef std::vector<IntVec> IntMat; // !< General 2D integer matrix
26- typedef std::map<MPC*,int ,MPCLess> MPCMap; // !< MPC-to-function code mapping
27- typedef std::set<MPC*,MPCLess> MPCSet; // !< Sorted set of MPC-equations
28- typedef MPCSet::const_iterator MPCIter; // !< Iterator over an MPC-equation set
24+ using IntVec = std::vector<int >; // !< General integer vector
25+ using IntMat = std::vector<IntVec>; // !< General 2D integer matrix
26+
27+ using MPCMap = std::map<MPC*,int ,MPCLess>; // !< MPC-to-function code mapping
28+ using MPCSet = std::set<MPC*,MPCLess>; // !< Sorted set of MPC-equations
29+ using MPCIter = MPCSet::const_iterator; // !< Iterator over an MPC-equation set
2930
3031struct TimeDomain ;
3132class ElementBlock ;
@@ -43,9 +44,12 @@ class RealFunc;
4344class VecFunc ;
4445class Vec3 ;
4546class Tensor ;
47+
4648namespace ASM { class InterfaceChecker ; }
49+ namespace utl { template <class Arg , class Result > class Function ; }
4750
48- typedef std::vector<ASMbase*> ASMVec; // !< Spline patch container
51+ using ASMVec = std::vector<ASMbase*>; // !< Spline patch container type
52+ using IntFunc = utl::Function<int ,double >; // !< Real-valued integer function
4953
5054
5155/* !
@@ -78,7 +82,7 @@ class ASMbase
7882 explicit BC (int n) : node(n), CX(1 ), CY(1 ), CZ(1 ), RX(1 ), RY(1 ), RZ(1 ) {}
7983 };
8084
81- typedef std::vector<BC> BCVec ; // !< Nodal boundary condition container
85+ using BCVec = std::vector<BC>; // !< Nodal boundary condition container
8286
8387protected:
8488 // ! \brief The constructor sets the number of space dimensions and fields.
@@ -167,6 +171,9 @@ class ASMbase
167171 // ! It must be invoked only before SIMbase::preprocess() is invoked.
168172 void setNoFields (unsigned char n) { nf = n; }
169173
174+ // ! \brief Sets the element activation function.
175+ void setElementActivator (IntFunc* efunc) { myElActive = efunc; }
176+
170177 // ! \brief Sets the minimum element size for adaptive refinement.
171178 virtual void setMinimumSize (double ) {}
172179 // ! \brief Defines the minimum element size for adaptive refinement.
@@ -318,7 +325,7 @@ class ASMbase
318325 // ! \brief Sets the list of active elements during assembly.
319326 void setActiveElements (IntVec* active) { myActiveEls = active; }
320327 // ! \brief Returns \e true if element with global id \a elmId is active.
321- bool isElementActive (int elmId) const ;
328+ bool isElementActive (int elmId, double time = - 1.0 ) const ;
322329
323330 // ! \brief Returns the nodal point correspondance array for an element.
324331 // ! \param[in] iel 1-based element index local to current patch
@@ -1024,11 +1031,12 @@ class ASMbase
10241031 std::vector<char > myLMTypes; // !< Type of %Lagrange multiplier ('L' or 'G')
10251032 std::set<size_t > myLMs; // !< Nodal indices of the %Lagrange multipliers
10261033
1034+ IntFunc* myElActive; // !< Function returning activatiation time of element
10271035 IntVec* myActiveEls; // !< List of active elements during element assembly
10281036 static IntVec Empty; // !< Empty integer vector used when a reference is needed
10291037
10301038protected:
1031- typedef std::array<double ,3 > XYZ ; // !< Convenience type definition
1039+ using XYZ = std::array<double ,3 >; // !< Convenience type definition
10321040 std::map<size_t ,XYZ> myRmaster; // !< Rigid master nodal points
10331041};
10341042
0 commit comments