CONFIG LIB 1.5
Configuration Files Library (by TGG 2020)
Loading...
Searching...
No Matches
PANEL Class Reference

A class for manipulating the rectangular panel. More...

#include <panel.h>

Public Member Functions

 PANEL (void)
 default constructor
 
 PANEL (VECTOR_3D vP1, VECTOR_3D vP2, VECTOR_3D vP3, VECTOR_3D vP4)
 constructor that sets corners from parameters
 
double S (void)
 returns the panel area
 
void Center (void)
 calculates the coordinates (Pc) of the central point of the panel
 
void PutTo (VECTOR_3D vP1, VECTOR_3D vP2, VECTOR_3D vP3, VECTOR_3D vP4)
 sets the corners (coordinates)
 
void PutTo_n (VECTOR_3D vP1, VECTOR_3D vP2, VECTOR_3D vP3, VECTOR_3D vP4)
 sets the corners (ccordinates) and changes the sign of y coordinate
 
void PutTo_0 (VECTOR_3D vP1, VECTOR_3D vP2, VECTOR_3D vP3, VECTOR_3D vP4)
 sets the corners (ccordinates) and changes the coordinate to zero
 
void Mirror (void)
 makes a mirror with respect to xz plane, saves the order (CW or CCW) of corners
 
void Clear (void)
 clears and assignes pointers to corners
 
void Vout (FILE *ff)
 prints corners coordinates to stream ff
 
void VoutR (FILE *ff)
 prints corners mirror (with respect to xz plane) coordinates to stream ff
 
void Iout (FILE *ff)
 prints corners numbers to stream ff
 
void ELset (const char *WingFus, char *Struct, int StructNr)
 sets panel info for FEM analysis to string ELSet
 
void CheckType (void)
 checks the type of panel
 

Public Attributes

char ElSet [256]
 info for FEM analysis
 
int Type
 type of panel: 0 - rectangle; 2, 3, 4 - triangle ( corner no. Type is doubled )
 
int IdP1
 No. of the 1st corner of the panel.
 
int IdP2
 No. of the 2nd corner of the panel.
 
int IdP3
 No. of the 3rd corner of the panel.
 
int IdP4
 No. of the 4th corner of the panel.
 
int IdP5
 No. of the mid-point of the 1st side of the panel.
 
int IdP6
 No. of the mid-point of the 2nd side of the panel.
 
int IdP7
 No. of the mid-point of the 3rd side of the panel.
 
int IdP8
 No. of the mid-point of the 4th side of the panel.
 
VECTOR_3D P1
 the coordinates of the 1st corner of the panel
 
VECTOR_3D P2
 the coordinates of the 2nd corner of the panel
 
VECTOR_3D P3
 the coordinates of the 3rd corner of the panel
 
VECTOR_3D P4
 the coordinates of the 4th corner of the panel
 
VECTOR_3D Pc
 the coordinates of the central point of the panel
 
VECTOR_3DPP [4]
 pointers to four corners (VECTOR_3D) of the panel
 

Detailed Description

A class for manipulating the rectangular panel.

Definition at line 34 of file panel.h.

Constructor & Destructor Documentation

◆ PANEL() [1/2]

PANEL::PANEL ( void )

default constructor

Definition at line 23 of file panel.cpp.

24{
25 Clear();
26}
void Clear(void)
clears and assignes pointers to corners
Definition panel.cpp:39

◆ PANEL() [2/2]

PANEL::PANEL ( VECTOR_3D vP1,
VECTOR_3D vP2,
VECTOR_3D vP3,
VECTOR_3D vP4 )

constructor that sets corners from parameters

Definition at line 28 of file panel.cpp.

29{
30 Clear();
31 PutTo( vP1, vP2, vP3, vP4 );
32}
void PutTo(VECTOR_3D vP1, VECTOR_3D vP2, VECTOR_3D vP3, VECTOR_3D vP4)
sets the corners (coordinates)
Definition panel.cpp:55

◆ ~PANEL()

PANEL::~PANEL ( void )

Definition at line 34 of file panel.cpp.

35{
36 Clear();
37}

Member Function Documentation

◆ Center()

void PANEL::Center ( void )

calculates the coordinates (Pc) of the central point of the panel

Definition at line 104 of file panel.cpp.

105{
106 Pc = 0.25*(P1 + P2 + P3 + P4);
107}
VECTOR_3D P2
the coordinates of the 2nd corner of the panel
Definition panel.h:57
VECTOR_3D P3
the coordinates of the 3rd corner of the panel
Definition panel.h:58
VECTOR_3D P4
the coordinates of the 4th corner of the panel
Definition panel.h:59
VECTOR_3D Pc
the coordinates of the central point of the panel
Definition panel.h:61
VECTOR_3D P1
the coordinates of the 1st corner of the panel
Definition panel.h:56

Referenced by Mirror(), PutTo(), PutTo_0(), and PutTo_n().

◆ CheckType()

void PANEL::CheckType ( void )

checks the type of panel

Definition at line 135 of file panel.cpp.

136{
137 if(IdP1 != IdP2)
138 {
139 if(IdP1 != IdP4)
140 {
141 if(IdP2 != IdP3)
142 {
143 if(IdP3 != IdP4)
144 {
145 Type = 0; // quadrilateral panel
146 }
147 else Type = 4; // triangle P3=P4 -> P4 to remove
148 }
149 else Type = 3; // triangle P2=P3 -> P3 to remove
150 }
151 else Type = 4; // triangle P1=P4 -> P4 to remove
152 }
153 else Type = 2; // triangle P1=P2 -> P2 to remove
154}
int IdP3
No. of the 3rd corner of the panel.
Definition panel.h:48
int IdP2
No. of the 2nd corner of the panel.
Definition panel.h:47
int IdP4
No. of the 4th corner of the panel.
Definition panel.h:49
int IdP1
No. of the 1st corner of the panel.
Definition panel.h:46
int Type
type of panel: 0 - rectangle; 2, 3, 4 - triangle ( corner no. Type is doubled )
Definition panel.h:44

◆ Clear()

void PANEL::Clear ( void )

clears and assignes pointers to corners

Definition at line 39 of file panel.cpp.

40{
41 P1 = VECTOR_3__E0();
42 P2 = VECTOR_3__E0();
43 P3 = VECTOR_3__E0();
44 P4 = VECTOR_3__E0();
45 PP[0] = &P1;
46 PP[1] = &P2;
47 PP[2] = &P3;
48 PP[3] = &P4;
49 strcpy(ElSet, "");
50 Type = 0;
51 Pc = VECTOR_3__E0();
52 IdP1 = IdP2 = IdP3 = IdP4 = IdP5 = IdP6 = IdP7 = IdP8 = 0;
53}
int IdP6
No. of the mid-point of the 2nd side of the panel.
Definition panel.h:52
int IdP8
No. of the mid-point of the 4th side of the panel.
Definition panel.h:54
VECTOR_3D * PP[4]
pointers to four corners (VECTOR_3D) of the panel
Definition panel.h:63
char ElSet[256]
info for FEM analysis
Definition panel.h:42
int IdP7
No. of the mid-point of the 3rd side of the panel.
Definition panel.h:53
int IdP5
No. of the mid-point of the 1st side of the panel.
Definition panel.h:51

Referenced by PANEL(), and PANEL().

◆ ELset()

void PANEL::ELset ( const char * WingFus,
char * Struct,
int StructNr )

sets panel info for FEM analysis to string ELSet

Definition at line 130 of file panel.cpp.

131{
132 sprintf(ElSet, "%s_%s_%i", WingFus, Struct, StructNr);
133}

◆ Iout()

void PANEL::Iout ( FILE * ff)

prints corners numbers to stream ff

Definition at line 117 of file panel.cpp.

118{
119 fprintf( ff, "%d %d %d %d", IdP1, IdP2, IdP3, IdP4 );
120}

◆ Mirror()

void PANEL::Mirror ( void )

makes a mirror with respect to xz plane, saves the order (CW or CCW) of corners

Definition at line 84 of file panel.cpp.

85{
86 VECTOR_3D P;
87 P = P1; P1 = P4; P4 = P;
88 P = P2; P2 = P3; P3 = P;
89 P1.y *= -1.;
90 P2.y *= -1.;
91 P3.y *= -1.;
92 P4.y *= -1.;
93 Center();
94}
void Center(void)
calculates the coordinates (Pc) of the central point of the panel
Definition panel.cpp:104
Vector 3D class - vector manipulation.
Definition vector3d.h:34
double y
y coordinate
Definition vector3d.h:38

◆ PutTo()

void PANEL::PutTo ( VECTOR_3D vP1,
VECTOR_3D vP2,
VECTOR_3D vP3,
VECTOR_3D vP4 )

sets the corners (coordinates)

Definition at line 55 of file panel.cpp.

56{
57 P1 = vP1;
58 P2 = vP2;
59 P3 = vP3;
60 P4 = vP4;
61 Center();
62}

Referenced by PANEL(), PutTo_0(), and PutTo_n().

◆ PutTo_0()

void PANEL::PutTo_0 ( VECTOR_3D vP1,
VECTOR_3D vP2,
VECTOR_3D vP3,
VECTOR_3D vP4 )

sets the corners (ccordinates) and changes the coordinate to zero

Definition at line 74 of file panel.cpp.

75{
76 PutTo( vP1, vP2, vP3, vP4 );
77 P1.y = 0.;
78 P2.y = 0.;
79 P3.y = 0.;
80 P4.y = 0.;
81 Center();
82}

◆ PutTo_n()

void PANEL::PutTo_n ( VECTOR_3D vP1,
VECTOR_3D vP2,
VECTOR_3D vP3,
VECTOR_3D vP4 )

sets the corners (ccordinates) and changes the sign of y coordinate

Definition at line 64 of file panel.cpp.

65{
66 PutTo( vP1, vP2, vP3, vP4 );
67 P1.y *= -1.;
68 P2.y *= -1.;
69 P3.y *= -1.;
70 P4.y *= -1.;
71 Center();
72}

◆ S()

double PANEL::S ( void )

returns the panel area

Definition at line 96 of file panel.cpp.

97{
98 double SS2 = ((P1-P2)%(P3-P2)).Len();
99 SS2 += ((P1-P4)%(P3-P4)).Len();
100 if( SS2 < fabs(1.e-9) )SS2 = 0.;
101 return 0.5 * SS2;
102}

◆ Vout()

void PANEL::Vout ( FILE * ff)

prints corners coordinates to stream ff

Definition at line 109 of file panel.cpp.

110{
111 fprintf( ff, "% 12.7f % 12.7f % 12.7f", P1.x, P1.y, P1.z );
112 fprintf( ff, "% 12.7f % 12.7f % 12.7f", P2.x, P2.y, P2.z );
113 fprintf( ff, "% 12.7f % 12.7f % 12.7f", P3.x, P3.y, P3.z );
114 fprintf( ff, "% 12.7f % 12.7f % 12.7f", P4.x, P4.y, P4.z );
115}
double x
x coordinate
Definition vector3d.h:38
double z
z coordinate
Definition vector3d.h:38

◆ VoutR()

void PANEL::VoutR ( FILE * ff)

prints corners mirror (with respect to xz plane) coordinates to stream ff

Definition at line 122 of file panel.cpp.

123{
124 fprintf( ff, "% 12.7f % 12.7f % 12.7f", P4.x, -P4.y, P4.z );
125 fprintf( ff, "% 12.7f % 12.7f % 12.7f", P3.x, -P3.y, P3.z );
126 fprintf( ff, "% 12.7f % 12.7f % 12.7f", P2.x, -P2.y, P2.z );
127 fprintf( ff, "% 12.7f % 12.7f % 12.7f", P1.x, -P1.y, P1.z );
128}

Member Data Documentation

◆ ElSet

char PANEL::ElSet[256]

info for FEM analysis

Definition at line 42 of file panel.h.

Referenced by Clear(), and ELset().

◆ IdP1

int PANEL::IdP1

No. of the 1st corner of the panel.

Definition at line 46 of file panel.h.

Referenced by CheckType(), Clear(), and Iout().

◆ IdP2

int PANEL::IdP2

No. of the 2nd corner of the panel.

Definition at line 47 of file panel.h.

Referenced by CheckType(), Clear(), and Iout().

◆ IdP3

int PANEL::IdP3

No. of the 3rd corner of the panel.

Definition at line 48 of file panel.h.

Referenced by CheckType(), Clear(), and Iout().

◆ IdP4

int PANEL::IdP4

No. of the 4th corner of the panel.

Definition at line 49 of file panel.h.

Referenced by CheckType(), Clear(), and Iout().

◆ IdP5

int PANEL::IdP5

No. of the mid-point of the 1st side of the panel.

Definition at line 51 of file panel.h.

Referenced by Clear().

◆ IdP6

int PANEL::IdP6

No. of the mid-point of the 2nd side of the panel.

Definition at line 52 of file panel.h.

Referenced by Clear().

◆ IdP7

int PANEL::IdP7

No. of the mid-point of the 3rd side of the panel.

Definition at line 53 of file panel.h.

Referenced by Clear().

◆ IdP8

int PANEL::IdP8

No. of the mid-point of the 4th side of the panel.

Definition at line 54 of file panel.h.

Referenced by Clear().

◆ P1

VECTOR_3D PANEL::P1

the coordinates of the 1st corner of the panel

Definition at line 56 of file panel.h.

Referenced by GRID_ARRAYS::Array2Panels(), Center(), Clear(), Mirror(), PutTo(), PutTo_0(), PutTo_n(), S(), Vout(), and VoutR().

◆ P2

VECTOR_3D PANEL::P2

the coordinates of the 2nd corner of the panel

Definition at line 57 of file panel.h.

Referenced by Center(), Clear(), Mirror(), PutTo(), PutTo_0(), PutTo_n(), S(), Vout(), and VoutR().

◆ P3

VECTOR_3D PANEL::P3

the coordinates of the 3rd corner of the panel

Definition at line 58 of file panel.h.

Referenced by Center(), Clear(), Mirror(), PutTo(), PutTo_0(), PutTo_n(), S(), Vout(), and VoutR().

◆ P4

VECTOR_3D PANEL::P4

the coordinates of the 4th corner of the panel

Definition at line 59 of file panel.h.

Referenced by Center(), Clear(), Mirror(), PutTo(), PutTo_0(), PutTo_n(), S(), Vout(), and VoutR().

◆ Pc

VECTOR_3D PANEL::Pc

the coordinates of the central point of the panel

Definition at line 61 of file panel.h.

Referenced by Center(), and Clear().

◆ PP

VECTOR_3D* PANEL::PP[4]

pointers to four corners (VECTOR_3D) of the panel

Definition at line 63 of file panel.h.

Referenced by Clear().

◆ Type

int PANEL::Type

type of panel: 0 - rectangle; 2, 3, 4 - triangle ( corner no. Type is doubled )

Definition at line 44 of file panel.h.

Referenced by CheckType(), and Clear().


The documentation for this class was generated from the following files: