Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gmsh
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Larry Price
gmsh
Commits
13a36430
Commit
13a36430
authored
Sep 14, 2012
by
Nicolas Marsic
Browse files
Options
Downloads
Patches
Plain Diff
Closuer for Quadrangles (WARNING: Still nedd good Gauss Points)
parent
cf1e26e2
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
FunctionSpace/QuadEdgeBasis.cpp
+45
-16
45 additions, 16 deletions
FunctionSpace/QuadEdgeBasis.cpp
FunctionSpace/QuadNodeBasis.cpp
+22
-5
22 additions, 5 deletions
FunctionSpace/QuadNodeBasis.cpp
FunctionSpace/TriNodeBasis.cpp
+3
-0
3 additions, 0 deletions
FunctionSpace/TriNodeBasis.cpp
with
70 additions
and
21 deletions
FunctionSpace/QuadEdgeBasis.cpp
+
45
−
16
View file @
13a36430
...
...
@@ -25,11 +25,11 @@ QuadEdgeBasis::QuadEdgeBasis(const int order){
Polynomial
*
legendreX
=
new
Polynomial
[
orderPlus
];
Polynomial
*
legendreY
=
new
Polynomial
[
orderPlus
];
Polynomial
*
lagrange
=
new
Polynomial
[
4
];
Polynomial
*
l
agrangeSum
=
new
Polynomial
[
4
];
Polynomial
*
lifting
=
new
Polynomial
[
4
];
Polynomial
*
l
iftingSub
=
new
Polynomial
[
4
];
Polynomial
lagrange
[
4
];
Polynomial
l
ifting
[
4
];
Polynomial
lagrangeSum
[
4
];
Polynomial
lifting
Sub
[
4
];
Polynomial
rL
iftingSub
[
4
];
// Integrated and classical Legendre Polynomial //
Legendre
::
integrated
(
intLegendre
,
orderPlus
);
...
...
@@ -74,12 +74,14 @@ QuadEdgeBasis::QuadEdgeBasis(const int order){
(
Polynomial
(
1
,
0
,
1
,
0
));
// Lifting Sub //
for
(
int
i
=
0
,
j
=
1
;
i
<
4
;
i
++
,
j
=
(
j
+
1
)
%
4
)
for
(
int
i
=
0
,
j
=
1
;
i
<
4
;
i
++
,
j
=
(
j
+
1
)
%
4
)
{
liftingSub
[
i
]
=
lifting
[
j
]
-
lifting
[
i
];
rLiftingSub
[
i
]
=
lifting
[
i
]
-
lifting
[
j
];
}
// Basis (temporary --- *no* const) //
std
::
vector
<
std
::
vector
<
Polynomial
>*>
basis
(
size
);
std
::
vector
<
std
::
vector
<
Polynomial
>*>
revBasis
(
size
);
// Edge Based (Nedelec) //
...
...
@@ -87,6 +89,7 @@ QuadEdgeBasis::QuadEdgeBasis(const int order){
Polynomial
oneHalf
(
0.5
,
0
,
0
,
0
);
for
(
int
e
=
0
;
e
<
4
;
e
++
){
// Direct
basis
[
i
]
=
new
std
::
vector
<
Polynomial
>
(
liftingSub
[
e
].
gradient
());
basis
[
i
]
->
at
(
0
).
mul
(
lagrangeSum
[
e
]);
...
...
@@ -97,6 +100,18 @@ QuadEdgeBasis::QuadEdgeBasis(const int order){
basis
[
i
]
->
at
(
1
).
mul
(
oneHalf
);
basis
[
i
]
->
at
(
2
).
mul
(
oneHalf
);
// Revert
revBasis
[
i
]
=
new
std
::
vector
<
Polynomial
>
(
rLiftingSub
[
e
].
gradient
());
revBasis
[
i
]
->
at
(
0
).
mul
(
lagrangeSum
[
e
]);
revBasis
[
i
]
->
at
(
1
).
mul
(
lagrangeSum
[
e
]);
revBasis
[
i
]
->
at
(
2
).
mul
(
lagrangeSum
[
e
]);
revBasis
[
i
]
->
at
(
0
).
mul
(
oneHalf
);
revBasis
[
i
]
->
at
(
1
).
mul
(
oneHalf
);
revBasis
[
i
]
->
at
(
2
).
mul
(
oneHalf
);
// Next
i
++
;
}
...
...
@@ -104,7 +119,12 @@ QuadEdgeBasis::QuadEdgeBasis(const int order){
for
(
int
l
=
1
;
l
<
orderPlus
;
l
++
){
for
(
int
e
=
0
;
e
<
4
;
e
++
){
basis
[
i
]
=
new
std
::
vector
<
Polynomial
>
((
intLegendre
[
l
].
compose
(
liftingSub
[
e
])
*
lagrangeSum
[
e
]).
gradient
());
new
std
::
vector
<
Polynomial
>
((
intLegendre
[
l
].
compose
(
liftingSub
[
e
])
*
lagrangeSum
[
e
]).
gradient
());
revBasis
[
i
]
=
new
std
::
vector
<
Polynomial
>
((
intLegendre
[
l
].
compose
(
rLiftingSub
[
e
])
*
lagrangeSum
[
e
]).
gradient
());
i
++
;
}
...
...
@@ -131,6 +151,8 @@ QuadEdgeBasis::QuadEdgeBasis(const int order){
for
(
int
l2
=
1
;
l2
<
orderPlus
;
l2
++
){
basis
[
i
]
=
new
std
::
vector
<
Polynomial
>
((
iLegendreX
[
l1
]
*
iLegendreY
[
l2
]).
gradient
());
revBasis
[
i
]
=
basis
[
i
];
i
++
;
}
}
...
...
@@ -144,6 +166,8 @@ QuadEdgeBasis::QuadEdgeBasis(const int order){
basis
[
i
]
->
at
(
1
)
=
iLegendreX
[
l1
]
*
legendreY
[
l2
]
*
-
1
;
basis
[
i
]
->
at
(
2
)
=
zero
;
revBasis
[
i
]
=
basis
[
i
];
i
++
;
}
}
...
...
@@ -161,9 +185,12 @@ QuadEdgeBasis::QuadEdgeBasis(const int order){
basis
[
iPlus
]
->
at
(
1
)
=
iLegendreX
[
l
];
basis
[
iPlus
]
->
at
(
2
)
=
zero
;
revBasis
[
i
]
=
basis
[
i
];
i
++
;
}
// Free Temporary Sapce //
delete
[]
legendre
;
delete
[]
intLegendre
;
...
...
@@ -173,21 +200,23 @@ QuadEdgeBasis::QuadEdgeBasis(const int order){
delete
[]
legendreX
;
delete
[]
legendreY
;
delete
[]
lagrange
;
delete
[]
lagrangeSum
;
delete
[]
lifting
;
delete
[]
liftingSub
;
// Set Basis //
this
->
basis
=
new
std
::
vector
<
const
std
::
vector
<
Polynomial
>*>
(
basis
.
begin
(),
basis
.
end
());
this
->
revBasis
=
new
std
::
vector
<
const
std
::
vector
<
Polynomial
>*>
(
revBasis
.
begin
(),
revBasis
.
end
());
}
QuadEdgeBasis
::~
QuadEdgeBasis
(
void
){
for
(
int
i
=
0
;
i
<
size
;
i
++
)
for
(
int
i
=
0
;
i
<
size
;
i
++
)
{
delete
(
*
basis
)[
i
];
if
(
i
>=
nVertex
&&
i
<
nVertex
+
nEdge
)
delete
(
*
revBasis
)[
i
];
}
delete
basis
;
delete
revBasis
;
}
This diff is collapsed.
Click to expand it.
FunctionSpace/QuadNodeBasis.cpp
+
22
−
5
View file @
13a36430
...
...
@@ -17,7 +17,7 @@ QuadNodeBasis::QuadNodeBasis(const int order){
// Alloc Temporary Space //
Polynomial
*
legendre
=
new
Polynomial
[
order
];
Polynomial
*
lifting
=
new
Polynomial
[
4
];
Polynomial
lifting
[
4
];
// Legendre Polynomial //
Legendre
::
integrated
(
legendre
,
order
);
...
...
@@ -43,6 +43,7 @@ QuadNodeBasis::QuadNodeBasis(const int order){
// Basis //
basis
=
new
std
::
vector
<
const
Polynomial
*>
(
size
);
revBasis
=
new
std
::
vector
<
const
Polynomial
*>
(
size
);
// Vertex Based (Lagrange) //
(
*
basis
)[
0
]
=
...
...
@@ -61,6 +62,11 @@ QuadNodeBasis::QuadNodeBasis(const int order){
new
Polynomial
((
Polynomial
(
1
,
0
,
0
,
0
)
-
Polynomial
(
1
,
1
,
0
,
0
))
*
(
Polynomial
(
1
,
0
,
1
,
0
)));
// Vertex Based (Revert) //
for
(
int
i
=
0
;
i
<
3
;
i
++
)
(
*
revBasis
)[
i
]
=
(
*
basis
)[
i
];
// Edge Based //
int
i
=
4
;
...
...
@@ -70,10 +76,14 @@ QuadNodeBasis::QuadNodeBasis(const int order){
new
Polynomial
(
legendre
[
l
].
compose
(
lifting
[
e2
]
-
lifting
[
e1
])
*
(
*
(
*
basis
)[
e1
]
+
*
(
*
basis
)[
e2
]));
(
*
revBasis
)[
i
]
=
new
Polynomial
(
legendre
[
l
].
compose
(
lifting
[
e1
]
-
lifting
[
e2
])
*
(
*
(
*
basis
)[
e1
]
+
*
(
*
basis
)[
e2
]));
i
++
;
}
}
// Cell Based //
Polynomial
px
=
Polynomial
(
2
,
1
,
0
,
0
);
Polynomial
py
=
Polynomial
(
2
,
0
,
1
,
0
);
...
...
@@ -86,18 +96,25 @@ QuadNodeBasis::QuadNodeBasis(const int order){
(
*
basis
)[
i
]
=
new
Polynomial
(
legendre
[
l1
].
compose
(
px
)
*
legendre
[
l2
].
compose
(
py
));
(
*
revBasis
)[
i
]
=
(
*
basis
)[
i
];
i
++
;
}
}
// Free Temporary Sapce //
delete
[]
legendre
;
delete
[]
lifting
;
}
QuadNodeBasis
::~
QuadNodeBasis
(
void
){
for
(
int
i
=
0
;
i
<
size
;
i
++
)
for
(
int
i
=
0
;
i
<
size
;
i
++
)
{
delete
(
*
basis
)[
i
];
if
(
i
>=
nVertex
&&
i
<
nVertex
+
nEdge
)
delete
(
*
revBasis
)[
i
];
}
delete
basis
;
delete
revBasis
;
}
This diff is collapsed.
Click to expand it.
FunctionSpace/TriNodeBasis.cpp
+
3
−
0
View file @
13a36430
...
...
@@ -76,6 +76,7 @@ TriNodeBasis::TriNodeBasis(const int order){
}
}
// Cell Based //
Polynomial
p
=
*
(
*
basis
)[
2
]
*
2
-
Polynomial
(
1
,
0
,
0
,
0
);
const
int
orderMinusTwo
=
order
-
2
;
...
...
@@ -87,10 +88,12 @@ TriNodeBasis::TriNodeBasis(const int order){
legendre
[
l2
].
compose
(
p
)
*
*
(
*
basis
)[
2
]);
(
*
revBasis
)[
i
]
=
(
*
basis
)[
i
];
i
++
;
}
}
// Free Temporary Sapce //
delete
[]
legendre
;
delete
[]
intLegendre
;
...
...
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