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
191b3832
Commit
191b3832
authored
15 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
*** empty log message ***
parent
bfdbd3fb
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
Solver/convexCombinationTerm.h
+52
-0
52 additions, 0 deletions
Solver/convexCombinationTerm.h
Solver/crossConfTerm.h
+89
-0
89 additions, 0 deletions
Solver/crossConfTerm.h
Solver/helmholtzTerm.h
+2
-2
2 additions, 2 deletions
Solver/helmholtzTerm.h
with
143 additions
and
2 deletions
Solver/convexCombinationTerm.h
0 → 100644
+
52
−
0
View file @
191b3832
// Gmsh - Copyright (C) 1997-2009 C. Geuzaine, J.-F. Remacle
//
// See the LICENSE.txt file for license information. Please report all
// bugs and problems to <gmsh@geuz.org>.
#ifndef _CONVEX_COMBINATION_TERM_H_
#define _CONVEX_COMBINATION_TERM_H_
#include
"femTerm.h"
#include
"simpleFunction.h"
#include
"Gmsh.h"
#include
"GModel.h"
#include
"SElement.h"
#include
"fullMatrix.h"
class
convexCombinationTerm
:
public
femTerm
<
double
,
double
>
{
protected:
const
simpleFunction
<
double
>
*
_diffusivity
;
const
int
_iField
;
public:
convexCombinationTerm
(
GModel
*
gm
,
int
iField
,
simpleFunction
<
double
>
*
diffusivity
)
:
femTerm
<
double
,
double
>
(
gm
),
_iField
(
iField
),
_diffusivity
(
diffusivity
)
{}
virtual
int
sizeOfR
(
SElement
*
se
)
const
{
return
se
->
getMeshElement
()
->
getNumVertices
();
}
virtual
int
sizeOfC
(
SElement
*
se
)
const
{
return
se
->
getMeshElement
()
->
getNumVertices
();
}
void
getLocalDofR
(
SElement
*
se
,
int
iRow
)
const
{
return
Dof
(
se
->
getMeshElement
()
->
getVertex
(
iRow
)
->
getNum
(),
_iField
);
}
virtual
void
elementMatrix
(
SElement
*
e
,
fullMatrix
<
double
>
&
m
)
const
{
m
.
set_all
(
0.
);
int
nbNodes
=
e
->
getMeshElement
()
->
getNumVertices
();
//double x = 0.3*(e->getVertex(0)->x()+e->getVertex(1)->x()+e->getVertex(2)->x());
//double y = 0.3*(e->getVertex(0)->y()+e->getVertex(1)->y()+e->getVertex(2)->y());
//double z = 0.3*(e->getVertex(0)->z()+e->getVertex(1)->z()+e->getVertex(2)->z());
const
double
_diff
=
1.0
;
for
(
int
j
=
0
;
j
<
nbNodes
;
j
++
){
for
(
int
k
=
0
;
k
<
nbNodes
;
k
++
){
m
(
j
,
k
)
=
-
1.
*
_diff
;
}
m
(
j
,
j
)
=
(
nbNodes
-
1
)
*
_diff
;
}
}
};
#endif
This diff is collapsed.
Click to expand it.
Solver/crossConfTerm.h
0 → 100644
+
89
−
0
View file @
191b3832
// Gmsh - Copyright (C) 1997-2009 C. Geuzaine, J.-F. Remacle
//
// See the LICENSE.txt file for license information. Please report all
// bugs and problems to <gmsh@geuz.org>.
#ifndef _CROSS_CONF_TERM_H_
#define _CROSS_CONF_TERM_H_
#include
"femTerm.h"
#include
"simpleFunction.h"
#include
"Gmsh.h"
#include
"GModel.h"
#include
"SElement.h"
#include
"fullMatrix.h"
#include
"Numeric.h"
class
crossConfTerm
:
public
femTerm
<
double
,
double
>
{
protected:
const
simpleFunction
<
double
>
*
_diffusivity
;
const
int
_iFieldR
;
int
_iFieldC
;
public:
crossConfTerm
(
GModel
*
gm
,
int
iFieldR
,
int
iFieldC
,
simpleFunction
<
double
>
*
diffusivity
)
:
femTerm
<
double
,
double
>
(
gm
),
_iFieldR
(
iFieldR
),
_iFieldC
(
iFieldC
),
_diffusivity
(
diffusivity
)
{}
virtual
int
sizeOfR
(
SElement
*
se
)
const
{
return
se
->
getMeshElement
()
->
getNumVertices
();
}
virtual
int
sizeOfC
(
SElement
*
se
)
const
{
return
se
->
getMeshElement
()
->
getNumVertices
();
}
Dof
getLocalDofR
(
SElement
*
se
,
int
iRow
)
const
{
return
Dof
(
se
->
getMeshElement
()
->
getVertex
(
iRow
)
->
getNum
(),
_iFieldR
);
}
void
getLocalDofC
(
SElement
*
se
,
int
iRow
)
const
{
return
Dof
(
se
->
getMeshElement
()
->
getVertex
(
iRow
)
->
getNum
(),
_iFieldC
);
}
virtual
void
elementMatrix
(
SElement
*
e
,
fullMatrix
<
double
>
&
m
)
const
{
MElement
*
e
=
se
->
getMeshElement
();
int
nbNodes
=
e
->
getNumVertices
();
int
integrationOrder
=
2
*
(
e
->
getPolynomialOrder
()
-
1
);
int
npts
;
IntPt
*
GP
;
double
jac
[
3
][
3
];
double
invjac
[
3
][
3
];
SVector3
Grads
[
256
];
double
grads
[
256
][
3
];
e
->
getIntegrationPoints
(
integrationOrder
,
&
npts
,
&
GP
);
m
.
set_all
(
0.
);
for
(
int
i
=
0
;
i
<
npts
;
i
++
){
const
double
u
=
GP
[
i
].
pt
[
0
];
const
double
v
=
GP
[
i
].
pt
[
1
];
const
double
w
=
GP
[
i
].
pt
[
2
];
const
double
weight
=
GP
[
i
].
weight
;
const
double
detJ
=
e
->
getJacobian
(
u
,
v
,
w
,
jac
);
SPoint3
p
;
e
->
pnt
(
u
,
v
,
w
,
p
);
const
double
_diff
=
(
*
_diffusivity
)(
p
.
x
(),
p
.
y
(),
p
.
z
());
inv3x3
(
jac
,
invjac
);
e
->
getGradShapeFunctions
(
u
,
v
,
w
,
grads
);
for
(
int
j
=
0
;
j
<
nbNodes
;
j
++
){
Grads
[
j
]
=
SVector3
(
invjac
[
0
][
0
]
*
grads
[
j
][
0
]
+
invjac
[
0
][
1
]
*
grads
[
j
][
1
]
+
invjac
[
0
][
2
]
*
grads
[
j
][
2
],
invjac
[
1
][
0
]
*
grads
[
j
][
0
]
+
invjac
[
1
][
1
]
*
grads
[
j
][
1
]
+
invjac
[
1
][
2
]
*
grads
[
j
][
2
],
invjac
[
2
][
0
]
*
grads
[
j
][
0
]
+
invjac
[
2
][
1
]
*
grads
[
j
][
1
]
+
invjac
[
2
][
2
]
*
grads
[
j
][
2
]);
}
SVector3
N
(
jac
[
2
][
0
],
jac
[
2
][
1
],
jac
[
2
][
2
]);
for
(
int
j
=
0
;
j
<
nbNodes
;
j
++
){
for
(
int
k
=
0
;
k
<=
j
;
k
++
){
m
(
j
,
k
)
+=
dot
(
crossprod
(
Grads
[
j
],
Grads
[
k
]),
N
)
*
weight
*
detJ
*
_diff
;
}
}
}
for
(
int
j
=
0
;
j
<
nbNodes
;
j
++
)
for
(
int
k
=
0
;
k
<
j
;
k
++
)
m
(
k
,
j
)
=
-
1.
*
m
(
j
,
k
);
}
};
#endif
This diff is collapsed.
Click to expand it.
Solver/helmholtzTerm.h
+
2
−
2
View file @
191b3832
...
@@ -25,8 +25,8 @@ class helmoltzTerm : public femTerm<scalar, scalar> {
...
@@ -25,8 +25,8 @@ class helmoltzTerm : public femTerm<scalar, scalar> {
public:
public:
helmoltzTerm
(
GModel
*
gm
,
int
iFieldR
,
int
iFieldC
,
simpleFunction
<
scalar
>
*
k
,
helmoltzTerm
(
GModel
*
gm
,
int
iFieldR
,
int
iFieldC
,
simpleFunction
<
scalar
>
*
k
,
simpleFunction
<
scalar
>
*
a
)
simpleFunction
<
scalar
>
*
a
)
:
femTerm
<
scalar
,
scalar
>
(
gm
),
_
k
(
k
),
_a
(
a
),
_iField
R
(
iField
R
),
:
femTerm
<
scalar
,
scalar
>
(
gm
),
_
iFieldR
(
iFieldR
),
_iField
C
(
iField
C
),
_
iFieldC
(
iFieldC
)
{}
_
k
(
k
),
_a
(
a
)
{}
// one dof per vertex (nodal fem)
// one dof per vertex (nodal fem)
virtual
int
sizeOfR
(
SElement
*
se
)
const
virtual
int
sizeOfR
(
SElement
*
se
)
const
{
{
...
...
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