File: Get_ElementSource.cpp

package info (click to toggle)
getdp 2.9.2+dfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 6,384 kB
  • ctags: 8,206
  • sloc: cpp: 55,135; fortran: 13,955; yacc: 8,493; lex: 746; sh: 56; ansic: 34; awk: 33; makefile: 24
file content (101 lines) | stat: -rw-r--r-- 3,591 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
// GetDP - Copyright (C) 1997-2016 P. Dular and C. Geuzaine, University of Liege
//
// See the LICENSE.txt file for license information. Please report all
// bugs and problems to the public mailing list <getdp@onelab.info>.

#include "ProData.h"
#include "GeoData.h"
#include "ExtendedGroup.h"
#include "Get_Geometry.h"
#include "Message.h"

extern struct Problem Problem_S ;
extern struct CurrentData Current ;

static int     Nbr_ElementSource, i_ElementSource ;
static List_T *RegionSource_L ;
static struct  Element  ElementSource , ElementTrace;

/* ------------------------------------------------------------------------ */
/*  G e t _ I n i t E l e m e n t S o u r c e                               */
/* ------------------------------------------------------------------------ */

void Get_InitElementSource(struct Element *Element, int InIndex)
{
  Element->ElementSource = &ElementSource ;

  Nbr_ElementSource = Geo_GetNbrGeoElements() ;
  i_ElementSource = -1 ;

  if(InIndex<0){
    Message::Error("Missing support (Region Group) in Integral Quantity");
  }
  else{
    RegionSource_L = ((struct Group*)
		      List_Pointer(Problem_S.Group, InIndex))->InitialList ;
    Current.SourceIntegrationSupportIndex = InIndex ;
  }
}

/* ------------------------------------------------------------------------ */
/*  G e t _ N e x t E l e m e n t S o u r c e                               */
/* ------------------------------------------------------------------------ */

int Get_NextElementSource(struct Element *ElementSource)
{
  while (++i_ElementSource < Nbr_ElementSource) {

    ElementSource->GeoElement = Geo_GetGeoElement(i_ElementSource) ;
    ElementSource->Region = ElementSource->GeoElement->Region ;

    if (List_Search(RegionSource_L, &ElementSource->Region, fcmp_int)) {
      ElementSource->Num  = ElementSource->GeoElement->Num ;
      ElementSource->Type = ElementSource->GeoElement->Type ;
      return(1) ;
    }
  }
  return(0) ;
}

/* ------------------------------------------------------------------------ */
/*  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             */
/* ------------------------------------------------------------------------ */

int Get_ElementSourceInterpolation(struct Element *ElementSource, 
				   struct PostSubOperation *PostSubOperation)
{
  return(0) ;
}

/* ------------------------------------------------------------------------ */
/*  G e t _ E l e m e n t T r a c e                                         */
/* ------------------------------------------------------------------------ */

void Get_ElementTrace(struct Element *Element, int InIndex)
{
  struct Group   * Group_P ;
  struct TwoInt  * Pair_P ;

  Element->ElementTrace = &ElementTrace ;

  Group_P = (struct Group*)List_Pointer(Problem_S.Group, InIndex) ;
  
  if (!Group_P->ExtendedList) Generate_ExtendedGroup(Group_P) ;
  
  if(!(Pair_P = (struct TwoInt*)List_PQuery(Group_P->ExtendedList, 
					    &Element->Num, fcmp_int)))
    Message::Error("No Element connected to Element %d: check Group for Trace", 
                   Element->Num) ;

  Element->ElementTrace = &ElementTrace ;
  Element->ElementTrace->GeoElement = Geo_GetGeoElement(Pair_P->Int2) ;
  Element->ElementTrace->Region = Element->ElementTrace->GeoElement->Region ;
  Element->ElementTrace->Num    = Element->ElementTrace->GeoElement->Num ;
  Element->ElementTrace->Type   = Element->ElementTrace->GeoElement->Type ;

  Get_NodesCoordinatesOfElement(Element->ElementTrace) ;

  Message::Debug("Element %d -> Trace %d", Element->Num, Element->ElementTrace->Num);
}