diff --git a/.gitignore b/.gitignore index a0fc011..3e6669a 100644 --- a/.gitignore +++ b/.gitignore @@ -26,3 +26,5 @@ localConfig.cmake *.pyc *.pyo python/**/*.cpp +!python/doc +python/doc/_build diff --git a/python/doc/conf.py b/python/doc/conf.py new file mode 100644 index 0000000..455d910 --- /dev/null +++ b/python/doc/conf.py @@ -0,0 +1,296 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# +# openEMS documentation build configuration file, created by +# sphinx-quickstart on Thu Sep 8 20:42:18 2016. +# +# This file is execfile()d with the current directory set to its +# containing dir. +# +# Note that not all possible configuration values are present in this +# autogenerated file. +# +# All configuration values have a default; values that are commented out +# serve to show the default. + +import sys +import os +import sphinx_rtd_theme + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +#sys.path.insert(0, os.path.abspath('.')) + +# -- General configuration ------------------------------------------------ + +# If your documentation needs a minimal Sphinx version, state it here. +#needs_sphinx = '1.0' + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = [ + 'sphinx.ext.autodoc', + 'sphinx.ext.intersphinx', + 'sphinx.ext.todo', + 'sphinx.ext.mathjax', + 'numpydoc', + 'sphinx.ext.autosummary', +] + +# Add any paths that contain templates here, relative to this directory. +templates_path = ['_templates'] + +# The suffix(es) of source filenames. +# You can specify multiple suffix as a list of string: +# source_suffix = ['.rst', '.md'] +source_suffix = '.rst' + +# The encoding of source files. +#source_encoding = 'utf-8-sig' + +# The master toctree document. +master_doc = 'index' + +# General information about the project. +project = 'openEMS' +copyright = '2016, Thorsten Liebig' +author = 'Thorsten Liebig' + +# The version info for the project you're documenting, acts as replacement for +# |version| and |release|, also used in various other places throughout the +# built documents. +# +# The short X.Y version. +version = '0.0.34' +# The full version, including alpha/beta/rc tags. +release = '0.0.34' + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +# +# This is also used if you do content translation via gettext catalogs. +# Usually you set "language" from the command line for these cases. +language = None + +# There are two options for replacing |today|: either, you set today to some +# non-false value, then it is used: +#today = '' +# Else, today_fmt is used as the format for a strftime call. +#today_fmt = '%B %d, %Y' + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +exclude_patterns = ['_build'] + +# The reST default role (used for this markup: `text`) to use for all +# documents. +#default_role = None + +# If true, '()' will be appended to :func: etc. cross-reference text. +#add_function_parentheses = True + +# If true, the current module name will be prepended to all description +# unit titles (such as .. function::). +#add_module_names = True + +# If true, sectionauthor and moduleauthor directives will be shown in the +# output. They are ignored by default. +#show_authors = False + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = 'sphinx' + +# A list of ignored prefixes for module index sorting. +#modindex_common_prefix = [] + +# If true, keep warnings as "system message" paragraphs in the built documents. +#keep_warnings = False + +# If true, `todo` and `todoList` produce output, else they produce nothing. +todo_include_todos = True + + +# -- Options for HTML output ---------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +html_theme = 'sphinx_rtd_theme' + +# Theme options are theme-specific and customize the look and feel of a theme +# further. For a list of options available for each theme, see the +# documentation. +#html_theme_options = {} + +# Add any paths that contain custom themes here, relative to this directory. +#html_theme_path = [] + +# The name for this set of Sphinx documents. If None, it defaults to +# " v documentation". +#html_title = None + +# A shorter title for the navigation bar. Default is the same as html_title. +#html_short_title = None + +# The name of an image file (relative to this directory) to place at the top +# of the sidebar. +#html_logo = None + +# The name of an image file (relative to this directory) to use as a favicon of +# the docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 +# pixels large. +#html_favicon = None + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ['_static'] + +# Add any extra paths that contain custom files (such as robots.txt or +# .htaccess) here, relative to this directory. These files are copied +# directly to the root of the documentation. +#html_extra_path = [] + +# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, +# using the given strftime format. +#html_last_updated_fmt = '%b %d, %Y' + +# If true, SmartyPants will be used to convert quotes and dashes to +# typographically correct entities. +#html_use_smartypants = True + +# Custom sidebar templates, maps document names to template names. +#html_sidebars = {} + +# Additional templates that should be rendered to pages, maps page names to +# template names. +#html_additional_pages = {} + +# If false, no module index is generated. +#html_domain_indices = True + +# If false, no index is generated. +#html_use_index = True + +# If true, the index is split into individual pages for each letter. +#html_split_index = False + +# If true, links to the reST sources are added to the pages. +#html_show_sourcelink = True + +# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. +#html_show_sphinx = True + +# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. +#html_show_copyright = True + +# If true, an OpenSearch description file will be output, and all pages will +# contain a tag referring to it. The value of this option must be the +# base URL from which the finished HTML is served. +#html_use_opensearch = '' + +# This is the file name suffix for HTML files (e.g. ".xhtml"). +#html_file_suffix = None + +# Language to be used for generating the HTML full-text search index. +# Sphinx supports the following languages: +# 'da', 'de', 'en', 'es', 'fi', 'fr', 'h', 'it', 'ja' +# 'nl', 'no', 'pt', 'ro', 'r', 'sv', 'tr' +#html_search_language = 'en' + +# A dictionary with options for the search language support, empty by default. +# Now only 'ja' uses this config value +#html_search_options = {'type': 'default'} + +# The name of a javascript file (relative to the configuration directory) that +# implements a search results scorer. If empty, the default will be used. +#html_search_scorer = 'scorer.js' + +# Output file base name for HTML help builder. +htmlhelp_basename = 'openEMSdoc' + +# -- Options for LaTeX output --------------------------------------------- + +latex_elements = { +# The paper size ('letterpaper' or 'a4paper'). +#'papersize': 'letterpaper', + +# The font size ('10pt', '11pt' or '12pt'). +#'pointsize': '10pt', + +# Additional stuff for the LaTeX preamble. +#'preamble': '', + +# Latex figure (float) alignment +#'figure_align': 'htbp', +} + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, +# author, documentclass [howto, manual, or own class]). +latex_documents = [ + (master_doc, 'openEMS.tex', 'openEMS Documentation', + 'Thorsten Liebig', 'manual'), +] + +# The name of an image file (relative to this directory) to place at the top of +# the title page. +#latex_logo = None + +# For "manual" documents, if this is true, then toplevel headings are parts, +# not chapters. +#latex_use_parts = False + +# If true, show page references after internal links. +#latex_show_pagerefs = False + +# If true, show URL addresses after external links. +#latex_show_urls = False + +# Documents to append as an appendix to all manuals. +#latex_appendices = [] + +# If false, no module index is generated. +#latex_domain_indices = True + + +# -- Options for manual page output --------------------------------------- + +# One entry per manual page. List of tuples +# (source start file, name, description, authors, manual section). +man_pages = [ + (master_doc, 'openems', 'openEMS Documentation', + [author], 1) +] + +# If true, show URL addresses after external links. +#man_show_urls = False + + +# -- Options for Texinfo output ------------------------------------------- + +# Grouping the document tree into Texinfo files. List of tuples +# (source start file, target name, title, author, +# dir menu entry, description, category) +texinfo_documents = [ + (master_doc, 'openEMS', 'openEMS Documentation', + author, 'openEMS', 'One line description of project.', + 'Miscellaneous'), +] + +# Documents to append as an appendix to all manuals. +#texinfo_appendices = [] + +# If false, no module index is generated. +#texinfo_domain_indices = True + +# How to display URL addresses: 'footnote', 'no', or 'inline'. +#texinfo_show_urls = 'footnote' + +# If true, do not generate a @detailmenu in the "Top" node's menu. +#texinfo_no_detailmenu = False + + +# Example configuration for intersphinx: refer to the Python standard library. +intersphinx_mapping = {'CSXCAD': ('http://openems.de/doc/CSXCAD/', None)} diff --git a/python/doc/index.rst b/python/doc/index.rst new file mode 100644 index 0000000..13aa7aa --- /dev/null +++ b/python/doc/index.rst @@ -0,0 +1,22 @@ +.. openEMS documentation master file, created by + sphinx-quickstart on Thu Sep 8 20:42:18 2016. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +Welcome to openEMS's documentation! +=================================== + +Contents: + +.. toctree:: + :maxdepth: 4 + + openEMS + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` + diff --git a/python/doc/openEMS.rst b/python/doc/openEMS.rst new file mode 100644 index 0000000..1754eee --- /dev/null +++ b/python/doc/openEMS.rst @@ -0,0 +1,59 @@ +openEMS Python Interface +======================== + +openEMS +------- + +.. automodule:: openEMS.openEMS + :members: openEMS + :undoc-members: + +Ports +----- + +.. automodule:: openEMS.ports + + Port (Base Class) + ----------------- + .. autoclass:: Port + :members: + :show-inheritance: + + Lumped Port + ----------- + .. autoclass:: LumpedPort + :members: + :show-inheritance: + + MSL Port + -------- + .. autoclass:: MSLPort + :members: + :show-inheritance: + + Waveguide Port + -------------- + .. autoclass:: WaveguidePort + :members: + :show-inheritance: + + Rect Waveguide Port + ------------------- + .. autoclass:: RectWGPort + :members: + :show-inheritance: + +NF2FF +----- + +.. automodule:: openEMS.nf2ff + + NF2FF + ----- + .. autoclass:: nf2ff + :members: + + NF2FF Results + ----------------- + .. autoclass:: nf2ff_results + :members: diff --git a/python/openEMS/_nf2ff.pxd b/python/openEMS/_nf2ff.pxd index bb00c34..7e1b764 100644 --- a/python/openEMS/_nf2ff.pxd +++ b/python/openEMS/_nf2ff.pxd @@ -1,9 +1,20 @@ # -*- coding: utf-8 -*- -""" -Created on Sun Dec 20 22:43:35 2015 - -@author: thorsten -""" +# +# Copyright (C) 2015,20016 Thorsten Liebig (Thorsten.Liebig@gmx.de) +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# from libcpp.string cimport string from libcpp.vector cimport vector diff --git a/python/openEMS/_nf2ff.pyx b/python/openEMS/_nf2ff.pyx index 8fc5b09..6d47e8e 100644 --- a/python/openEMS/_nf2ff.pyx +++ b/python/openEMS/_nf2ff.pyx @@ -1,9 +1,20 @@ # -*- coding: utf-8 -*- -""" -Created on Sun Dec 20 22:42:19 2015 - -@author: thorsten -""" +# +# Copyright (C) 2015,20016 Thorsten Liebig (Thorsten.Liebig@gmx.de) +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# cimport _nf2ff import numpy as np diff --git a/python/openEMS/nf2ff.py b/python/openEMS/nf2ff.py index 6f29cef..6b428d4 100644 --- a/python/openEMS/nf2ff.py +++ b/python/openEMS/nf2ff.py @@ -1,9 +1,20 @@ # -*- coding: utf-8 -*- -""" -Created on Sun Dec 20 20:53:12 2015 - -@author: thorsten -""" +# +# Copyright (C) 2015,20016 Thorsten Liebig (Thorsten.Liebig@gmx.de) +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# import os import numpy as np diff --git a/python/openEMS/openEMS.pxd b/python/openEMS/openEMS.pxd index f47da82..15ea06d 100644 --- a/python/openEMS/openEMS.pxd +++ b/python/openEMS/openEMS.pxd @@ -1,9 +1,20 @@ # -*- coding: utf-8 -*- -""" -Created on Mon Dec 14 00:12:43 2015 - -@author: thorsten -""" +# +# Copyright (C) 2015,20016 Thorsten Liebig (Thorsten.Liebig@gmx.de) +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# from libcpp.string cimport string from libcpp cimport bool @@ -46,4 +57,4 @@ cdef extern from "openEMS/openems.h": cdef class openEMS: cdef _openEMS *thisptr - cdef readonly ContinuousStructure CSX # hold a C++ instance which we're wrapping + cdef readonly ContinuousStructure __CSX # hold a C++ instance which we're wrapping diff --git a/python/openEMS/openEMS.pyx b/python/openEMS/openEMS.pyx index 0db54a9..24d3981 100644 --- a/python/openEMS/openEMS.pyx +++ b/python/openEMS/openEMS.pyx @@ -1,9 +1,20 @@ # -*- coding: utf-8 -*- -""" -Created on Sun Dec 13 23:50:24 2015 - -@author: thorsten -""" +# +# Copyright (C) 2015,20016 Thorsten Liebig (Thorsten.Liebig@gmx.de) +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# import os, sys, shutil import numpy as np @@ -26,11 +37,14 @@ cdef class openEMS: """ @staticmethod def WelcomeScreen(): + """ + Show the openEMS welcome screen. + """ _openEMS.WelcomeScreen() def __cinit__(self, *args, **kw): self.thisptr = new _openEMS() - self.CSX = None + self.__CSX = None if 'NrTS' in kw: self.SetNumberOfTimeSteps(kw['NrTS']) @@ -66,71 +80,121 @@ cdef class openEMS: def __dealloc__(self): del self.thisptr - if self.CSX is not None: - self.CSX.thisptr = NULL + if self.__CSX is not None: + self.__CSX.thisptr = NULL def SetNumberOfTimeSteps(self, val): """ SetNumberOfTimeSteps(val) + + Set the number of timesteps. E.g. 5e4 (default is 1e9) """ self.thisptr.SetNumberOfTimeSteps(val) def SetEndCriteria(self, val): """ SetEndCriteria(val) + + Set the end critera value. E.g. 1e-6 for -60dB """ self.thisptr.SetEndCriteria(val) def SetOverSampling(self, val): """ SetOverSampling(val) + + Set the time domain signal oversampling as multiple of the Nyquist-rate. """ self.thisptr.SetOverSampling(val) def SetCellConstantMaterial(self, val): """ SetCellConstantMaterial(val) + + Set cell material averaging to assume constant material inside each primary cell. (Advanced option) + + :param val: bool -- Enable or Disable (default disabled) """ self.thisptr.SetCellConstantMaterial(val) def SetCoordSystem(self, val): """ SetCoordSystem(val) + + Set the coordinate system. 0 --> Cartesian (default), 1 --> cylindrical """ assert (val==0 or val==1), 'SetCoordSystem: Invalid coordinate system' if val==0: - pass + self.thisptr.SetCylinderCoords(False) elif val==1: - self.SetCylinderCoords() + self.thisptr.SetCylinderCoords(True) def SetCylinderCoords(self): """ SetCylinderCoords() + + Enable use of cylindircal coordinates. """ self.thisptr.SetCylinderCoords(True) def SetTimeStepMethod(self, val): """ SetTimeStepMethod(val) + + Set the time step calculation method. (Advanced option) + + Options: + + * 1: CFL criteria + * 3: Advanced Rennings criteria (default) + + :param val: int -- 1 or 3 (See above) """ self.thisptr.SetTimeStepMethod(val) def SetTimeStep(self, val): """ SetTimeStep(val) + + Set/force the timestep. (Advanced option) + + It is highly recommended to not use this method! You may use the + SetTimeStepFactor instead to reduce the time step if necessary! """ self.thisptr.SetTimeStep(val) def SetTimeStepFactor(self, val): """ SetTimeStepFactor(val) + + Set a time step factor (>0..1) to increase FDTD stability. + + :param val: float -- >0..1 """ self.thisptr.SetTimeStepFactor(val) def SetMaxTime(self, val): """ SetMaxTime(val) + + Set max simulation time for a max. number of timesteps. """ self.thisptr.SetMaxTime(val) def SetGaussExcite(self, f0, fc): """ SetGaussExcite(f0, fc) + + Set a Gaussian pulse as excitation signal. + + :param f0: float -- Center frequency in Hz. + :param fc: float -- -20dB bandwidth in Hz. """ self.thisptr.SetGaussExcite(f0, fc) def SetBoundaryCond(self, BC): """ SetBoundaryCond(BC) + + Set the boundary conditions for all six FDTD directions. + + Options: + + * 0 or 'PEC' : perfect electric conductor (default) + * 1 or 'PMC' : perfect magnetic conductor, useful for symmetries + * 2 or 'MUR' : simple MUR absorbing boundary conditions + * 3 or 'PML-8' : PML absorbing boundary conditions + + :param BC: (8,) array or list -- see options above """ assert len(BC)==6 for n in range(len(BC)): @@ -148,26 +212,57 @@ cdef class openEMS: def AddLumpedPort(self, port_nr, R, start, stop, p_dir, excite=0, **kw): """ AddLumpedPort(port_nr, R, start, stop, p_dir, excite=0, **kw) + + Add a lumped port wit the given values and location. + + See Also + -------- + openEMS.ports.LumpedPort """ - assert self.CSX is not None, 'AddLumpedPort: CSX is not set!' - return ports.LumpedPort(self.CSX, port_nr, R, start, stop, p_dir, excite, **kw) + assert self.__CSX is not None, 'AddLumpedPort: CSX is not set!' + return ports.LumpedPort(self.__CSX, port_nr, R, start, stop, p_dir, excite, **kw) def AddRectWaveGuidePort(self, port_nr, start, stop, p_dir, a, b, mode_name, excite=0, **kw): """ AddRectWaveGuidePort(port_nr, start, stop, p_dir, a, b, mode_name, excite=0, **kw) + + Add a rectilinear waveguide port. + + See Also + -------- + openEMS.ports.RectWGPort """ - assert self.CSX is not None, 'AddRectWaveGuidePort: CSX is not set!' - return ports.RectWGPort(self.CSX, port_nr, start, stop, p_dir, a, b, mode_name, excite, **kw) + assert self.__CSX is not None, 'AddRectWaveGuidePort: CSX is not set!' + return ports.RectWGPort(self.__CSX, port_nr, start, stop, p_dir, a, b, mode_name, excite, **kw) def AddMSLPort(self, port_nr, metal_prop, start, stop, prop_dir, exc_dir, excite=0, **kw): """ AddMSLPort(port_nr, metal_prop, start, stop, prop_dir, exc_dir, excite=0, **kw) + + Add a microstrip transmission line port. + + See Also + -------- + openEMS.ports.MSLPort """ - assert self.CSX is not None, 'AddMSLPort: CSX is not set!' - return ports.MSLPort(self.CSX, port_nr, metal_prop, start, stop, prop_dir, exc_dir, excite, **kw) + assert self.__CSX is not None, 'AddMSLPort: CSX is not set!' + return ports.MSLPort(self.__CSX, port_nr, metal_prop, start, stop, prop_dir, exc_dir, excite, **kw) def CreateNF2FFBox(self, name='nf2ff', start=None, stop=None, **kw): """ CreateNF2FFBox(name='nf2ff', start=None, stop=None, **kw) + + Create a near-field to far-field box. + + This method will automatically adept the recording box to the current + FDTD grid and boundary conditions. + + Notes + ----- + * Make sure the mesh grid and all boundary conditions are finially defined. + + See Also + -------- + openEMS.nf2ff.nf2ff """ - assert self.CSX is not None, 'CreateNF2FFBox: CSX is not set!' + assert self.__CSX is not None, 'CreateNF2FFBox: CSX is not set!' directions = [True]*6 mirror = [0]*6 BC_size = [0]*6 @@ -186,7 +281,7 @@ cdef class openEMS: BC_size[n] = self.thisptr.Get_PML_Size(n)+1 if start is None or stop is None: - grid = self.CSX.GetGrid() + grid = self.__CSX.GetGrid() assert grid.IsValid(), 'Error::CreateNF2FFBox: Grid is invalid' start = np.zeros(3) stop = np.zeros(3) @@ -196,16 +291,29 @@ cdef class openEMS: assert len(l)>(BC_size[2*n]+BC_size[2*n+1]), 'Error::CreateNF2FFBox: not enough lines in some direction' start[n] = l[BC_size[2*n]] stop[n] = l[-1*BC_size[2*n+1]-1] - return nf2ff.nf2ff(self.CSX, name, start, stop, directions=directions, mirror=mirror, **kw) + return nf2ff.nf2ff(self.__CSX, name, start, stop, directions=directions, mirror=mirror, **kw) def SetCSX(self, ContinuousStructure CSX): """ SetCSX(CSX) + + Set the CSXCAD Continuous Structure for CAD data handling. + + See Also + -------- + CSXCAD.CSXCAD.ContinuousStructure """ - self.CSX = CSX + self.__CSX = CSX self.thisptr.SetCSX(CSX.thisptr) def Run(self, sim_path, cleanup=False, setup_only=False, verbose=None): """ Run(sim_path, cleanup=False, setup_only=False, verbose=None) + + Run the openEMS FDTD simulation. + + :param sim_path: str -- path to run in and create result data + :param cleanup: bool -- remove exisiting sim_path to cleanup old results + :param setup_only: bool -- only perform FDTD setup, do not run simulation + :param verbose: int -- set the openEMS verbosity level 0..3 """ if cleanup and os.path.exists(sim_path): shutil.rmtree(sim_path) diff --git a/python/openEMS/physical_constants.py b/python/openEMS/physical_constants.py index b99a965..8f014b5 100644 --- a/python/openEMS/physical_constants.py +++ b/python/openEMS/physical_constants.py @@ -1,9 +1,20 @@ # -*- coding: utf-8 -*- -""" -Created on Fri Dec 18 20:58:01 2015 - -@author: thorsten -""" +# +# Copyright (C) 2015,20016 Thorsten Liebig (Thorsten.Liebig@gmx.de) +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# import numpy as np diff --git a/python/openEMS/ports.py b/python/openEMS/ports.py index 30492f6..56bc8fc 100644 --- a/python/openEMS/ports.py +++ b/python/openEMS/ports.py @@ -1,9 +1,20 @@ # -*- coding: utf-8 -*- -""" -Created on Thu Dec 17 22:53:39 2015 - -@author: thorsten -""" +# +# Copyright (C) 2015,20016 Thorsten Liebig (Thorsten.Liebig@gmx.de) +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# import os import numpy as np @@ -108,8 +119,17 @@ class Port: # accepted power (incoming - reflected) self.P_acc = 0.5*np.real(self.uf_tot*np.conj(self.if_tot)) -# Lumped-Port class LumpedPort(Port): + """ + The lumped port. + + :param CSX: Continuous Structure + :param port_nr: int -- port number + :param R: float -- port reference impedance, e.g. 50 (Ohms) + :param start, stop: (3,) array -- Start/Stop box coordinates + :param p_dir: int -- port direction + :param excite: float -- port excitation amplitude + """ def __init__(self, CSX, port_nr, R, start, stop, exc_dir, excite=0, **kw): super(LumpedPort, self).__init__(CSX, port_nr=port_nr, start=start, stop=stop, excite=excite, **kw) self.R = R diff --git a/python/openEMS/utilities.py b/python/openEMS/utilities.py index ea2950f..22bfbf6 100644 --- a/python/openEMS/utilities.py +++ b/python/openEMS/utilities.py @@ -1,9 +1,20 @@ # -*- coding: utf-8 -*- -""" -Created on Fri Dec 18 19:21:19 2015 - -@author: thorsten -""" +# +# Copyright (C) 2015,20016 Thorsten Liebig (Thorsten.Liebig@gmx.de) +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# import numpy as np