Constructing a MeshLoad in C#

(Merijn) #1

Hi All,

I’m currently working on a component to generate new loadcases with loadcombinations:

While applying the factors on the gravity, point- and line loads works fine, I’m having some trouble with the meshLoad.

Right now I’m constructing new loads with the factors applied, however I can’t seem to find the correct/sufficient documentation on constructing a MeshLoad.

Could anyone help me with this?



(Merijn) #2

Diving into the karamba components for a bit I think I’ve found the solution.
Sorry for maybe being to quick with my question.

I’m still interested in some documentation on the construction of a MeshLoad though.

If anyone else is interested, this is how I applied the factor to the original meshLoad:

//Get original MeshLoad
MeshLoad ml = fLoad as MeshLoad;

// Apply factor to original stresses
List stresses = new List();
ml.unit_stresses.ForEach(stress => stresses.Add(Vector3d.Multiply(ml.unit_stresses_factor * factors[i], stress)));

//Create new resultant MeshLoad with factors applied
MeshLoad resMl = new MeshLoad(stresses, 9);
res = resMl;


Hi Merijn,
the Karamba3D unit test library contains the test ‘MeshLoadProfiling’ which shows how Mesh-Loads can be generated in Karamba3D 1.3.2. It can be downloaded from

(Merijn) #4

Hi Clemens,

Thanks for your response! I’ll have a look at that!



(Merijn) #5

Hi Clemens,

Two questions:

  1. When applying the factor as I did in my “solution” given, the resultant of a mesh load doesn’t seem to be working as expected. Applying a factor of 1 will give me the original load (correct), however, applying a factor of 2 does give me 2 times the “Load” but gives an exponential growth in the resultant:

    Do you have an idea where this goes wrong?

  2. Is there a way to access the original mesh, used to generated the MeshLoad? Preferably only using a generated load (pre-assembly)?

Edit: Applying a square root to my factor does give me the correct resultant, the load in kN/m2 then is too small




Hi Merijn,
at the moment (Karamba3D 1.3.1.) scaling of a MeshLoad is a quite tricky. Both the underlying unit loads and load values are scaled using the square of the resultant of the loads. In order to get the correct resultant in your example you would have to scale the underlying unit loads - however there is no write access to that property.
Currently the mesh gets discarded as soon as the unit loads are calculated.
I will set both issues on my TODO-list.

(Merijn) #7

Hi Clemens,

I was afraid of that. Was already trying to get to editing the unit loads with no luck :frowning:
Anyhow, Thanks for your reply!