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
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Larry Price
gmsh
Commits
7c728d26
Commit
7c728d26
authored
16 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
*** empty log message ***
parent
4c9add98
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Makefile
+2
-2
2 additions, 2 deletions
Makefile
Numeric/FunctionSpace.cpp
+2
-14
2 additions, 14 deletions
Numeric/FunctionSpace.cpp
Numeric/FunctionSpace.h
+57
-130
57 additions, 130 deletions
Numeric/FunctionSpace.h
with
61 additions
and
146 deletions
Makefile
+
2
−
2
View file @
7c728d26
...
@@ -7,7 +7,7 @@ include variables
...
@@ -7,7 +7,7 @@ include variables
GMSH_MAJOR_VERSION
=
2
GMSH_MAJOR_VERSION
=
2
GMSH_MINOR_VERSION
=
2
GMSH_MINOR_VERSION
=
2
GMSH_PATCH_VERSION
=
5
GMSH_PATCH_VERSION
=
6
GMSH_EXTRA_VERSION
=
GMSH_EXTRA_VERSION
=
GMSH_VERSION
=
${
GMSH_MAJOR_VERSION
}
.
${
GMSH_MINOR_VERSION
}
.
${
GMSH_PATCH_VERSION
}${
GMSH_EXTRA_VERSION
}
GMSH_VERSION
=
${
GMSH_MAJOR_VERSION
}
.
${
GMSH_MINOR_VERSION
}
.
${
GMSH_PATCH_VERSION
}${
GMSH_EXTRA_VERSION
}
...
@@ -113,7 +113,7 @@ else
...
@@ -113,7 +113,7 @@ else
if
not exist
${
includedir
}
\g
msh
mkdir
${
includedir
}
\g
msh
if
not exist
${
includedir
}
\g
msh
mkdir
${
includedir
}
\g
msh
if
not exist
${
libdir
}
mkdir
${
libdir
}
if
not exist
${
libdir
}
mkdir
${
libdir
}
erase /q
${
includedir
}
\g
msh
\*
.h
erase /q
${
includedir
}
\g
msh
\*
.h
for
%%i
in
(
${
subst /,
\,
${
GMSH_API
}}
)
do
copy %%i
${
includedir
}
\g
msh
for
%%i
in
(
${
subst /,
\,
${
GMSH_API
}}
)
do
copy %%i
${
includedir
}
\g
msh
copy /y lib
\l
ibGmsh
${
LIBEXT
}
${
libdir
}
\l
ibGmsh
${
LIBSUFFIX
}${
LIBEXT
}
copy /y lib
\l
ibGmsh
${
LIBEXT
}
${
libdir
}
\l
ibGmsh
${
LIBSUFFIX
}${
LIBEXT
}
endif
endif
...
...
This diff is collapsed.
Click to expand it.
Numeric/FunctionSpace.cpp
+
2
−
14
View file @
7c728d26
...
@@ -11,7 +11,6 @@
...
@@ -11,7 +11,6 @@
#include
"GmshDefines.h"
#include
"GmshDefines.h"
#include
"GmshMessage.h"
#include
"GmshMessage.h"
Double_Matrix
generate1DMonomials
(
int
order
)
Double_Matrix
generate1DMonomials
(
int
order
)
{
{
Double_Matrix
monomials
(
order
+
1
,
1
);
Double_Matrix
monomials
(
order
+
1
,
1
);
...
@@ -115,14 +114,7 @@ Double_Matrix generatePascalSerendipityTetrahedron(int order)
...
@@ -115,14 +114,7 @@ Double_Matrix generatePascalSerendipityTetrahedron(int order)
4
*
std
::
max
(
0
,
(
order
-
2
)
*
(
order
-
1
)
/
2
);
4
*
std
::
max
(
0
,
(
order
-
2
)
*
(
order
-
1
)
/
2
);
Double_Matrix
monomials
(
nbMonomials
,
3
);
Double_Matrix
monomials
(
nbMonomials
,
3
);
// order 0
monomials
.
set_all
(
0
);
monomials
.
set_all
(
0
);
monomials
(
0
,
0
)
=
0
;
monomials
(
0
,
1
)
=
0
;
monomials
(
0
,
2
)
=
0
;
int
index
=
1
;
int
index
=
1
;
for
(
int
p
=
1
;
p
<
order
;
p
++
)
{
for
(
int
p
=
1
;
p
<
order
;
p
++
)
{
for
(
int
i
=
0
;
i
<
3
;
i
++
)
{
for
(
int
i
=
0
;
i
<
3
;
i
++
)
{
...
@@ -687,13 +679,11 @@ const gmshFunctionSpace &gmshFunctionSpaces::find(int tag)
...
@@ -687,13 +679,11 @@ const gmshFunctionSpace &gmshFunctionSpaces::find(int tag)
std
::
map
<
std
::
pair
<
int
,
int
>
,
Double_Matrix
>
gmshFunctionSpaces
::
injector
;
std
::
map
<
std
::
pair
<
int
,
int
>
,
Double_Matrix
>
gmshFunctionSpaces
::
injector
;
const
Double_Matrix
&
gmshFunctionSpaces
::
findInjector
(
int
tag1
,
int
tag2
)
const
Double_Matrix
&
gmshFunctionSpaces
::
findInjector
(
int
tag1
,
int
tag2
)
{
{
std
::
pair
<
int
,
int
>
key
(
tag1
,
tag2
);
std
::
pair
<
int
,
int
>
key
(
tag1
,
tag2
);
std
::
map
<
std
::
pair
<
int
,
int
>
,
Double_Matrix
>::
const_iterator
it
=
injector
.
find
(
key
);
std
::
map
<
std
::
pair
<
int
,
int
>
,
Double_Matrix
>::
const_iterator
it
=
injector
.
find
(
key
);
if
(
it
!=
injector
.
end
())
return
it
->
second
;
if
(
it
!=
injector
.
end
())
return
it
->
second
;
const
gmshFunctionSpace
&
fs1
=
find
(
tag1
);
const
gmshFunctionSpace
&
fs1
=
find
(
tag1
);
const
gmshFunctionSpace
&
fs2
=
find
(
tag2
);
const
gmshFunctionSpace
&
fs2
=
find
(
tag2
);
...
@@ -710,5 +700,3 @@ const Double_Matrix &gmshFunctionSpaces::findInjector(int tag1,int tag2) {
...
@@ -710,5 +700,3 @@ const Double_Matrix &gmshFunctionSpaces::findInjector(int tag1,int tag2) {
injector
.
insert
(
std
::
make_pair
(
key
,
inj
));
injector
.
insert
(
std
::
make_pair
(
key
,
inj
));
return
injector
[
key
];
return
injector
[
key
];
}
}
This diff is collapsed.
Click to expand it.
Numeric/FunctionSpace.h
+
57
−
130
View file @
7c728d26
...
@@ -17,166 +17,93 @@ struct gmshFunctionSpace
...
@@ -17,166 +17,93 @@ struct gmshFunctionSpace
Double_Matrix
points
;
Double_Matrix
points
;
Double_Matrix
monomials
;
Double_Matrix
monomials
;
Double_Matrix
coefficients
;
Double_Matrix
coefficients
;
inline
void
evaluateMonomials
(
double
u
,
double
v
,
double
w
,
double
p
[])
const
inline
void
evaluateMonomials
(
double
u
,
double
v
,
double
w
,
double
p
[])
const
{
{
for
(
int
j
=
0
;
j
<
monomials
.
size1
();
j
++
)
{
for
(
int
j
=
0
;
j
<
monomials
.
size1
();
j
++
)
{
p
[
j
]
=
pow
(
u
,(
int
)
monomials
(
j
,
0
));
p
[
j
]
=
pow
(
u
,
(
int
)
monomials
(
j
,
0
));
if
(
monomials
.
size2
()
>
1
)
p
[
j
]
*=
pow
(
v
,(
int
)
monomials
(
j
,
1
));
if
(
monomials
.
size2
()
>
1
)
p
[
j
]
*=
pow
(
v
,
(
int
)
monomials
(
j
,
1
));
if
(
monomials
.
size2
()
>
2
)
p
[
j
]
*=
pow
(
w
,(
int
)
monomials
(
j
,
2
));
if
(
monomials
.
size2
()
>
2
)
p
[
j
]
*=
pow
(
w
,
(
int
)
monomials
(
j
,
2
));
}
}
}
}
/* inline void evaluateMonomialDerivatives(double u,double v,double w,double p[][3]) const */
/* { */
/* for (int j=0;j<monomials.size1();j++) { */
/* int expU = (int) monomials(j,0); */
/* double uu = pow(u,expU); */
/* p[j][0] = pow(u,expU - 1) * expU; */
/* p[j][1] = 0.; */
/* p[j][2] = 0.; */
/* if (monomials.size2() > 1) { */
/* int expV = (int) monomials(j,1); */
/* double vv = pow(v,expV); */
/* p[j][0] *= vv; */
/* p[j][1] = uu * pow(v,expV-1) * expV; */
/* if (monomials.size2() > 2) { */
/* int expW = (int) monomials(j,2); */
/* double ww = pow(w,expW); */
/* p[j][0] *= ww; */
/* p[j][1] *= ww; */
/* p[j][2] = uu * vv * pow(w,expW-1) * expW; */
/* } */
/* } */
/* } */
/* } */
inline
void
f
(
double
u
,
double
v
,
double
w
,
double
*
sf
)
const
inline
void
f
(
double
u
,
double
v
,
double
w
,
double
*
sf
)
const
{
{
double
p
[
256
];
double
p
[
256
];
evaluateMonomials
(
u
,
v
,
w
,
p
);
evaluateMonomials
(
u
,
v
,
w
,
p
);
for
(
int
i
=
0
;
i
<
coefficients
.
size1
();
i
++
)
{
for
(
int
i
=
0
;
i
<
coefficients
.
size1
();
i
++
)
{
sf
[
i
]
=
0
;
sf
[
i
]
=
0
;
for
(
int
j
=
0
;
j
<
coefficients
.
size2
();
j
++
)
{
for
(
int
j
=
0
;
j
<
coefficients
.
size2
();
j
++
)
{
sf
[
i
]
+=
coefficients
(
i
,
j
)
*
p
[
j
];
sf
[
i
]
+=
coefficients
(
i
,
j
)
*
p
[
j
];
}
}
}
}
}
}
inline
void
df
(
double
u
,
double
v
,
double
w
,
double
grads
[][
3
])
const
inline
void
df
(
double
u
,
double
v
,
double
w
,
double
grads
[][
3
])
const
{
{
switch
(
monomials
.
size2
())
{
switch
(
monomials
.
size2
())
{
case
1
:
case
1
:
{
for
(
int
i
=
0
;
i
<
coefficients
.
size1
();
i
++
){
for
(
int
i
=
0
;
i
<
coefficients
.
size1
();
i
++
){
grads
[
i
][
0
]
=
0
;
grads
[
i
][
0
]
=
0
;
grads
[
i
][
1
]
=
0
;
grads
[
i
][
1
]
=
0
;
grads
[
i
][
2
]
=
0
;
grads
[
i
][
2
]
=
0
;
for
(
int
j
=
0
;
j
<
coefficients
.
size2
();
j
++
){
for
(
int
j
=
0
;
j
<
coefficients
.
size2
();
j
++
){
if
((
monomials
)(
j
,
0
)
>
0
)
if
((
monomials
)(
j
,
0
)
>
0
)
grads
[
i
][
0
]
+=
(
coefficients
)(
i
,
j
)
*
grads
[
i
][
0
]
+=
(
coefficients
)(
i
,
j
)
*
pow
(
u
,
(
monomials
)(
j
,
0
)
-
1
)
*
(
monomials
)(
j
,
0
);
pow
(
u
,
(
monomials
)(
j
,
0
)
-
1
)
*
(
monomials
)(
j
,
0
);
}
}
}
break
;
}
}
break
;
case
2
:
case
2
:
{
for
(
int
i
=
0
;
i
<
coefficients
.
size1
();
i
++
){
grads
[
i
][
0
]
=
0
;
for
(
int
i
=
0
;
i
<
coefficients
.
size1
();
i
++
){
grads
[
i
][
1
]
=
0
;
grads
[
i
][
0
]
=
0
;
grads
[
i
][
2
]
=
0
;
grads
[
i
][
1
]
=
0
;
for
(
int
j
=
0
;
j
<
coefficients
.
size2
();
j
++
){
grads
[
i
][
2
]
=
0
;
if
((
monomials
)(
j
,
0
)
>
0
)
for
(
int
j
=
0
;
j
<
coefficients
.
size2
();
j
++
){
grads
[
i
][
0
]
+=
(
coefficients
)(
i
,
j
)
*
if
((
monomials
)(
j
,
0
)
>
0
)
pow
(
u
,
(
monomials
)(
j
,
0
)
-
1
)
*
(
monomials
)(
j
,
0
)
*
grads
[
i
][
0
]
+=
(
coefficients
)(
i
,
j
)
*
pow
(
v
,
(
monomials
)(
j
,
1
));
pow
(
u
,
(
monomials
)(
j
,
0
)
-
1
)
*
(
monomials
)(
j
,
0
)
*
if
((
monomials
)(
j
,
1
)
>
0
)
pow
(
v
,
(
monomials
)(
j
,
1
));
grads
[
i
][
1
]
+=
(
coefficients
)(
i
,
j
)
*
if
((
monomials
)(
j
,
1
)
>
0
)
pow
(
u
,
(
monomials
)(
j
,
0
))
*
grads
[
i
][
1
]
+=
(
coefficients
)(
i
,
j
)
*
pow
(
v
,
(
monomials
)(
j
,
1
)
-
1
)
*
(
monomials
)(
j
,
1
);
pow
(
u
,
(
monomials
)(
j
,
0
))
*
pow
(
v
,
(
monomials
)(
j
,
1
)
-
1
)
*
(
monomials
)(
j
,
1
);
}
}
}
break
;
}
}
break
;
case
3
:
case
3
:
{
for
(
int
i
=
0
;
i
<
coefficients
.
size1
();
i
++
){
grads
[
i
][
0
]
=
0
;
for
(
int
i
=
0
;
i
<
coefficients
.
size1
();
i
++
){
grads
[
i
][
1
]
=
0
;
grads
[
i
][
0
]
=
0
;
grads
[
i
][
2
]
=
0
;
grads
[
i
][
1
]
=
0
;
for
(
int
j
=
0
;
j
<
coefficients
.
size2
();
j
++
){
grads
[
i
][
2
]
=
0
;
if
((
monomials
)(
j
,
0
)
>
0
)
for
(
int
j
=
0
;
j
<
coefficients
.
size2
();
j
++
){
grads
[
i
][
0
]
+=
(
coefficients
)(
i
,
j
)
*
if
((
monomials
)(
j
,
0
)
>
0
)
pow
(
u
,
(
monomials
)(
j
,
0
)
-
1
)
*
(
monomials
)(
j
,
0
)
*
grads
[
i
][
0
]
+=
(
coefficients
)(
i
,
j
)
*
pow
(
v
,
(
monomials
)(
j
,
1
))
*
pow
(
u
,
(
monomials
)(
j
,
0
)
-
1
)
*
(
monomials
)(
j
,
0
)
*
pow
(
w
,
(
monomials
)(
j
,
2
));
pow
(
v
,
(
monomials
)(
j
,
1
))
*
if
((
monomials
)(
j
,
1
)
>
0
)
pow
(
w
,
(
monomials
)(
j
,
2
));
grads
[
i
][
1
]
+=
(
coefficients
)(
i
,
j
)
*
if
((
monomials
)(
j
,
1
)
>
0
)
pow
(
u
,
(
monomials
)(
j
,
0
))
*
grads
[
i
][
1
]
+=
(
coefficients
)(
i
,
j
)
*
pow
(
v
,
(
monomials
)(
j
,
1
)
-
1
)
*
(
monomials
)(
j
,
1
)
*
pow
(
u
,
(
monomials
)(
j
,
0
))
*
pow
(
w
,
(
monomials
)(
j
,
2
));
pow
(
v
,
(
monomials
)(
j
,
1
)
-
1
)
*
(
monomials
)(
j
,
1
)
*
if
((
monomials
)(
j
,
2
)
>
0
)
pow
(
w
,
(
monomials
)(
j
,
2
));
grads
[
i
][
2
]
+=
(
coefficients
)(
i
,
j
)
*
if
((
monomials
)(
j
,
2
)
>
0
)
pow
(
u
,
(
monomials
)(
j
,
0
))
*
grads
[
i
][
2
]
+=
(
coefficients
)(
i
,
j
)
*
pow
(
v
,
(
monomials
)(
j
,
1
))
*
pow
(
u
,
(
monomials
)(
j
,
0
))
*
pow
(
w
,
(
monomials
)(
j
,
2
)
-
1
)
*
(
monomials
)(
j
,
2
);
pow
(
v
,
(
monomials
)(
j
,
1
))
*
pow
(
w
,
(
monomials
)(
j
,
2
)
-
1
)
*
(
monomials
)(
j
,
2
);
}
}
}
break
;
}
}
break
;
}
}
}
}
/* inline void df(double u, double v, double w, double grads[][3]) const */
/* { */
/* double p[256][3]; */
/* evaluateMonomialDerivatives(u,v,w,p); */
/* for (int i=0;i<coefficients.size1();i++) { */
/* grads[i][0] = 0.; */
/* grads[i][1] = 0.; */
/* grads[i][2] = 0.; */
/* for (int j=0;j<coefficients.size2();j++) { */
/* grads[i][0] += coefficients(i,j) * p[j][0]; */
/* grads[i][1] += coefficients(i,j) * p[j][1]; */
/* // grads[i][2] += coefficients(i,j) * p[j][2]; */
/* } */
/* } */
/* } */
};
};
class
gmshFunctionSpaces
class
gmshFunctionSpaces
{
{
private:
static
std
::
map
<
int
,
gmshFunctionSpace
>
fs
;
static
std
::
map
<
int
,
gmshFunctionSpace
>
fs
;
static
std
::
map
<
std
::
pair
<
int
,
int
>
,
Double_Matrix
>
injector
;
static
std
::
map
<
std
::
pair
<
int
,
int
>
,
Double_Matrix
>
injector
;
public
:
public
:
static
const
gmshFunctionSpace
&
find
(
int
);
static
const
gmshFunctionSpace
&
find
(
int
);
static
const
Double_Matrix
&
findInjector
(
int
,
int
);
static
const
Double_Matrix
&
findInjector
(
int
,
int
);
};
};
#endif
#endif
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