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
d266148c
Commit
d266148c
authored
14 years ago
by
Jonathan Lambrechts
Browse files
Options
Downloads
Patches
Plain Diff
dg : bezierCrop to crop high order fields
parent
2d749b68
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Numeric/JacobianBasis.cpp
+34
-42
34 additions, 42 deletions
Numeric/JacobianBasis.cpp
Numeric/JacobianBasis.h
+1
-1
1 addition, 1 deletion
Numeric/JacobianBasis.h
with
35 additions
and
43 deletions
Numeric/JacobianBasis.cpp
+
34
−
42
View file @
d266148c
...
...
@@ -991,9 +991,9 @@ static int nChoosek(int n, int k)
}
static
fullMatrix
<
double
>
generate
Lag2Bez
Matrix
static
fullMatrix
<
double
>
generate
Bez2Lag
Matrix
(
const
fullMatrix
<
double
>
&
exposant
,
const
fullMatrix
<
double
>
&
point
,
int
order
,
int
dimSimplex
,
bool
invert
=
true
)
int
order
,
int
dimSimplex
)
{
if
(
exposant
.
size1
()
!=
point
.
size1
()
||
exposant
.
size2
()
!=
point
.
size2
()){
...
...
@@ -1029,12 +1029,7 @@ static fullMatrix<double> generateLag2BezMatrix
Vandermonde
(
j
,
i
)
=
dd
;
}
}
if
(
!
invert
)
return
Vandermonde
;
fullMatrix
<
double
>
coefficient
(
ndofs
,
ndofs
);
Vandermonde
.
invert
(
coefficient
);
return
coefficient
;
return
Vandermonde
;
}
...
...
@@ -1058,7 +1053,7 @@ static fullMatrix<double> generateDivisor
for
(
unsigned
int
i
=
0
;
i
<
subPoints
.
size
();
i
++
)
{
fullMatrix
<
double
>
intermediate1
=
generate
Lag2Bez
Matrix
(
exposants
,
subPoints
[
i
],
order
,
dimSimplex
,
false
);
generate
Bez2Lag
Matrix
(
exposants
,
subPoints
[
i
],
order
,
dimSimplex
);
lag2Bez
.
mult
(
intermediate1
,
intermediate2
);
divisor
.
copy
(
intermediate2
,
0
,
nbPts
,
0
,
nbPts
,
i
*
nbPts
,
0
);
}
...
...
@@ -1197,71 +1192,68 @@ const bezierBasis *bezierBasis::find(int tag)
bezierBasis
&
B
=
_bbs
[
tag
];
const
polynomialBasis
*
F
=
polynomialBases
::
find
(
tag
);
int
o
=
F
->
order
;
int
dimSimplex
;
std
::
vector
<
fullMatrix
<
double
>
>
subPoints
;
switch
(
F
->
parentType
)
{
case
TYPE_PNT
:
B
.
numLagPts
=
1
;
B
.
exposants
=
generate1DExposants
(
0
);
B
.
points
=
generate1DPoints
(
0
);
B
.
matrixLag2Bez
=
generateLag2BezMatrix
(
B
.
exposants
,
B
.
points
,
0
,
0
)
;
dimSimplex
=
0
;
break
;
case
TYPE_LIN
:
{
B
.
numLagPts
=
2
;
B
.
exposants
=
generate1DExposants
(
o
);
B
.
points
=
generate1DPoints
(
o
);
B
.
matrixLag2Bez
=
generateLag2BezMatrix
(
B
.
exposants
,
B
.
points
,
o
,
0
);
std
::
vector
<
fullMatrix
<
double
>
>
subPoints
=
generateSubPointsLine
(
0
);
B
.
divisor
=
generateDivisor
(
B
.
exposants
,
subPoints
,
B
.
matrixLag2Bez
,
o
,
0
);
const
polynomialBasis
*
F
=
polynomialBases
::
find
(
tag
);
B
.
exposants
=
generate1DExposants
(
F
->
order
);
B
.
points
=
generate1DPoints
(
F
->
order
);
dimSimplex
=
0
;
subPoints
=
generateSubPointsLine
(
0
);
break
;
}
case
TYPE_TRI
:
{
B
.
numLagPts
=
3
;
B
.
exposants
=
generateExposantsTriangle
(
o
);
B
.
points
=
gmshGeneratePointsTriangle
(
o
,
false
);
B
.
matrixLag2Bez
=
generateLag2BezMatrix
(
B
.
exposants
,
B
.
points
,
o
,
2
);
std
::
vector
<
fullMatrix
<
double
>
>
subPoints
=
generateSubPointsTriangle
(
o
);
B
.
divisor
=
generateDivisor
(
B
.
exposants
,
subPoints
,
B
.
matrixLag2Bez
,
o
,
2
);
B
.
exposants
=
generateExposantsTriangle
(
F
->
order
);
B
.
points
=
gmshGeneratePointsTriangle
(
F
->
order
,
false
);
dimSimplex
=
2
;
subPoints
=
generateSubPointsTriangle
(
F
->
order
);
break
;
}
case
TYPE_TET
:
{
B
.
numLagPts
=
4
;
B
.
exposants
=
generateExposantsTetrahedron
(
o
);
B
.
points
=
gmshGeneratePointsTetrahedron
(
o
,
false
);
B
.
matrixLag2Bez
=
generateLag2BezMatrix
(
B
.
exposants
,
B
.
points
,
o
,
3
);
std
::
vector
<
fullMatrix
<
double
>
>
subPoints
=
generateSubPointsTetrahedron
(
o
);
B
.
divisor
=
generateDivisor
(
B
.
exposants
,
subPoints
,
B
.
matrixLag2Bez
,
o
,
3
);
B
.
exposants
=
generateExposantsTetrahedron
(
F
->
order
);
B
.
points
=
gmshGeneratePointsTetrahedron
(
F
->
order
,
false
);
dimSimplex
=
3
;
subPoints
=
generateSubPointsTetrahedron
(
F
->
order
);
break
;
}
case
TYPE_QUA
:
{
B
.
numLagPts
=
4
;
B
.
exposants
=
generateExposantsQuad
(
o
);
B
.
points
=
generatePointsQuad
(
o
,
false
);
B
.
matrixLag2Bez
=
generateLag2BezMatrix
(
B
.
exposants
,
B
.
points
,
o
,
0
);
std
::
vector
<
fullMatrix
<
double
>
>
subPoints
=
generateSubPointsQuad
(
o
);
B
.
divisor
=
generateDivisor
(
B
.
exposants
,
subPoints
,
B
.
matrixLag2Bez
,
o
,
0
);
B
.
exposants
=
generateExposantsQuad
(
F
->
order
);
B
.
points
=
generatePointsQuad
(
F
->
order
,
false
);
dimSimplex
=
0
;
subPoints
=
generateSubPointsQuad
(
F
->
order
);
break
;
}
case
TYPE_PRI
:
{
B
.
numLagPts
=
4
;
B
.
exposants
=
generateExposantsPrism
(
o
);
B
.
points
=
generatePointsPrism
(
o
,
false
);
B
.
matrixLag2Bez
=
generateLag2BezMatrix
(
B
.
exposants
,
B
.
points
,
o
,
2
);
std
::
vector
<
fullMatrix
<
double
>
>
subPoints
=
generateSubPointsPrism
(
o
);
B
.
divisor
=
generateDivisor
(
B
.
exposants
,
subPoints
,
B
.
matrixLag2Bez
,
o
,
2
);
B
.
exposants
=
generateExposantsPrism
(
F
->
order
);
B
.
points
=
generatePointsPrism
(
F
->
order
,
false
);
dimSimplex
=
2
;
subPoints
=
generateSubPointsPrism
(
F
->
order
);
break
;
}
default
:
{
Msg
::
Error
(
"Unknown function space %d: reverting to TET_4"
,
tag
);
Msg
::
Error
(
"Unknown function space %d: reverting to TET_1"
,
tag
);
F
=
polynomialBases
::
find
(
MSH_TET_1
);
B
.
numLagPts
=
4
;
B
.
exposants
=
generateExposantsTetrahedron
(
0
);
B
.
points
=
gmshGeneratePointsTetrahedron
(
0
,
false
);
B
.
matrixLag2Bez
=
generateLag2BezMatrix
(
B
.
exposants
,
B
.
points
,
0
,
3
);
std
::
vector
<
fullMatrix
<
double
>
>
subPoints
=
generateSubPointsTetrahedron
(
0
);
B
.
divisor
=
generateDivisor
(
B
.
exposants
,
subPoints
,
B
.
matrixLag2Bez
,
0
,
3
);
F
=
polynomialBases
::
find
(
MSH_TET_4
);
dimSimplex
=
3
;
subPoints
=
generateSubPointsTetrahedron
(
0
);
}
}
B
.
matrixBez2Lag
=
generateBez2LagMatrix
(
B
.
exposants
,
B
.
points
,
F
->
order
,
dimSimplex
);
B
.
matrixBez2Lag
.
invert
(
B
.
matrixLag2Bez
);
B
.
divisor
=
generateDivisor
(
B
.
exposants
,
subPoints
,
B
.
matrixLag2Bez
,
F
->
order
,
dimSimplex
);
B
.
numDivisions
=
(
int
)
pow
(
2.
,
(
int
)
B
.
points
.
size2
());
return
&
B
;
...
...
This diff is collapsed.
Click to expand it.
Numeric/JacobianBasis.h
+
1
−
1
View file @
d266148c
...
...
@@ -17,7 +17,7 @@ class bezierBasis {
int
numDivisions
;
fullMatrix
<
double
>
exposants
;
//exposants of Bezier FF
fullMatrix
<
double
>
points
;
//sampling point
fullMatrix
<
double
>
matrixLag2Bez
;
fullMatrix
<
double
>
matrixLag2Bez
,
matrixBez2Lag
;
fullMatrix
<
double
>
divisor
;
static
const
bezierBasis
*
find
(
int
);
};
...
...
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