Commit 78695781 authored by Baptiste Durand's avatar Baptiste Durand

move _wrap_in_list to another toolbox

parent 962d73e5
......@@ -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):
......
......@@ -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.
......
# 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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment