Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F91113782
manifold_supersphere.h
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, Nov 8, 01:29
Size
1 KB
Mime Type
text/x-c
Expires
Sun, Nov 10, 01:29 (2 d)
Engine
blob
Format
Raw Data
Handle
22199163
Attached To
rLAMMPS lammps
manifold_supersphere.h
View Options
#ifndef LMP_MANIFOLD_SUPERSPHERE_H
#define LMP_MANIFOLD_SUPERSPHERE_H
#include "manifold.h"
namespace
LAMMPS_NS
{
namespace
user_manifold
{
// A sphere:
class
manifold_supersphere
:
public
manifold
{
public:
enum
{
NPARAMS
=
2
};
manifold_supersphere
(
LAMMPS
*
lmp
,
int
,
char
**
)
:
manifold
(
lmp
){}
virtual
~
manifold_supersphere
(){}
double
my_sign
(
double
a
)
{
return
(
a
>
0
)
-
(
a
<
0
);
}
virtual
double
g
(
const
double
*
x
)
{
double
R
=
params
[
0
];
double
q
=
params
[
1
];
double
xx
=
fabs
(
x
[
0
]);
double
yy
=
fabs
(
x
[
1
]);
double
zz
=
fabs
(
x
[
2
]);
double
rr
=
pow
(
xx
,
q
)
+
pow
(
yy
,
q
)
+
pow
(
zz
,
q
);
return
rr
-
pow
(
R
,
q
);
}
virtual
void
n
(
const
double
*
x
,
double
*
nn
)
{
double
q
=
params
[
1
];
double
xx
=
fabs
(
x
[
0
]);
double
yy
=
fabs
(
x
[
1
]);
double
zz
=
fabs
(
x
[
2
]);
nn
[
0
]
=
q
*
my_sign
(
x
[
0
])
*
pow
(
xx
,
q
-
1
);
nn
[
1
]
=
q
*
my_sign
(
x
[
1
])
*
pow
(
yy
,
q
-
1
);
nn
[
2
]
=
q
*
my_sign
(
x
[
2
])
*
pow
(
zz
,
q
-
1
);
}
static
const
char
*
type
(){
return
"supersphere"
;
}
virtual
const
char
*
id
(){
return
type
();
}
static
int
expected_argc
(){
return
NPARAMS
;
}
virtual
int
nparams
(){
return
NPARAMS
;
}
};
}
}
#endif
Event Timeline
Log In to Comment