PawelBee / Guanaco

Grasshopper plugin linking Rhino, Gmsh mesher and Calculix FE package
MIT License
5 stars 1 forks source link

Apply loads to elements #9

Closed jaspervanwijk closed 5 years ago

jaspervanwijk commented 5 years ago

The method to add loads is kind of big. Maybe the responsibility could be handed the load itself.

Myabe the load adding needs to be done on element level, but not sure about that, some loads apply to multiple elements at once (seeiing the infill load function).

Just for cleanup this might help:

public class Mesh
    {
        public ILoad AddLoad(ILoad load)
        {
            return load.AddTo(this);
        }
    }

    public interface ILoad
    {
        ILoad AddTo(Mesh mesh);
    }

    public class NodelLoad : ILoad
    {
        public ILoad AddTo(Mesh mesh)
        {
            // find the node in the mesh and attach load
        }
    }

    public class InfillLoad : ILoad
    {
        public ILoad AddTo(Mesh mesh)
        {
            // find the elements in the mesh and attach
        }
    }
PawelBee commented 5 years ago

Closed with #10.