BELFEM
0.9.0
Berkeley Lab Finite Element Framework
Toggle main menu visibility
Loading...
Searching...
No Matches
fn_GT_create_glue_poly.hpp
Go to the documentation of this file.
1
/*
2
* BELFEM -- The Berkeley Lab Finite Element Framework
3
* Copyright (c) 2026, The Regents of the University of California,
4
* through Lawrence Berkeley National Laboratory (subject to receipt of any required
5
* approvals from the U.S. Dept. of Energy). All rights reserved.
6
*
7
* Developers: Christian Messe, Gregory Giard
8
*
9
* See the top-level LICENSE file for the complete license and disclaimer.
10
*/
11
12
#ifndef BELFEM_FN_CREATE_GLUE_POLY_HPP
13
#define BELFEM_FN_CREATE_GLUE_POLY_HPP
14
15
#include "
typedefs.hpp
"
16
#include "
cl_Vector.hpp
"
17
namespace
belfem
18
{
19
namespace
gastables
20
{
24
inline
void
25
create_glue_poly
(
26
const
real
& aX,
27
const
real
& aDeltaX,
28
const
Vector <real> & aF,
29
Vector <real> & aC )
30
{
31
// get boundary conditions on the left side
32
const
real
& f0 = aF( 0 );
33
const
real
& df0 = aF( 1 );
34
const
real
& f1 = aF( 2 );
35
const
real
& f2 = aF( 3 );
36
const
real
& df2 = aF( 4 );
37
38
// get some shortcuts
39
const
real
& X = aX;
40
const
real
X2 = std::pow( aX, 2 );
41
const
real
X3 = std::pow( aX, 3 );
42
const
real
X4 = std::pow( aX, 4 );
43
44
const
real
& dX = aDeltaX;
45
const
real
dX2 = std::pow( aDeltaX, 2 );
46
const
real
dX3 = std::pow( aDeltaX, 3 );
47
const
real
dX4 = std::pow( aDeltaX, 4 );
48
49
const
real
b = (f0-2.0*f1+f2);
50
51
// populate data
52
aC.
set_size
( 5 );
53
54
aC( 0 ) = -(df0*dX)+df2*dX-2.0*b;
55
56
aC( 1 ) = dX*((df0+df2)*dX+f0-f2)+4.0*(df0*dX-df2*dX+2.0*b)*X;
57
58
aC( 2 ) = dX2*(df0*dX-df2*dX+4.0*b)
59
-3.0*dX*((df0+df2)*dX+f0-f2)*X
60
-6.0*(df0*dX-df2*dX+2*b)*X2;
61
62
aC( 3 ) = -(df0*dX*(dX+X)*(dX2+dX*X-4.0*X2))+(dX-X)
63
*(-((dX+X)*(3.0*dX*(f0-f2)+8.0*b*X))
64
+df2*dX*(-dX2+dX*X+4.0*X2));
65
66
aC( 4 ) = -2.0*b*X4+dX3*X*(3.0*f0-3.0*f2+df0*X-df2*X)
67
+dX*X3*(-f0+f2-df0*X+df2*X)
68
+dX4*(4.0*f1+(df0+df2)*X)-dX2*X2*(-4.0*b+(df0+df2)*X);
69
70
aC /= 4.0 * dX4;
71
}
72
//------------------------------------------------------------------------------
73
}
/* namespace gastables */
74
}
/* namespace belfem */
75
76
#endif
//BELFEM_FN_CREATE_GLUE_POLY_HPP
cl_Vector.hpp
belfem::Vector::set_size
void set_size(const size_t aNumRows)
change the size of the vector
Definition
cl_AR_Vector.hpp:237
belfem::gastables
Definition
cl_Gas.hpp:33
belfem::gastables::create_glue_poly
void create_glue_poly(const real &aX, const real &aDeltaX, const Vector< real > &aF, Vector< real > &aC)
this function creates the intermediate polynomials for cea
Definition
fn_GT_create_glue_poly.hpp:25
belfem
USER GUIDES:
Definition
cl_Capacitor.cpp:16
belfem::real
double real
Definition
typedefs.hpp:36
typedefs.hpp
src
physics
gastables
fn_GT_create_glue_poly.hpp
Generated by
1.18.0