Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge with develop for 3.6.6 release. #64

Merged
merged 5 commits into from
Feb 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,7 @@ exm6.vtk
# new notebook examples
docs/source/examples/.ipynb_checkpoints/
.DS_Store
*.lock
*.log
*.log
*.log
1 change: 1 addition & 0 deletions .pdm-python
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
C:/Users/Miniconda3/envs/calfem-clean/python.EXE
2 changes: 1 addition & 1 deletion build-package.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def build_package():

if __name__ == "__main__":

package_version = "3.6.5"
package_version = "3.6.6"

update_setup("calfem-python", package_version, "'numpy', 'visvis', 'pyvtk', 'matplotlib', 'scipy', 'gmsh', 'qtpy', 'vedo', 'tabulate'")

Expand Down
5 changes: 4 additions & 1 deletion calfem/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -5279,7 +5279,7 @@ def assem(edof, K, Ke, f=None, fe=None):
return K, f


def solveq(K, f, bcPrescr, bcVal=None):
def solveq(K, f, bcPrescr=None, bcVal=None):
"""
Solve static FE-equations considering boundary conditions.

Expand All @@ -5306,6 +5306,9 @@ def solveq(K, f, bcPrescr, bcVal=None):
if bcVal is None:
bcVal = np.zeros([nPdofs], 'd')

if bcPrescr is None:
return np.asmatrix(np.linalg.solve(K, f))

bc = np.ones(nDofs, 'bool')
bcDofs = np.arange(nDofs)

Expand Down
4 changes: 2 additions & 2 deletions calfem/geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ def addRuledSurface(self, outer_loop, ID=None, marker=0):
if len(outer_loop) not in [3, 4]:
raise IndexError(
"Ruled Surface: outer_loop must be a list of 3 or 4 positive integers denoting curve indices")
self._addSurf("Ruled Surface", outer_loop, [],
self._addSurf("Surface", outer_loop, [],
ID, marker, is_structured=False)

def addStructuredSurface(self, outer_loop, ID=None, marker=0):
Expand All @@ -472,7 +472,7 @@ def addStructuredSurface(self, outer_loop, ID=None, marker=0):
marker - Integer. Marker applied to this surface. Default 0.
'''
self._checkIfProperStructuredQuadBoundary(outer_loop, ID)
self._addSurf("Ruled Surface", outer_loop, [],
self._addSurf("Surface", outer_loop, [],
ID, marker, is_structured=True)

def _addSurf(self, name, outer_loop, holes, ID, marker, is_structured):
Expand Down
11 changes: 7 additions & 4 deletions calfem/mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ def __init__(self, geometry, el_type=2, el_size_factor=1, dofs_per_node=1,
self.mesh_dir = mesh_dir
self.return_boundary_elements = return_boundary_elements
self.gmsh_options = {}
self.gmsh_verbosity = 0

# gmsh elements that have rectangle faces
self._ElementsWithQuadFaces = [3, 5, 10, 12, 16, 17, 92, 93]
Expand Down Expand Up @@ -270,9 +271,9 @@ def create(self, is3D=False, dim=3):
raise IOError(
"Error: Could not find GMSH. Please make sure that the \GMSH executable is available on the search path (PATH).")
else:
print("Info : GMSH -> %s" % gmshExe)
cflog.info(" GMSH -> %s" % gmshExe)
else:
print("Info : GMSH -> Python-module")
cflog.info(" GMSH -> Python-module")

# Create a temporary directory for GMSH

Expand Down Expand Up @@ -351,7 +352,9 @@ def create(self, is3D=False, dim=3):
# Meshing using gmsh extension module

if self.initialize_gmsh:
gmsh.initialize(sys.argv)
gmsh.initialize(sys.argv, interruptible=False)

gmsh.option.setNumber("General.Verbosity", self.gmsh_verbosity)

# This is a hack to enable the use of gmsh in
# a separate thread.
Expand Down Expand Up @@ -411,7 +414,7 @@ def create(self, is3D=False, dim=3):

with open(mshFileName, 'r') as mshFile:

info("Mesh file : "+mshFileName)
info(" Mesh file : "+mshFileName)

# print("Reading msh file...")

Expand Down
10 changes: 8 additions & 2 deletions calfem/vis_mpl.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def figure(figure=None, show=True, fig_size=(6, 5.33)):

def figure_widget(fig, parent=None):
widget = FigureCanvas(fig)
widget.axes = fig.add_subplot(111)
#widget.axes = fig.add_subplot(111)
if parent != None:
widget.setParent(parent)
toolbar = NavigationToolbar(widget, widget)
Expand All @@ -127,11 +127,17 @@ def close_all():

closeAll = close_all


def clf():
"""Clear visvis figure"""
plt.clf()

def close(fig=None):
"""Close visvis figure"""
if fig == None:
plt.close()
else:
plt.close(fig)


def gca():
"""Get current axis of the current visvis figure."""
Expand Down
Loading