Giter Site home page Giter Site logo

romeric / florence Goto Github PK

View Code? Open in Web Editor NEW
79.0 7.0 14.0 2.62 MB

A finite element framework for Python's scientific stack: arbitrary order planar/curvilinear mesh generation and finite element methods for linear and nonlinear analysis of coupled multiphysics problems

License: MIT License

Python 86.88% C++ 7.64% C 0.28% Makefile 0.91% Cython 4.28%
finite-elements high-performance python multiphysics mechanics electromechanics

florence's People

Contributors

dancergraham avatar romeric avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

florence's Issues

Proper error diagnostic for material models

Material models at the moment do not raise any errors when incorrect material parameters are passed to them. This makes it difficult for new users to understand which constants are required for a material model. Specially the low level version of the material crashes with very unhelpful messages.

There are two conceivable ways at the moment for fixing this.

  1. Call the Hessian of the material before the start of the analysis with dummy values to check if it crashes, for instance for most materials this will be of the form:
    F = np.random.rand(1,material.ndim,material.ndim)
    E = np.random.rand(material.ndim)
    material.Hessian(KinematicMeasures(F,analysis_nature),E)

This still gives very unhelpful error message. Alternatively, if we wrap this within a try and catch we lose the info on material constant was exactly missing (in case there are many of them). Or in case something else goes wrong, it is corresponding error will not be shown, perhaps.

  1. Scan the whole content of the candidate material file and find the keyword self.<constant> potentially after filtering unnecessary self attributes. Something like
    with open(material.mtype+".py") as f:
        lines = f.readlines()

    counter = None
    for i, line in enumerate(lines):
        if "def Hessian" in line:
            counter = i
            break
        elif "def Permittivity" in line:
            counter = i
            break

    line_container = []
    for i, line in enumerate(lines):
        if "self." in line and i>counter:
            line_container.append(line)

    parameters_container = []
    for line in line_container:
        line = line.rstrip().split()
        for token in line:
            if "self." in token:
                parameters_container.append(token)

     # process parameters_container further

This technique requires special cases for different formulations as a material may not have methods Hessian or Permittivity defined or use another method where an extra constant is used there. It is an ugly fix and not very programatic.

ModuleNotFoundError: No module named 'Florence.VariationalPrinciple.DisplacementApproachIndices'

After easy install with pip (All the dependencies have been installed except PostMesh) the execution of " from Florence import * " provides an error:

File "/home/user/anaconda3/lib/python3.7/site-packages/Florence/init.py", line 6, in
from .VariationalPrinciple import *
File "/home/user/anaconda3/lib/python3.7/site-packages/Florence/VariationalPrinciple/init.py", line 1, in
from .VariationalPrinciple import *
File "/home/user/anaconda3/lib/python3.7/site-packages/Florence/VariationalPrinciple/VariationalPrinciple.py", line 5, in
from .DisplacementApproachIndices import FillGeometricB
ModuleNotFoundError: No module named 'Florence.VariationalPrinciple.DisplacementApproachIndices'

No module named 'Florence.FunctionSpace.JacobiPolynomials.JacobiPolynomials'

Hi,

I have successfully installed the florence package (which means no error message showed up during the installation :) )

I tried to import the package and error message showed up:

No module named 'Florence.FunctionSpace.JacobiPolynomials.JacobiPolynomials'

I have checked the installation directory and all files and folders seem to be there,

Under the florence folder:

Base FiniteElements MaterialLibrary PostProcessing Tensor VariationalPrinciple BoundaryCondition FunctionSpace MeshGeneration QuadratureRules TimeIntegrators __init__.py BoundaryElements LegendreTransform ParallelProcessing Solver Utils __pycache__

under the functionsapce folder:

DegenerateMappings.py GetBases.py OneDimensional ThreeDimensional __init__.py FunctionSpace.py JacobiPolynomials PointInversionIsoparametricFEM.py TwoDimensional __pycache__

Under the JacobiPolynomials folder:

JacobiPolynomials.pyx JacobiPolynomials_PurePython.py Makefile NormalisedJacobi_Deprecated.py __init__.py __pycache__

Not sure what cause the issue.

Thanks in advance for checking this out.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.