BELFEM
0.9.0
Berkeley Lab Finite Element Framework
Toggle main menu visibility
Loading...
Searching...
No Matches
fn_dpolyval.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
23
24
#ifndef BELFEM_FN_DPOLYVAL_HPP
25
#define BELFEM_FN_DPOLYVAL_HPP
26
27
#include "
typedefs.hpp
"
28
#include "
cl_Vector.hpp
"
29
30
namespace
belfem
31
{
44
template
<
typename
T >
45
T
46
dpolyval
(
const
Vector< T >
& aCoeffs,
const
T aX )
47
{
48
const
index_t
tN = aCoeffs.
length
() - 1 ;
49
T tPow = ( T ) tN ;
50
T aResult = tPow * aCoeffs( 0 );
51
52
for
(
index_t
k=1; k<tN; ++k )
53
{
54
aResult *= aX;
55
tPow -= 1.0 ;
56
aResult += tPow * aCoeffs( k );
57
}
58
59
return
aResult;
60
}
61
}
62
#endif
//BELFEM_FN_DPOLYVAL_HPP
cl_Vector.hpp
belfem::Vector
Column vector.
Definition
cl_BZ_Vector.hpp:41
belfem::Vector::length
size_t length() const
get the length of the vector
Definition
cl_AR_Vector.hpp:257
belfem::dpolyval
T dpolyval(const Vector< T > &aCoeffs, const T aX)
Evaluates the first derivative of a polynomial at one point.
Definition
fn_dpolyval.hpp:46
belfem
USER GUIDES:
Definition
cl_Capacitor.cpp:16
belfem::MaterialDependency::T
@ T
Definition
cl_Material.hpp:122
belfem::index_t
uint32_t index_t
Definition
typedefs.hpp:52
typedefs.hpp
src
linalg
fn_dpolyval.hpp
Generated by
1.18.0