"Fossies" - the Fresh Open Source Software Archive

Member "getdp-3.1.0-source/Kernel/Get_ElementSource.cpp" (29 Dec 2018, 3582 Bytes) of package /linux/privat/getdp-3.1.0-source.tgz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "Get_ElementSource.cpp" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 3.0.4_vs_3.1.0.

    1 // GetDP - Copyright (C) 1997-2019 P. Dular and C. Geuzaine, University of Liege
    2 //
    3 // See the LICENSE.txt file for license information. Please report all
    4 // issues on https://gitlab.onelab.info/getdp/getdp/issues.
    5 
    6 #include "ProData.h"
    7 #include "GeoData.h"
    8 #include "ExtendedGroup.h"
    9 #include "Get_Geometry.h"
   10 #include "Message.h"
   11 
   12 extern struct Problem Problem_S ;
   13 extern struct CurrentData Current ;
   14 
   15 static int     Nbr_ElementSource, i_ElementSource ;
   16 static List_T *RegionSource_L ;
   17 static struct  Element  ElementSource , ElementTrace;
   18 
   19 /* ------------------------------------------------------------------------ */
   20 /*  G e t _ I n i t E l e m e n t S o u r c e                               */
   21 /* ------------------------------------------------------------------------ */
   22 
   23 void Get_InitElementSource(struct Element *Element, int InIndex)
   24 {
   25   Element->ElementSource = &ElementSource ;
   26 
   27   Nbr_ElementSource = Geo_GetNbrGeoElements() ;
   28   i_ElementSource = -1 ;
   29 
   30   if(InIndex<0){
   31     Message::Error("Missing support (Region Group) in Integral Quantity");
   32   }
   33   else{
   34     RegionSource_L = ((struct Group*)
   35               List_Pointer(Problem_S.Group, InIndex))->InitialList ;
   36     Current.SourceIntegrationSupportIndex = InIndex ;
   37   }
   38 }
   39 
   40 /* ------------------------------------------------------------------------ */
   41 /*  G e t _ N e x t E l e m e n t S o u r c e                               */
   42 /* ------------------------------------------------------------------------ */
   43 
   44 int Get_NextElementSource(struct Element *ElementSource)
   45 {
   46   while (++i_ElementSource < Nbr_ElementSource) {
   47 
   48     ElementSource->GeoElement = Geo_GetGeoElement(i_ElementSource) ;
   49     ElementSource->Region = ElementSource->GeoElement->Region ;
   50 
   51     if (List_Search(RegionSource_L, &ElementSource->Region, fcmp_int)) {
   52       ElementSource->Num  = ElementSource->GeoElement->Num ;
   53       ElementSource->Type = ElementSource->GeoElement->Type ;
   54       return(1) ;
   55     }
   56   }
   57   return(0) ;
   58 }
   59 
   60 /* ------------------------------------------------------------------------ */
   61 /*  G e t _ E l e m e n t S o u r c e I n t e r p o l a t i o n             */
   62 /* ------------------------------------------------------------------------ */
   63 
   64 int Get_ElementSourceInterpolation(struct Element *ElementSource, 
   65                    struct PostSubOperation *PostSubOperation)
   66 {
   67   return(0) ;
   68 }
   69 
   70 /* ------------------------------------------------------------------------ */
   71 /*  G e t _ E l e m e n t T r a c e                                         */
   72 /* ------------------------------------------------------------------------ */
   73 
   74 void Get_ElementTrace(struct Element *Element, int InIndex)
   75 {
   76   struct Group   * Group_P ;
   77   struct TwoInt  * Pair_P ;
   78 
   79   Element->ElementTrace = &ElementTrace ;
   80 
   81   Group_P = (struct Group*)List_Pointer(Problem_S.Group, InIndex) ;
   82   
   83   if (!Group_P->ExtendedList) Generate_ExtendedGroup(Group_P) ;
   84   
   85   if(!(Pair_P = (struct TwoInt*)List_PQuery(Group_P->ExtendedList, 
   86                         &Element->Num, fcmp_int)))
   87     Message::Error("No Element connected to Element %d: check Group for Trace", 
   88                    Element->Num) ;
   89 
   90   Element->ElementTrace = &ElementTrace ;
   91   Element->ElementTrace->GeoElement = Geo_GetGeoElement(Pair_P->Int2) ;
   92   Element->ElementTrace->Region = Element->ElementTrace->GeoElement->Region ;
   93   Element->ElementTrace->Num    = Element->ElementTrace->GeoElement->Num ;
   94   Element->ElementTrace->Type   = Element->ElementTrace->GeoElement->Type ;
   95 
   96   Get_NodesCoordinatesOfElement(Element->ElementTrace) ;
   97 
   98   Message::Debug("Element %d -> Trace %d", Element->Num, Element->ElementTrace->Num);
   99 }
  100 
  101