Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
pugs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
code
pugs
Commits
21d641e6
Commit
21d641e6
authored
3 years ago
by
Emmanuel Labourasse
Browse files
Options
Downloads
Patches
Plain Diff
[ci-skip] Update polynomial 1d in progress
parent
649d3b81
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/algebra/TinyMatrix.hpp
+4
-12
4 additions, 12 deletions
src/algebra/TinyMatrix.hpp
src/language/modules/SchemeModule.cpp
+0
-37
0 additions, 37 deletions
src/language/modules/SchemeModule.cpp
tests/test_Polynomial.cpp
+1
-1
1 addition, 1 deletion
tests/test_Polynomial.cpp
with
5 additions
and
50 deletions
src/algebra/TinyMatrix.hpp
+
4
−
12
View file @
21d641e6
...
@@ -501,17 +501,9 @@ inverse(const TinyMatrix<3, 3, T>& A)
...
@@ -501,17 +501,9 @@ inverse(const TinyMatrix<3, 3, T>& A)
return
A_cofactors_T
*=
1.
/
determinent
;
return
A_cofactors_T
*=
1.
/
determinent
;
}
}
PUGS_INLINE
constexpr
void
_swap
(
double
&
a
,
double
&
b
)
{
double
temp
=
a
;
a
=
b
;
b
=
temp
;
}
template
<
size_t
N
,
typename
T
>
template
<
size_t
N
,
typename
T
>
PUGS_INLINE
constexpr
TinyMatrix
<
N
,
T
>
PUGS_INLINE
constexpr
TinyMatrix
<
N
,
N
,
T
>
inverse
(
const
TinyMatrix
<
N
,
T
>&
A
)
inverse
(
const
TinyMatrix
<
N
,
N
,
T
>&
A
)
{
{
static_assert
(
std
::
is_arithmetic
<
T
>::
value
,
"inverse is not defined for non-arithmetic types"
);
static_assert
(
std
::
is_arithmetic
<
T
>::
value
,
"inverse is not defined for non-arithmetic types"
);
static_assert
(
std
::
is_floating_point
<
T
>::
value
,
"inverse is defined for floating point types only"
);
static_assert
(
std
::
is_floating_point
<
T
>::
value
,
"inverse is defined for floating point types only"
);
...
@@ -546,7 +538,7 @@ inverse(const TinyMatrix<N, T>& A)
...
@@ -546,7 +538,7 @@ inverse(const TinyMatrix<N, T>& A)
// We found the pivot A(irow,icol), now we swap columns to put the pivot on the diagonal
// We found the pivot A(irow,icol), now we swap columns to put the pivot on the diagonal
if
(
irow
!=
icol
)
{
if
(
irow
!=
icol
)
{
for
(
size_t
l
=
0
;
l
<
N
;
++
l
)
{
for
(
size_t
l
=
0
;
l
<
N
;
++
l
)
{
_
swap
(
inv_A
(
irow
,
l
),
inv_A
(
icol
,
l
));
std
::
swap
(
inv_A
(
irow
,
l
),
inv_A
(
icol
,
l
));
}
}
}
}
// we save the swap to invert it at the end
// we save the swap to invert it at the end
...
@@ -571,7 +563,7 @@ inverse(const TinyMatrix<N, T>& A)
...
@@ -571,7 +563,7 @@ inverse(const TinyMatrix<N, T>& A)
for
(
size_t
l
=
N
;
l
>
0
;
--
l
)
{
for
(
size_t
l
=
N
;
l
>
0
;
--
l
)
{
if
(
indexr
[
l
-
1
]
!=
indexc
[
l
-
1
])
{
if
(
indexr
[
l
-
1
]
!=
indexc
[
l
-
1
])
{
for
(
size_t
k
=
0
;
k
<
N
;
++
k
)
{
for
(
size_t
k
=
0
;
k
<
N
;
++
k
)
{
_
swap
(
inv_A
(
k
,
indexr
[
l
-
1
]),
inv_A
(
k
,
indexc
[
l
-
1
]));
std
::
swap
(
inv_A
(
k
,
indexr
[
l
-
1
]),
inv_A
(
k
,
indexc
[
l
-
1
]));
}
}
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
src/language/modules/SchemeModule.cpp
+
0
−
37
View file @
21d641e6
...
@@ -3,7 +3,6 @@
...
@@ -3,7 +3,6 @@
#include
<analysis/GaussLegendreQuadratureDescriptor.hpp>
#include
<analysis/GaussLegendreQuadratureDescriptor.hpp>
#include
<analysis/GaussLobattoQuadratureDescriptor.hpp>
#include
<analysis/GaussLobattoQuadratureDescriptor.hpp>
#include
<analysis/GaussQuadratureDescriptor.hpp>
#include
<analysis/GaussQuadratureDescriptor.hpp>
#include
<language/algorithms/AcousticSolverAlgorithm.hpp>
#include
<language/modules/BinaryOperatorRegisterForVh.hpp>
#include
<language/modules/BinaryOperatorRegisterForVh.hpp>
#include
<language/modules/MathFunctionRegisterForVh.hpp>
#include
<language/modules/MathFunctionRegisterForVh.hpp>
#include
<language/modules/UnaryOperatorRegisterForVh.hpp>
#include
<language/modules/UnaryOperatorRegisterForVh.hpp>
...
@@ -485,42 +484,6 @@ SchemeModule::SchemeModule()
...
@@ -485,42 +484,6 @@ SchemeModule::SchemeModule()
));
));
this
->
_addBuiltinFunction
(
"odediscontinuousgalerkin1D"
,
std
::
make_shared
<
BuiltinFunctionEmbedder
<
void
(
std
::
shared_ptr
<
const
BasisType
>
basis_type
,
const
size_t
&
,
std
::
shared_ptr
<
const
IMesh
>
,
const
FunctionSymbolId
&
)
>>
(
[](
std
::
shared_ptr
<
const
BasisType
>
basis_type
,
const
size_t
&
Degree
,
std
::
shared_ptr
<
const
IMesh
>
p_mesh
,
const
FunctionSymbolId
&
uex_id
)
->
void
{
Assert
(
p_mesh
->
dimension
()
==
1
,
"invalid mesh dimension"
);
switch
(
Degree
)
{
case
0
:
{
ODEDiscontinuousGalerkin1D
<
1
,
0
>
(
*
basis_type
,
p_mesh
,
uex_id
);
break
;
}
case
1
:
{
ODEDiscontinuousGalerkin1D
<
1
,
1
>
(
*
basis_type
,
p_mesh
,
uex_id
);
break
;
}
case
2
:
{
ODEDiscontinuousGalerkin1D
<
1
,
2
>
(
*
basis_type
,
p_mesh
,
uex_id
);
break
;
}
case
3
:
{
ODEDiscontinuousGalerkin1D
<
1
,
3
>
(
*
basis_type
,
p_mesh
,
uex_id
);
break
;
}
case
4
:
{
ODEDiscontinuousGalerkin1D
<
1
,
4
>
(
*
basis_type
,
p_mesh
,
uex_id
);
break
;
}
default
:
{
throw
UnexpectedError
(
"invalid polynomial degree"
);
}
}
}
));
this
this
->
_addBuiltinFunction
(
"lagrangian"
,
->
_addBuiltinFunction
(
"lagrangian"
,
std
::
make_shared
<
BuiltinFunctionEmbedder
<
std
::
make_shared
<
BuiltinFunctionEmbedder
<
...
...
This diff is collapsed.
Click to expand it.
tests/test_Polynomial.cpp
+
1
−
1
View file @
21d641e6
...
@@ -22,7 +22,7 @@ TEST_CASE("Polynomial", "[analysis]")
...
@@ -22,7 +22,7 @@ TEST_CASE("Polynomial", "[analysis]")
{
{
SECTION
(
"construction"
)
SECTION
(
"construction"
)
{
{
REQUIRE_NOTHROW
(
Polynomial
<
2
>
{
{
2
,
3
,
4
}
}
);
REQUIRE_NOTHROW
(
Polynomial
<
2
>
(
{
2
,
3
,
4
}
)
);
}
}
SECTION
(
"degree"
)
SECTION
(
"degree"
)
{
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment