Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
mantid
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mantidproject
mantid
Commits
d07b830c
Commit
d07b830c
authored
8 years ago
by
Savici, Andrei T.
Browse files
Options
Downloads
Patches
Plain Diff
Re #17068. Allow negative determinant for UB
parent
56d8eef4
Loading
Loading
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Framework/Geometry/inc/MantidGeometry/Crystal/OrientedLattice.h
+1
-1
1 addition, 1 deletion
...ork/Geometry/inc/MantidGeometry/Crystal/OrientedLattice.h
Framework/Geometry/src/Crystal/OrientedLattice.cpp
+3
-2
3 additions, 2 deletions
Framework/Geometry/src/Crystal/OrientedLattice.cpp
with
4 additions
and
3 deletions
Framework/Geometry/inc/MantidGeometry/Crystal/OrientedLattice.h
+
1
−
1
View file @
d07b830c
...
...
@@ -56,7 +56,7 @@ public:
// Access private variables
const
Kernel
::
DblMatrix
&
getU
()
const
;
const
Kernel
::
DblMatrix
&
getUB
()
const
;
void
setU
(
const
Kernel
::
DblMatrix
&
newU
,
const
bool
force
=
fals
e
);
void
setU
(
const
Kernel
::
DblMatrix
&
newU
,
const
bool
force
=
tru
e
);
void
setUB
(
const
Kernel
::
DblMatrix
&
newUB
);
// get u and v vectors for Horace/Mslice
Kernel
::
V3D
getuVector
()
const
;
...
...
This diff is collapsed.
Click to expand it.
Framework/Geometry/src/Crystal/OrientedLattice.cpp
+
3
−
2
View file @
d07b830c
...
...
@@ -104,7 +104,8 @@ void OrientedLattice::setU(const DblMatrix &newU, const bool force) {
/** Sets the UB matrix and recalculates lattice parameters
@param newUB :: the new UB matrix*/
void
OrientedLattice
::
setUB
(
const
DblMatrix
&
newUB
)
{
if
(
UB
.
determinant
()
>
0
)
{
//check if determinant is close to 0. The 1e-10 value is arbitrary
if
(
std
::
fabs
(
newUB
.
determinant
())
>
1e-10
)
{
UB
=
newUB
;
DblMatrix
newGstar
,
B
;
newGstar
=
newUB
.
Tprime
()
*
newUB
;
...
...
@@ -113,7 +114,7 @@ void OrientedLattice::setUB(const DblMatrix &newUB) {
B
.
Invert
();
U
=
newUB
*
B
;
}
else
throw
std
::
invalid_argument
(
"determinant of UB is
not greater than
0"
);
throw
std
::
invalid_argument
(
"determinant of UB is
too close to
0"
);
}
/** Calculate the hkl corresponding to a given Q-vector
...
...
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