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
8634efaf
Commit
8634efaf
authored
17 years ago
by
Jean-François Remacle
Browse files
Options
Downloads
Patches
Plain Diff
add curvature field
parent
61cfca04
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Mesh/Field.cpp
+43
-1
43 additions, 1 deletion
Mesh/Field.cpp
with
43 additions
and
1 deletion
Mesh/Field.cpp
+
43
−
1
View file @
8634efaf
// $Id: Field.cpp,v 1.3
2
2008-04-18
08:39
:4
9
remacle Exp $
// $Id: Field.cpp,v 1.3
3
2008-04-18
12:07
:4
6
remacle Exp $
//
//
// Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle
// Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle
//
//
...
@@ -582,6 +582,47 @@ public:
...
@@ -582,6 +582,47 @@ public:
return
dialogBox
;
return
dialogBox
;
}
}
};
};
class
CurvatureField
:
public
Field
{
int
iField
;
double
delta
;
public:
const
char
*
get_name
()
{
return
"Curvature"
;
}
CurvatureField
()
:
iField
(
0
),
delta
(
CTX
.
lc
/
1e4
)
{
options
[
"IField"
]
=
new
FieldOptionInt
(
iField
);
options
[
"Delta"
]
=
new
FieldOptionDouble
(
delta
);
}
void
grad_norm
(
Field
&
f
,
double
x
,
double
y
,
double
z
,
double
*
g
){
g
[
0
]
=
f
(
x
+
delta
/
2
,
y
,
z
)
-
f
(
x
-
delta
/
2
,
y
,
z
);
g
[
1
]
=
f
(
x
,
y
+
delta
/
2
,
z
)
-
f
(
x
,
y
-
delta
/
2
,
z
);
g
[
2
]
=
f
(
x
,
y
,
z
+
delta
/
2
)
-
f
(
x
,
y
,
z
-
delta
/
2
);
double
n
=
sqrt
(
g
[
0
]
*
g
[
0
]
+
g
[
1
]
*
g
[
1
]
+
g
[
2
]
*
g
[
2
]);
g
[
0
]
/=
n
;
g
[
1
]
/=
n
;
g
[
2
]
/=
n
;
}
double
operator
()
(
double
x
,
double
y
,
double
z
)
{
Field
*
field
=
GModel
::
current
()
->
getFields
()
->
get
(
iField
);
double
grad
[
6
][
3
];
grad_norm
(
*
field
,
x
+
delta
/
2
,
y
,
z
,
grad
[
0
]);
grad_norm
(
*
field
,
x
-
delta
/
2
,
y
,
z
,
grad
[
1
]);
grad_norm
(
*
field
,
x
,
y
+
delta
/
2
,
z
,
grad
[
2
]);
grad_norm
(
*
field
,
x
,
y
-
delta
/
2
,
z
,
grad
[
3
]);
grad_norm
(
*
field
,
x
,
y
,
z
+
delta
/
2
,
grad
[
4
]);
grad_norm
(
*
field
,
x
,
y
,
z
-
delta
/
2
,
grad
[
5
]);
return
(
grad
[
0
][
0
]
-
grad
[
1
][
0
]
+
grad
[
2
][
1
]
-
grad
[
3
][
1
]
+
grad
[
4
][
2
]
-
grad
[
5
][
2
])
/
delta
;
}
FieldDialogBox
*&
dialog_box
()
{
static
FieldDialogBox
*
dialogBox
=
NULL
;
return
dialogBox
;
}
};
class
LaplacianField
:
public
Field
class
LaplacianField
:
public
Field
{
{
int
iField
;
int
iField
;
...
@@ -1065,6 +1106,7 @@ FieldManager::FieldManager()
...
@@ -1065,6 +1106,7 @@ FieldManager::FieldManager()
map_type_name
[
"UTM"
]
=
new
FieldFactoryT
<
UTMField
>
();
map_type_name
[
"UTM"
]
=
new
FieldFactoryT
<
UTMField
>
();
map_type_name
[
"Laplacian"
]
=
new
FieldFactoryT
<
LaplacianField
>
();
map_type_name
[
"Laplacian"
]
=
new
FieldFactoryT
<
LaplacianField
>
();
map_type_name
[
"Mean"
]
=
new
FieldFactoryT
<
MeanField
>
();
map_type_name
[
"Mean"
]
=
new
FieldFactoryT
<
MeanField
>
();
map_type_name
[
"Curvature"
]
=
new
FieldFactoryT
<
CurvatureField
>
();
background_field
=
-
1
;
background_field
=
-
1
;
}
}
...
...
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