Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
HO_homog
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
14
Issues
14
List
Boards
Labels
Service Desk
Milestones
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Baptiste Durand
HO_homog
Commits
78695781
Commit
78695781
authored
Feb 19, 2021
by
Baptiste Durand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move _wrap_in_list to another toolbox
parent
962d73e5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
22 deletions
+33
-22
ho_homog/geometry/surfaces.py
ho_homog/geometry/surfaces.py
+1
-1
ho_homog/toolbox_FEniCS.py
ho_homog/toolbox_FEniCS.py
+0
-21
ho_homog/toolbox_misc.py
ho_homog/toolbox_misc.py
+32
-0
No files found.
ho_homog/geometry/surfaces.py
View file @
78695781
...
...
@@ -13,7 +13,7 @@ and instantiate them in a gmsh model.
from
.
import
factory
,
np
,
logger
,
model
from
.tools
import
round_corner
,
offset
from
.curves
import
Line
,
AbstractCurve
from
..toolbox_
FEniCS
import
_wrap_in_list
from
..toolbox_
misc
import
_wrap_in_list
def
round_corner_2_sides
(
result_list
):
...
...
ho_homog/toolbox_FEniCS.py
View file @
78695781
...
...
@@ -244,27 +244,6 @@ def local_project(v, fspace, solver_method: str = "", **kwargs):
return
u
def
_wrap_in_list
(
obj
,
name
,
types
=
type
):
"""
Transform single object or a collection of objects into a list.
Source
------
python/dolfin/fem/assembling.py, commit 4c72333
"""
if
obj
is
None
:
lst
=
[]
elif
hasattr
(
obj
,
"__iter__"
):
lst
=
list
(
obj
)
else
:
lst
=
[
obj
]
for
obj
in
lst
:
if
not
isinstance
(
obj
,
types
):
raise
TypeError
(
f
"expected a (list of)
{
types
}
as
{
name
}
argument"
)
return
lst
def
xdmf_mesh
(
mesh_file
):
"""Create a FeniCS mesh from a mesh file with xdmf format.
...
...
ho_homog/toolbox_misc.py
0 → 100644
View file @
78695781
# coding: utf-8
"""
Created on 19/02/2021
@author: Baptiste Durand, baptiste.durand@enpc.fr
Collection of miscellaneous tools used in HO_homog.
"""
import
logging
logger
=
logging
.
getLogger
(
__name__
)
def
_wrap_in_list
(
obj
,
name
,
types
=
type
):
"""
Transform single object or a collection of objects into a list.
Source
------
python/dolfin/fem/assembling.py, commit 4c72333
"""
if
obj
is
None
:
lst
=
[]
elif
hasattr
(
obj
,
"__iter__"
):
lst
=
list
(
obj
)
else
:
lst
=
[
obj
]
for
obj
in
lst
:
if
not
isinstance
(
obj
,
types
):
raise
TypeError
(
f
"expected a (list of)
{
types
}
as
{
name
}
argument"
)
return
lst
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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