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
9c12ccd2
Commit
9c12ccd2
authored
14 years ago
by
Jonathan Lambrechts
Browse files
Options
Downloads
Patches
Plain Diff
spetialize xyz2uvw for p1Triangle
parent
221a5428
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Geo/MTriangle.cpp
+18
-37
18 additions, 37 deletions
Geo/MTriangle.cpp
Geo/MTriangle.h
+1
-1
1 addition, 1 deletion
Geo/MTriangle.h
with
19 additions
and
38 deletions
Geo/MTriangle.cpp
+
18
−
37
View file @
9c12ccd2
...
@@ -91,43 +91,24 @@ double MTriangle::gammaShapeMeasure()
...
@@ -91,43 +91,24 @@ double MTriangle::gammaShapeMeasure()
#endif
#endif
}
}
// void MTriangle::xyz2uvw(double xyz[3], double uvw[3]){
void
MTriangle
::
xyz2uvw
(
double
xyz
[
3
],
double
uvw
[
3
])
{
// double X[3] = {_v[0]->x(), _v[1]->x(), _v[2]->x()};
const
double
O
[
3
]
=
{
_v
[
0
]
->
x
(),
_v
[
0
]
->
y
(),
_v
[
0
]
->
z
()};
// double Y[3] = {_v[0]->y(), _v[1]->y(), _v[2]->y()};
const
double
d
[
3
]
=
{
xyz
[
0
]
-
O
[
0
],
xyz
[
1
]
-
O
[
1
],
xyz
[
2
]
-
O
[
2
]};
// double Z[3] = {_v[0]->z(), _v[1]->z(), _v[2]->z()};
const
double
d1
[
3
]
=
{
_v
[
1
]
->
x
()
-
O
[
0
],
_v
[
1
]
->
y
()
-
O
[
1
],
_v
[
1
]
->
z
()
-
O
[
2
]};
const
double
d2
[
3
]
=
{
_v
[
2
]
->
x
()
-
O
[
0
],
_v
[
2
]
->
y
()
-
O
[
1
],
_v
[
2
]
->
z
()
-
O
[
2
]};
// uvw[0] = uvw[1] = uvw[2] = 0.;
const
double
Jxy
=
d1
[
0
]
*
d2
[
1
]
-
d1
[
1
]
*
d2
[
0
];
const
double
Jxz
=
d1
[
0
]
*
d2
[
2
]
-
d1
[
2
]
*
d2
[
0
];
// double jac[3][3] = {{X[1]-X[0], X[2]-X[Ø], 0},{}, {}};
if
(
fabs
(
Jxy
)
>
fabs
(
Jxz
))
{
uvw
[
0
]
=
(
d
[
0
]
*
d2
[
1
]
-
d
[
1
]
*
d2
[
0
])
/
Jxy
;
uvw
[
1
]
=
(
d
[
1
]
*
d1
[
0
]
-
d
[
0
]
*
d1
[
1
])
/
Jxy
;
// if(!getJacobian(uvw[0], uvw[1], uvw[2], jac)) break;
}
else
{
// double xn = 0., yn = 0., zn = 0.;
uvw
[
0
]
=
(
d
[
0
]
*
d2
[
2
]
-
d
[
2
]
*
d2
[
0
])
/
Jxz
;
// double sf[1256];
uvw
[
1
]
=
(
d
[
2
]
*
d1
[
0
]
-
d
[
0
]
*
d1
[
2
])
/
Jxz
;
// getShapeFunctions(uvw[0], uvw[1], uvw[2], sf);
}
// for (int i = 0; i < getNumShapeFunctions(); i++) {
uvw
[
2
]
=
0.
;
// MVertex *v = getShapeFunctionNode(i);
}
// xn += v->x() * sf[i];
// yn += v->y() * sf[i];
// zn += v->z() * sf[i];
// }
// double inv[3][3];
// inv3x3(jac, inv);
// double un = uvw[0] + inv[0][0] * (xyz[0] - xn) +
// inv[1][0] * (xyz[1] - yn) + inv[2][0] * (xyz[2] - zn);
// double vn = uvw[1] + inv[0][1] * (xyz[0] - xn) +
// inv[1][1] * (xyz[1] - yn) + inv[2][1] * (xyz[2] - zn);
// double wn = uvw[2] + inv[0][2] * (xyz[0] - xn) +
// inv[1][2] * (xyz[1] - yn) + inv[2][2] * (xyz[2] - zn);
// uvw[0] = un;
// uvw[1] = vn;
// uvw[2] = wn;
//}
const
polynomialBasis
*
MTriangle
::
getFunctionSpace
(
int
o
)
const
const
polynomialBasis
*
MTriangle
::
getFunctionSpace
(
int
o
)
const
{
{
...
...
This diff is collapsed.
Click to expand it.
Geo/MTriangle.h
+
1
−
1
View file @
9c12ccd2
...
@@ -63,7 +63,7 @@ class MTriangle : public MElement {
...
@@ -63,7 +63,7 @@ class MTriangle : public MElement {
static
const
int
map
[
3
]
=
{
0
,
2
,
1
};
static
const
int
map
[
3
]
=
{
0
,
2
,
1
};
return
getVertex
(
map
[
num
]);
return
getVertex
(
map
[
num
]);
}
}
//
virtual void xyz2uvw(double xyz[3], double uvw[3]);
virtual
void
xyz2uvw
(
double
xyz
[
3
],
double
uvw
[
3
]);
virtual
MVertex
*
getOtherVertex
(
MVertex
*
v1
,
MVertex
*
v2
)
virtual
MVertex
*
getOtherVertex
(
MVertex
*
v1
,
MVertex
*
v2
)
{
{
if
(
_v
[
0
]
!=
v1
&&
_v
[
0
]
!=
v2
)
return
_v
[
0
];
if
(
_v
[
0
]
!=
v1
&&
_v
[
0
]
!=
v2
)
return
_v
[
0
];
...
...
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