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
0273db17
Commit
0273db17
authored
12 years ago
by
Philippe Delandmeter
Browse files
Options
Downloads
Patches
Plain Diff
dg : create new Fields with gmsh
parent
b811153d
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Mesh/Field.cpp
+2
-65
2 additions, 65 deletions
Mesh/Field.cpp
Mesh/Field.h
+5
-0
5 additions, 0 deletions
Mesh/Field.h
with
7 additions
and
65 deletions
Mesh/Field.cpp
+
2
−
65
View file @
0273db17
...
@@ -239,7 +239,7 @@ class StructuredField : public Field
...
@@ -239,7 +239,7 @@ class StructuredField : public Field
}
}
};
};
class
UTMField
:
public
Field
/*
class UTMField : public Field
{
{
int iField, zone;
int iField, zone;
double a, b, n, n2, n3, n4, n5, e, e2, e1, e12, e13, e14, J1, J2, J3, J4,
double a, b, n, n2, n3, n4, n5, e, e2, e1, e12, e13, e14, J1, J2, J3, J4,
...
@@ -325,7 +325,7 @@ class UTMField : public Field
...
@@ -325,7 +325,7 @@ class UTMField : public Field
if(!field || iField == id) return MAX_LC;
if(!field || iField == id) return MAX_LC;
return (*field)(utm_x, utm_y, 0);
return (*field)(utm_x, utm_y, 0);
}
}
};
};
*/
class
LonLatField
:
public
Field
class
LonLatField
:
public
Field
{
{
...
@@ -371,57 +371,6 @@ class LonLatField : public Field
...
@@ -371,57 +371,6 @@ class LonLatField : public Field
}
}
};
};
class
XY2d2LonLatField
:
public
Field
{
int
iField
;
double
R
,
phiP
,
thetaP
;
public:
std
::
string
getDescription
()
{
return
"Evaluate Field[IField] in geographic coordinates (longitude, latitude) from x and y projected on a plane
\n\n
"
;
}
XY2d2LonLatField
()
{
iField
=
1
;
options
[
"IField"
]
=
new
FieldOptionInt
(
iField
,
"Index of the field to evaluate."
);
R
=
6371e3
;
phiP
=
0
;
thetaP
=
0
;
options
[
"Radius"
]
=
new
FieldOptionDouble
(
R
,
"radius of the sphere"
);
options
[
"Phi"
]
=
new
FieldOptionDouble
(
phiP
,
"longitude of the projection point (in degrees)"
);
options
[
"Theta"
]
=
new
FieldOptionDouble
(
thetaP
,
"latitude of the projection point (in degrees)"
);
}
const
char
*
getName
()
{
return
"XY2d2LonLat"
;
}
double
operator
()
(
double
x2d
,
double
y2d
,
double
z2d
,
GEntity
*
ge
=
0
)
{
Field
*
field
=
GModel
::
current
()
->
getFields
()
->
get
(
iField
);
if
(
!
field
||
iField
==
id
)
return
MAX_LC
;
double
phi
=
phiP
*
M_PI
/
180
;
double
theta
=
thetaP
*
M_PI
/
180
;
double
pOx
=
cos
(
theta
)
*
cos
(
phi
)
*
R
;
double
pOy
=
cos
(
theta
)
*
sin
(
phi
)
*
R
;
double
pOz
=
sin
(
theta
)
*
R
;
double
pPhiX
=
-
sin
(
phi
);
double
pPhiY
=
cos
(
phi
);
double
pPhiZ
=
0
;
double
pThetaX
=
-
sin
(
theta
)
*
cos
(
phi
);
double
pThetaY
=
-
sin
(
theta
)
*
sin
(
phi
);
double
pThetaZ
=
cos
(
theta
);
double
x
=
pPhiX
*
x2d
+
pThetaX
*
y2d
+
pOx
;
double
y
=
pPhiY
*
x2d
+
pThetaY
*
y2d
+
pOy
;
double
z
=
pPhiZ
*
x2d
+
pThetaZ
*
y2d
+
pOz
;
return
(
*
field
)(
atan2
(
y
,
x
),
asin
(
z
/
R
),
0
);
}
};
class
BoxField
:
public
Field
class
BoxField
:
public
Field
{
{
...
@@ -2092,16 +2041,6 @@ void BoundaryLayerField::operator() (double x, double y, double z,
...
@@ -2092,16 +2041,6 @@ void BoundaryLayerField::operator() (double x, double y, double z,
}
}
#endif
#endif
template
<
class
F
>
class
FieldFactoryT
:
public
FieldFactory
{
public:
Field
*
operator
()()
{
return
new
F
;
}
};
template
<
class
F
>
Field
*
field_factory
()
{
return
new
F
();
};
FieldManager
::
FieldManager
()
FieldManager
::
FieldManager
()
{
{
map_type_name
[
"Structured"
]
=
new
FieldFactoryT
<
StructuredField
>
();
map_type_name
[
"Structured"
]
=
new
FieldFactoryT
<
StructuredField
>
();
...
@@ -2114,7 +2053,6 @@ FieldManager::FieldManager()
...
@@ -2114,7 +2053,6 @@ FieldManager::FieldManager()
map_type_name
[
"Cylinder"
]
=
new
FieldFactoryT
<
CylinderField
>
();
map_type_name
[
"Cylinder"
]
=
new
FieldFactoryT
<
CylinderField
>
();
map_type_name
[
"Frustum"
]
=
new
FieldFactoryT
<
FrustumField
>
();
map_type_name
[
"Frustum"
]
=
new
FieldFactoryT
<
FrustumField
>
();
map_type_name
[
"LonLat"
]
=
new
FieldFactoryT
<
LonLatField
>
();
map_type_name
[
"LonLat"
]
=
new
FieldFactoryT
<
LonLatField
>
();
map_type_name
[
"XY2d2LonLat"
]
=
new
FieldFactoryT
<
XY2d2LonLatField
>
();
#if defined(HAVE_POST)
#if defined(HAVE_POST)
map_type_name
[
"PostView"
]
=
new
FieldFactoryT
<
PostViewField
>
();
map_type_name
[
"PostView"
]
=
new
FieldFactoryT
<
PostViewField
>
();
#endif
#endif
...
@@ -2123,7 +2061,6 @@ FieldManager::FieldManager()
...
@@ -2123,7 +2061,6 @@ FieldManager::FieldManager()
map_type_name
[
"Min"
]
=
new
FieldFactoryT
<
MinField
>
();
map_type_name
[
"Min"
]
=
new
FieldFactoryT
<
MinField
>
();
map_type_name
[
"MinAniso"
]
=
new
FieldFactoryT
<
MinAnisoField
>
();
map_type_name
[
"MinAniso"
]
=
new
FieldFactoryT
<
MinAnisoField
>
();
map_type_name
[
"Max"
]
=
new
FieldFactoryT
<
MaxField
>
();
map_type_name
[
"Max"
]
=
new
FieldFactoryT
<
MaxField
>
();
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
>
();
map_type_name
[
"Curvature"
]
=
new
FieldFactoryT
<
CurvatureField
>
();
...
...
This diff is collapsed.
Click to expand it.
Mesh/Field.h
+
5
−
0
View file @
0273db17
...
@@ -278,4 +278,9 @@ class FieldCallbackGeneric : public FieldCallback {
...
@@ -278,4 +278,9 @@ class FieldCallbackGeneric : public FieldCallback {
}
}
};
};
template
<
class
F
>
class
FieldFactoryT
:
public
FieldFactory
{
public:
Field
*
operator
()()
{
return
new
F
;
}
};
#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