Giter VIP home page Giter VIP logo

adapy's Introduction

Hi there πŸ‘‹

I am a structural engineer and open source developer based in Oslo, Norway.

My open source development focuses mainly on improving my structural engineering workflow and sharing my findings with the open source community.

I am the main developer of ada-py and paradoc and I am also a contributor of IfcOpenShell and various other related CAD/FEM projects.

  • πŸ”­ I’m currently working on porting Code Aster to MSVC and distribute it as a conda-forge package (see https://gitlab.com/krande/src). (This will to let those of us forced to use Windows in our day-jobs enjoy the wonderful code aster Finite Element solver directly from inside our python environment)

If you've found anything I've made useful and want to buy me a cup of coffee as a thanks, you can either sponsor my individual projects or go to my sponsorship page :)

adapy's People

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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

adapy's Issues

Fix IFC import [bug]

The state of the IFC import code base in ada is currently outdated and unstable. This is primarily due to the current implementation (or lack there of) of unit conversion.

Investigate the unit conversion handling in IfcPatch [here] (https://github.com/IfcOpenShell/IfcOpenShell/blob/v0.6.0/src/ifcpatch/ifcpatch/recipes/ConvertLengthUnit.py)

Todo:

  • Rewrite code
  • Add Unittest - Read IFC file with native beams
  • Add Unittest - Read IFC file with native plates
  • Add Unittest - Read IFC file with native pipes
  • Add Unittest - Read IFC file with native walls

[Feature request] Add FEM read support for GBARM sesam beam elements

Genie beam with Bar section is converted to IfcCircleProfileDef

from ada import Assembly
path = r'c:\test'
fem_file = path + '\T10.FEM'
a = Assembly('myAssembly')
a.read_fem(fem_file, fem_name='myModel')
p = a.parts['myModel']
p.fem.convert_ecc_to_mpc()
a.create_objects_from_fem()
a.to_ifc(path + '\T10')

Error in constructing out-of-plane IfcRevolvedAreaSolid shapes

In the process of creating a demo for a IFC Database PoC I saw that in my previous treatment of curved pipe segments using tesselation causes a huge blowup in the generated IFC file size. So I started to add support for IfcRevolvedAreaSolid to reduce IFC file size.

That's when I encountered an issue with constructing the revolve operation of out-of-plane shapes.

To give a minium example to test that the revolved solids are calculated properly I create a simple pipe using a list of coordinates that results in a few segments with bends that occur in-plane and out-of-plane.

Here is the gist of inputs needed to generate the 3d model.

from ada import Section, Pipe
from ada.config import Settings

coords = [(0, -0.2, 3.2), (5.2, -0.2, 3.2), (5.2, 4.8, 3.2), (10, 4.8, 5.2), (10, 4.8, 13.2)]

pipe1 = Pipe("Pipe1",  coords, Section("PSec", "PIPE", r=0.10, wt=5e-3))

a = Assembly("MyTest") / (Part("MyPart") / pipe1

Settings.make_param_elbows = True
a.to_ifc("pipe_bend_multiple.ifc")

adapy will automatically calculate and define a "bend radius" of "r = 0.196" between the segments and use basic geometry
to find where the straight segments should end and where the curve should start.

When exporting this pipe to STEP using pythonocc-core (and letting OpenCascade handle the extrusion):

image

However, when I export to IFC I end up with:

image

As observed in the IFC file, the revolved shape located in the XY plane works as expected. However, the other 2 shapes that are to be revolved in an out-of-plane manner fails.

FYI: Here is the ifc file
pipe_bend_multiple.zip (zipped IFC file)

For the portion of the pipe that works as intended (in the XY plane) the IFC input looks like this.

/* IfcRevolvedAreaSolid "Pipe1_2_Elbow" Actually displaying correctly */

#94=IFCDIRECTION((-1.,0.,4.26642158858964E-17));
#95=IFCCARTESIANPOINT((0.,0.195958125,0.));
#96=IFCAXIS1PLACEMENT(#95,#94);

#97=IFCDIRECTION((1.,0.,0.));
#98=IFCDIRECTION((0.,0.,-1.));
#99=IFCCARTESIANPOINT((5.004041875,-0.2,3.2));
#100=IFCAXIS2PLACEMENT3D(#99,#97,#98);

#101=IFCREVOLVEDAREASOLID(#70,#100,#96,90.);
#102=IFCSHAPEREPRESENTATION(#11,'Body','SweptSolid',(#101));
#103=IFCPRODUCTDEFINITIONSHAPE($,$,(#102));

#104=IFCDIRECTION((0.,0.,1.));
#105=IFCDIRECTION((1.,0.,0.));
#106=IFCCARTESIANPOINT((0.,0.,0.));
#107=IFCAXIS2PLACEMENT3D(#106,#104,#105);
#108=IFCLOCALPLACEMENT($,#107);
#109=IFCPIPEFITTING('2K$U6nEOWHxPuP01fzsd4G',#25,'Pipe1_2_Elbow','An awesome Elbow',$,#108,#103,$,$);

/* END of IfcRevolvedAreaSolid "Pipe1_2_Elbow" Actually displaying correctly */

And here is the IFC description for one of the 2 failing shapes "Pipe1_4_Elbow":

/* IfcRevolvedAreaSolid "Pipe1_4_Elbow" not displaying correctly */

#141=IFCDIRECTION((0.14792899408284,0.923076923076923,-0.355029585798817));
#142=IFCCARTESIANPOINT((0.180884423076923,0.,0.0753685096153847));
#143=IFCAXIS1PLACEMENT(#142,#141);

#144=IFCDIRECTION((0.,1.,0.));
#145=IFCDIRECTION((-0.384615384615385,0.,0.923076923076923));
#146=IFCCARTESIANPOINT((5.2,4.604041875,3.2));
#147=IFCAXIS2PLACEMENT3D(#146,#144,#145);

#148=IFCREVOLVEDAREASOLID(#70,#147,#143,90.);
#149=IFCSHAPEREPRESENTATION(#11,'Body','SweptSolid',(#148));
#150=IFCPRODUCTDEFINITIONSHAPE($,$,(#149));

#151=IFCDIRECTION((0.,0.,1.));
#152=IFCDIRECTION((1.,0.,0.));
#153=IFCCARTESIANPOINT((0.,0.,0.));
#154=IFCAXIS2PLACEMENT3D(#153,#151,#152);
#155=IFCLOCALPLACEMENT($,#154);
#156=IFCPIPEFITTING('2L02kiEOWHxPWc01fzsd4G',#25,'Pipe1_4_Elbow','An awesome Elbow',$,#155,#150,$,$);

/* END of IfcRevolvedAreaSolid "Pipe1_4_Elbow" not displaying correctly */

Obviously there is a bug in what I insert into the IFCREVOLVEDAREASOLID IFC object.

The failing revolved shape should start and stop at points A & B,
while 2 vectors of the two straight segments are A_V and B_V.

A=(5.2,4.604041875,3.2)
B=(5.38088442, 4.8, 3.27536851)

A_V=(0., 1., 0.)
B_V=(0.92307692, 0., 0.38461538)

Here is the current code where I use IfcOpenShell to write the IFC objects: https://github.com/Krande/adapy/blob/pipeelbow/src/ada/ifc/write/write_pipe.py#L242-L286

Here are some things I might be misunderstanding from the IFC4_3 docs:

  • Should the rotation axis IfcAxis1Placement be defined relative to the coordinate system of the IfcAxis2Placement3D?

@aothms: I'm sorry to bug you with this. But if you have a spare moment to see if you notice what I'm doing wrong with IfcRevolvedAreaSolid it would definitively help (as I seem to be going in circles :) )

Docker Base Image - multi-step

Docker Base Image

Test using multi-step builds to remove any compilation toolkits that are not necessary during runtime.

[Feature request] Add minimal functional support for Code Aster export

Note to self!

Finish the support for writing Code Aster input file by completing the implementation at

p = get_fem_model_from_assembly(assembly)
write_to_med(p, analysis_dir)
write_export_file(analysis_dir, p.name, 2)
# TODO: Finish .comm setup based on Salome meca setup
with open(analysis_dir.with_suffix(".comm"), "w") as f:
f.write('mesh = LIRE_MAILLAGE(FORMAT="MED", UNITE=20)\n\n')
f.write(
"""model = AFFE_MODELE(
AFFE=_F(
MODELISATION=('3D', ),
PHENOMENE='MECANIQUE',
TOUT='OUI'
),
MAILLAGE=mesh
) \n"""
)
print(f'Created a Code_Aster input deck at "{analysis_dir}"')

Tip is to download and use Salome Meca to build the necessary input files and see what is needed to add in the .comm file and\or med file.

When finalized it should be able to run the same cantilever example as demonstrated for abaqus and calculix in the README.md file.

IFC-native-support - common primitives

IFC-support

Add read/write support for common 3D modelling primitives that exists in IFC.

  • IfcRevolvedAreaSolid
  • IfcExtrudedAreaSolid
  • IfcFixedReferenceSweptAreaSolid
  • IfcSurfaceCurveSweptAreaSolid (maybe this won't be a priority this time around)

Add a profiling GA workflow

Set up an automated workflow using something like Scalene to do a thorough profiling of CPU, Memory usage on a set of real-world use-cases.

Each workflow produces a Release file package with profiling results to keep track of package optimization history

Separate Ifc handling by using a IfcStore class

inspired by the way blenderbim separates the handling of IFC, a separate IfcStore class would seem a good choice to reduce coupling and single class responsibility.

The IfcStore should provide the following methods

  • sync()
  • from_file()
  • from_object()
  • to_file()
  • to_object()

Ada Report: theoretic result values or benchmark nastran or abacus

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

here I see not the β€žproblemsβ€œ of a solver in quality to theory or best program in the tables.

so is it clear that second order is normally better than first order by same size.
Calculation time is significant higher by second order.
In complex models fine resolution and first order elements are often better by same solution time.

Describe the solution you'd like
A clear and concise description of what you want to happen.

Ada Report: theoretic result values or benchmark nastran in extra column
so the reader can see the actual quality of solver in relation to theory or nastran or abacus.
Difference in % in extra Table
But here the figures of eigenvalues should be the same

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

see other examples of calculix to others: http://www.bconverged.com/benchmarks/index.php

https://www.esrd.com/wp-content/uploads/dlm_uploads/Benchmarks-Guide-Standard-NAFEMS-Benchmarks-Linear-Elastic-Tests.pdf

https://www.autodesk.com/sites/default/files/file_downloads/Autodesk-Inventor-Nastran-2022-Verification-Manual.pdf

https://doc.comsol.com/5.5/doc/com.comsol.help.sme/StructuralMechanicsVerificationExamples.pdf

Consider numpy arrays for nodes and elements instead of lists with instantiated classes [optimizing]

The current implementation of storing nodes and elements in lists as instantiated classes (Elem and Node) seems highly inefficient.

Consider storing the information as numpy arrays or something similar to meshio implementation (or perhaps use the Mesh object from meshio directly if it allows for node and element numbering with gaps?).

Then the Elem and Node can be implemented as pointers to the numpy arrays only (i.e. only instantiated when the user interacts with nodes and elements in code elsewhere).

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.