Flex Representation Method Example Code Repository

Students,

I’ve added the example code that I’ve written in Julia to the following repository:

If you’ve never had the opportunity to use git before this is a great chance to learn a little about it. The main file that runs the simulation is main.jl. If you want to run this code yourself you’re going to need to install Julia. If you have any questions about installing Julia or using git drop your questions here and we’ll try to help. For now, much like the class notes, this repo will be in constant flux so always expect new updates, but keep in mind you can always go back and see any edit history. I hope this helps!

Just for reference I found a good tutorial for installing Julia and Pluto here;

The code under the pluto directory contains the following errors when loaded for the first time;

(Plots, Polynomials, SpecialPolynomials packages are not loaded) you have to install using (I think)
import Pkg; begin
Pkg.add(“Plots”)
Pkg.add(“Polynomials”)
Pkg.add(“SpecialPolynomials”)
end

Also ‘UndefVarError: Bernstein not defined’
I still have not found where this function was defined.

Just as a side note, this issue has always been my qualm with Python, and now it is with Julia. Packages are not built in and transferring code to other people always leads to functions and packages not being installed for proper function. Also in a controlled environment every package that is not included with the standard installation has to be evaluated for cyber security purposes; and I have not been able to find how to look over the package contents prior to installing.

@erdodgen this is a great point and we’ll try to separate what is a work in progress (WIP) and what should actually run. You are right that those packages need to be installed to run the pluto files. The code in the utils directory should only use the Plots package.

@chris what interface do you use when writing and evaluating julia code?

I use spacemacs (emacs + vim) in julia mode and I use the terminal to run Julia. If you have another IDE you find that works well with Julia feel free to share. Spacemacs is great if you’re serious about development and you develop in mulitple languages simultaneously but I wouldn’t recommend it necessarily if you’re starting out by yourself.

@chris So I am learning a bit about Julia and how it does environments. Is it possible to have you create an environment that we can all leverage. or is it machine specific and we all have to do that on our own?

@matt attempting to run class.jl and it appears that it needs the package GaussQuadrature. However when trying to install using
import Pkg; Pkg.add("GaussQuadrature")

There is the following error;
ERROR: SystemError: opening file “C:\Users\erdod\.julia\registries\General\Registry.toml”: No such file or directory

Am I missing something I was supposed to install?

@erdodgen Gauss quadrature is being defined by us so you shouldn’t have to install anything. It appears to be defined on line 214 of the file class.jl

@erdodgen Nevermind, I see what is going on. There is GaussQuadrature and QuadratureGauss. We are defining QuadratureGauss on the line I mentioned before. We do need to add GaussQuadrature. I’m not sure what is going on with your Julia. I was able to download the git repo and install all of the needed packages without any issue. We might need to hop on a call to debug things

Thanks for helping out @kyle ;).

Here is the new CoreformIGA julia package I discussed in class today:

Class If you are running windows you may have to add the julia.exe folder location to your path variable in your windows environment variables.

https://julialang.org/downloads/platform/#:~:text=Adding%20Julia%20to%20PATH%20on,environment%20variable"%20UI%20will%20appear.

The activate still does not work in windows for me. as it is still activating the environment at my main working directory rather than my current working directory. must be a windows thing.

Two ways to fix this:

import Pkg
Pkg.instantiate()

or

]
instantiate

Did you change the repository this code is located in? I keep getting a 404 error on GitHub when I click the link you posted above -Lindsey

Lindsey, yes, the link has changed. Try the link a few posts further down, which I will repeat here: https://github.com/mascott1978/CoreformIGA.jl

Sorry for the confusion.