Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Pries, Jason
Oersted
Commits
f944cea3
Commit
f944cea3
authored
Feb 02, 2018
by
p7k
Browse files
Default to use $HOME for saving files
parent
4cbceb52
Changes
16
Hide whitespace changes
Inline
Side-by-side
src/Mesh/src/Mesh.cpp
View file @
f944cea3
...
...
@@ -938,6 +938,10 @@ void Mesh::save_as(std::string path, std::string file_name) const {
This is a stub for visualization
*/
std
::
string
home
(
std
::
getenv
(
"HOME"
));
path
=
home
+
path
;
if
(
!
std
::
experimental
::
filesystem
::
exists
(
path
))
{
std
::
experimental
::
filesystem
::
create_directories
(
path
);
}
...
...
src/Optimization/src/Swarm.cpp
View file @
f944cea3
...
...
@@ -46,6 +46,9 @@ void Swarm::run() {
}
void
Swarm
::
set_output_file
(
std
::
string
path
,
std
::
string
file_name
)
{
std
::
string
home
(
std
::
getenv
(
"HOME"
));
path
=
home
+
path
;
if
(
!
std
::
experimental
::
filesystem
::
exists
(
path
))
{
std
::
experimental
::
filesystem
::
create_directories
(
path
);
}
...
...
src/Physics/src/FiniteElementMesh.cpp
View file @
f944cea3
...
...
@@ -272,6 +272,9 @@ std::vector<std::shared_ptr<DiscreteBoundary>> FiniteElementMesh<P, Q>::make_dis
template
<
size_t
P
,
size_t
Q
>
void
FiniteElementMesh
<
P
,
Q
>::
write_scalar
(
Oe
::
VectorXd
const
&
v
,
std
::
string
path
,
std
::
string
file_name
)
const
{
std
::
string
home
(
std
::
getenv
(
"HOME"
));
path
=
home
+
path
;
if
(
!
std
::
experimental
::
filesystem
::
exists
(
path
))
{
std
::
experimental
::
filesystem
::
create_directories
(
path
);
}
...
...
@@ -315,6 +318,9 @@ void FiniteElementMesh<P, Q>::write_scalar(Oe::VectorXd const &v, std::string pa
template
<
size_t
P
,
size_t
Q
>
void
FiniteElementMesh
<
P
,
Q
>::
write_vector
(
Oe
::
ArrayXd
const
&
Fx
,
Oe
::
ArrayXd
const
&
Fy
,
std
::
string
path
,
std
::
string
file_name
)
const
{
std
::
string
home
(
std
::
getenv
(
"HOME"
));
path
=
home
+
path
;
if
(
!
std
::
experimental
::
filesystem
::
exists
(
path
))
{
std
::
experimental
::
filesystem
::
create_directories
(
path
);
}
...
...
src/Sketch/src/CylindricalAirgap.h
View file @
f944cea3
...
...
@@ -62,7 +62,7 @@ protected:
double_t
ai
=
vc
->
atan
(
vi0
);
double_t
ao
=
vc
->
atan
(
vo0
);
if
(
abs
(
ai
-
ao
)
>
FLT_EPSILON
*
M_PI
)
{
// TODO: Check for branch cut discontinuity due to numerical errors
if
(
std
::
abs
(
ai
-
ao
)
>
FLT_EPSILON
*
M_PI
)
{
// TODO: Check for branch cut discontinuity due to numerical errors
std
::
cerr
<<
"Periodic boundaries should be aligned when creating airgap. Airgap will not be created"
<<
std
::
endl
;
return
;
}
...
...
src/Sketch/src/Sketch.cpp
View file @
f944cea3
...
...
@@ -189,6 +189,9 @@ void Sketch::save_as<SaveMethod::Rasterize>(std::string path, std::string file_n
This is a stub for visualization
*/
std
::
string
home
(
std
::
getenv
(
"HOME"
));
path
=
home
+
path
;
if
(
!
std
::
experimental
::
filesystem
::
exists
(
path
))
{
std
::
experimental
::
filesystem
::
create_directories
(
path
);
}
...
...
test/LibraryIntegration/Mesh_To_FEM_Test.cpp
View file @
f944cea3
#include
"Library_Integration_Test.hpp"
std
::
str
in
g
SAVE_DIR
=
".
/test/output/Integration/"
;
#def
in
e
SAVE_DIR
"/Oersted
/test/output/Integration/"
TEST
(
Full_Circle
,
Magnetostatic_Uniform_Current_Density
)
{
// Create Sketch
...
...
test/LibraryIntegration/test_Annuli.cpp
View file @
f944cea3
...
...
@@ -67,7 +67,7 @@ public:
me
.
save_as
(
SAVE_DIR
,
std
::
string
(
"mesh"
));
}
std
::
string
SAVE_DIR
=
"
./test
/output/Integration/test_Annuli/"
;
std
::
string
SAVE_DIR
=
"
/Oersted
/output/Integration/test_Annuli/"
;
std
::
vector
<
std
::
shared_ptr
<
Curve
>>
inner_boundaries
;
std
::
vector
<
std
::
shared_ptr
<
Curve
>>
outer_boundaries
;
...
...
test/LibraryIntegration/test_Circle.cpp
View file @
f944cea3
...
...
@@ -45,7 +45,7 @@ public:
circle_contour
=
me
.
select_contour
(
Point
{
0.0
,
0.0
});
}
std
::
string
SAVE_DIR
=
"
./test
/output/Integration/test_Circle/"
;
std
::
string
SAVE_DIR
=
"
/Oersted
/output/Integration/test_Circle/"
;
std
::
vector
<
std
::
shared_ptr
<
Curve
>>
boundaries
;
...
...
test/LibraryIntegration/test_HalfAnnuli.cpp
View file @
f944cea3
...
...
@@ -67,7 +67,7 @@ public:
me
.
save_as
(
SAVE_DIR
,
std
::
string
(
"mesh"
));
}
std
::
string
SAVE_DIR
=
"
./test
/output/Integration/test_HalfAnnuli/"
;
std
::
string
SAVE_DIR
=
"
/Oersted
/output/Integration/test_HalfAnnuli/"
;
std
::
shared_ptr
<
Vertex
>
origin
;
...
...
test/LibraryIntegration/test_Square.cpp
View file @
f944cea3
...
...
@@ -45,7 +45,7 @@ public:
square_contour
=
me
.
select_contour
(
Point
{
0.5
,
0.5
});
}
std
::
string
SAVE_DIR
=
"
.
/test/output/Integration/test_Square/"
;
std
::
string
SAVE_DIR
=
"
/Oersted
/test/output/Integration/test_Square/"
;
std
::
vector
<
std
::
shared_ptr
<
Curve
>>
boundaries
;
...
...
test/Mesh/Mesh_Test.hpp
View file @
f944cea3
...
...
@@ -5,7 +5,7 @@
#include
"Mesh.hpp"
#include
"Mest_Test_Utility.h"
#define SAVE_DIR "
.
/test/output/Mesh/"
#define SAVE_DIR "/test/output/Mesh/"
#define TOL 4e-8
#endif //OERSTED_TEST_MESH_HPP
test/Model Templates/test_ModelTemplates.hpp
View file @
f944cea3
...
...
@@ -12,6 +12,6 @@
#include
<random>
#define SAVE_DIR "
.
/test/output/Model Templates/"
#define SAVE_DIR "
/Oersted
/test/output/Model Templates/"
#endif //OERSTED_TEST_MODELTEMPLATES_HPP
\ No newline at end of file
test/Optimization/test_Optimization.hpp
View file @
f944cea3
...
...
@@ -4,6 +4,6 @@
#include
"Optimization.hpp"
#include
"gtest.h"
#define SAVE_DIR "
.
/test/output/Optimization/"
#define SAVE_DIR "
/Oersted
/test/output/Optimization/"
#endif //OERSTED_TEST_OPTIMIZATION_HPP
test/Physics/test_Physics.hpp
View file @
f944cea3
...
...
@@ -7,6 +7,6 @@
#include
"Physics.hpp"
#define SAVE_DIR "
.
/test/output/Physics/"
#define SAVE_DIR "
/Oersted
/test/output/Physics/"
#endif //OERSTED_TEST_PHYSICS_HPP
test/Sketch/test_Sketch.hpp
View file @
f944cea3
...
...
@@ -8,7 +8,7 @@
#include
"gtest.h"
#define TOL FLT_EPSILON // TODO: Tolerance is limited by accuracy of tangency constraint
#define SAVE_DIR "
.
/test/output/Sketch/"
#define SAVE_DIR "
/Oersted
/test/output/Sketch/"
void
test_sketch_size
(
Sketch
&
s
,
size_t
nverts
,
size_t
ncurves
,
size_t
nconstraints
,
size_t
ncontours
);
...
...
test/UseCases/Use_Cases.hpp
View file @
f944cea3
...
...
@@ -6,7 +6,7 @@
#include
"gtest.h"
#include
"../Mesh/Mest_Test_Utility.h"
#define SDIR "
.
/test/output/UseCases/sketch/"
#define MDIR "
.
/test/output/UseCases/mesh/"
#define SDIR "
/Oersted
/test/output/UseCases/sketch/"
#define MDIR "
/Oersted
/test/output/UseCases/mesh/"
#endif //OERSTED_TEST_USECASES_HPP
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment