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
c321e652
Commit
c321e652
authored
15 years ago
by
Jean-François Remacle
Browse files
Options
Downloads
Patches
Plain Diff
gbricteux
parent
cc86cd49
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
Numeric/GmshMatrix.cpp
+4
-3
4 additions, 3 deletions
Numeric/GmshMatrix.cpp
Numeric/GmshMatrix.h
+3
-3
3 additions, 3 deletions
Numeric/GmshMatrix.h
Numeric/gmshLaplace.cpp
+1
-1
1 addition, 1 deletion
Numeric/gmshLaplace.cpp
with
8 additions
and
7 deletions
Numeric/GmshMatrix.cpp
+
4
−
3
View file @
c321e652
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
// bugs and problems to <gmsh@geuz.org>.
// bugs and problems to <gmsh@geuz.org>.
#include
<complex>
#include
<complex>
#include
<string.h>
#include
"GmshConfig.h"
#include
"GmshConfig.h"
#include
"GmshMatrix.h"
#include
"GmshMatrix.h"
#include
"GmshMessage.h"
#include
"GmshMessage.h"
...
@@ -120,11 +121,11 @@ bool gmshMatrix<double>::invertInPlace()
...
@@ -120,11 +121,11 @@ bool gmshMatrix<double>::invertInPlace()
int
*
ipiv
=
new
int
[
N
];
int
*
ipiv
=
new
int
[
N
];
double
*
invA
=
new
double
[
N
*
N
];
double
*
invA
=
new
double
[
N
*
N
];
for
(
size_t
i
=
0
;
i
<
N
*
N
;
i
++
)
invA
[
i
]
=
0.
;
for
(
size_t
i
=
0
;
i
<
N
*
N
;
i
++
)
invA
[
i
]
=
0.
;
for
(
size_t
i
=
0
;
i
<
N
;
i
++
)
invA
[
i
*
N
+
i
]
=
1.
;
for
(
size_t
i
=
0
;
i
<
N
;
i
++
)
invA
[
i
*
N
+
i
]
=
1.
;
dgesv_
(
&
N
,
&
nrhs
,
_data
,
&
lda
,
ipiv
,
invA
,
&
ldb
,
&
info
);
dgesv_
(
&
N
,
&
nrhs
,
_data
,
&
lda
,
ipiv
,
invA
,
&
ldb
,
&
info
);
std
::
memcpy
(
_data
,
invA
,
N
*
N
*
sizeof
(
double
));
memcpy
(
_data
,
invA
,
N
*
N
*
sizeof
(
double
));
delete
[]
invA
;
delete
[]
invA
;
delete
[]
ipiv
;
delete
[]
ipiv
;
...
...
This diff is collapsed.
Click to expand it.
Numeric/GmshMatrix.h
+
3
−
3
View file @
c321e652
...
@@ -78,7 +78,7 @@ class gmshMatrix
...
@@ -78,7 +78,7 @@ class gmshMatrix
gmshMatrix
(
const
gmshMatrix
<
scalar
>
&
other
)
:
_r
(
other
.
_r
),
_c
(
other
.
_c
)
gmshMatrix
(
const
gmshMatrix
<
scalar
>
&
other
)
:
_r
(
other
.
_r
),
_c
(
other
.
_c
)
{
{
_data
=
new
scalar
[
_r
*
_c
];
_data
=
new
scalar
[
_r
*
_c
];
memcpy
(
other
);
gM_
memcpy
(
other
);
}
}
gmshMatrix
()
:
_r
(
0
),
_c
(
0
),
_data
(
0
)
{}
gmshMatrix
()
:
_r
(
0
),
_c
(
0
),
_data
(
0
)
{}
~
gmshMatrix
()
{
if
(
_data
)
delete
[]
_data
;
}
~
gmshMatrix
()
{
if
(
_data
)
delete
[]
_data
;
}
...
@@ -90,11 +90,11 @@ class gmshMatrix
...
@@ -90,11 +90,11 @@ class gmshMatrix
_r
=
other
.
_r
;
_r
=
other
.
_r
;
_c
=
other
.
_c
;
_c
=
other
.
_c
;
_data
=
new
scalar
[
_r
*
_c
];
_data
=
new
scalar
[
_r
*
_c
];
memcpy
(
other
);
gM_
memcpy
(
other
);
}
}
return
*
this
;
return
*
this
;
}
}
void
memcpy
(
const
gmshMatrix
<
scalar
>
&
other
)
void
gM_
memcpy
(
const
gmshMatrix
<
scalar
>
&
other
)
{
{
for
(
int
i
=
0
;
i
<
_r
*
_c
;
++
i
)
_data
[
i
]
=
other
.
_data
[
i
];
for
(
int
i
=
0
;
i
<
_r
*
_c
;
++
i
)
_data
[
i
]
=
other
.
_data
[
i
];
}
}
...
...
This diff is collapsed.
Click to expand it.
Numeric/gmshLaplace.cpp
+
1
−
1
View file @
c321e652
...
@@ -41,7 +41,7 @@ void gmshLaplaceTerm::elementMatrix(MElement *e, gmshMatrix<double> &m) const
...
@@ -41,7 +41,7 @@ void gmshLaplaceTerm::elementMatrix(MElement *e, gmshMatrix<double> &m) const
for
(
int
k
=
0
;
k
<=
j
;
k
++
){
for
(
int
k
=
0
;
k
<=
j
;
k
++
){
m
(
j
,
k
)
+=
(
Grads
[
j
][
0
]
*
Grads
[
k
][
0
]
+
m
(
j
,
k
)
+=
(
Grads
[
j
][
0
]
*
Grads
[
k
][
0
]
+
Grads
[
j
][
1
]
*
Grads
[
k
][
1
]
+
Grads
[
j
][
1
]
*
Grads
[
k
][
1
]
+
Grads
[
j
][
2
]
*
Grads
[
k
][
2
])
*
weight
*
detJ
*
_diff
*
0.5
;
Grads
[
j
][
2
]
*
Grads
[
k
][
2
])
*
weight
*
detJ
*
_diff
;
}
}
}
}
}
}
...
...
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