Skip to content
  • J. Davison de St. Germain's avatar
    Fix for ticket 61 (Removal of inappropriate polymorphism). · f8c8a4a6
    J. Davison de St. Germain authored
    This commit removes the virtual v_GetMetricInfo() from StdExpansion (and its implementation
    GetMetricInfo()) and moves it (the non-virtual version) into Expansion.  This update is under
    Chris Cantwell's (and Mike Kirby's) direction.
    
    General:
    
    - While the coding standard (I believe) mentions the use of 80 column lines, this line length is
      not used in most of the code, and makes the code much harder to read.  I'm going with longer
      lines (as, like I said, longer lines are already used throughout the code), but am happy to go
      back and shorten them if you would like me to.  (Or better yet, make a case for allowing 80+
      character lines and change the standard. :)
    
    - lep => local expansion (or just expansion), as opposed to a StdExpansion
    
    Modified:   library/Collections/CoalescedGeomData.cpp
    
    - pCollExp[] holds StdExpansions (base class), but the call to GetMetricInfo() can (now) only
        be made on an Expansion.  Must dynamic_cast to Expansion to make call.  Note, I don't
        check the return value of the dynamic_cast (against nullptr)... I don't think this is
        necessary buy happy to hear feedback on this.
    
    Modified:   library/FieldUtils/ProcessModules/ProcessJacobianEnergy.cpp
    Modified:   library/FieldUtils/ProcessModules/ProcessScalGrad.cpp
    
    - Use the Expansion instead of the StdExpansion to get to GetMetricInfo().
    
    Modified:   library/LibUtilities/TimeIntegration/TimeIntegrationScheme.cpp
    
    - Fix typo:  Impplicit -> Implicit
    
    Modified:   library/LocalRegions/Expansion.h
    Modified:   library/LocalRegions/Expansion.cpp
    
    - Replace v_GetMetricInfo() with GetMetricInfo().
    
    Modified:   library/StdRegions/StdExpansion.h
    Modified:   library/StdRegions/StdExpansion.cpp
    
    - Remove v_GetMetricInfo() (moved to LocalRegions/Expansion...).
    
    Modified:   library/LocalRegions/MatrixKey.cpp
    
    - MatrixKey constructor is passed a StdExpansion, but must cast it to an Expansion in order to GetMetricInfo().
    
    Modified:   library/MultiRegions/DisContField1D.cpp
    Modified:   library/MultiRegions/DisContField2D.cpp
    Modified:   library/MultiRegions/DisContField3D.cpp
    
    - Both GetLeftAdjacentElementExp() and m_exp[n] are Expansions, so no need to cast to a StdExpansion.
    - Remove unused var (BndExp).
    - Added some white space for readability.
    
    Modified:   library/MultiRegions/DisContField3DHomogeneous1D.cpp
    
    - Line up vars / white space / use fewer lines - for readability.
    - Replace StdRegions::StdExpansion with LocalRegion::Expansion.
    - Place the type def of loop var in the loop to avoid name pollution / accidental propagation
         (ie, the more local the declaration, the better. :)
    
    Modified:   library/MultiRegions/ExpList.cpp
    
    - Replace StdExpansions with Expansions.
    - Removed the GetStdExp() function that is no longer needed (ie, we no longer use StdExpansions in MultiRegion).
    - Make "element" param to v_ExtractElmtToBndPhys() const (as it is not changed in function).
    - Line up vars / white space / use fewer lines - for readability.
    
    Modified:   library/MultiRegions/ExpList.h
    
    - Explicitly denote "const" parameters.
    - Line up vars for easier readability.
    
    Modified:   library/MultiRegions/ExpList1D.cpp
    Modified:   library/MultiRegions/ExpList3DHomogeneous1D.cpp
    Modified:   library/MultiRegions/GlobalLinSys.cpp
    Modified:   library/MultiRegions/GlobalLinSysIterativeFull.cpp
    Modified:   library/MultiRegions/PreconditionerDiagonal.cpp
    Modified:   library/MultiRegions/PreconditionerLowEnergy.cpp
    
    - Replace StdRegions::StdExpansion with LocalRegion::Expansion.
    
    Modified:   library/MultiRegions/Preconditioner.h
    
    - Remove #include<StdExpansion.h>
    - Alphabetize #includes for clarity.
    f8c8a4a6