SkillAgentSearch skills...

AMCA3D

AMCA3D (3D Cellular Automata method for Additive Manufacturing) is a parallel C++ program designed for modeling mesoscale grain structure evolution during the additive manufacturing process.

Install / Use

/learn @YPLianGroup/AMCA3D
About this skill

Quality Score

0/100

Category

Design

Supported Platforms

Universal

README

AMCA3D

AMCA3D

AMCA3D (3D Cellular Automata method for Additive Manufacturing) is a parallel C++ program designed for modeling mesoscale grain structure evolution during the additive manufacturing process.

Requirement

  • MPICH2
  • YAML (ver. 0.3.0)
  • BOOST (ver. 1.64.0)
  • CMAKE
  • gcc & g++
  • git (Optional)
  • Paraview (for visualization)

It is highly recommended to install the given version of YAML and BOOST. Although it is not the newest, we did not do any compatibility test for the newest version.

Installation

AMCA3D should be installed on a Unix-like system. If you are using Windows 10 or 11, WSL (Windows Subsystem for Linux) is good. Check here for the installation of WSL.

Install gcc and so on

Using the following command to install a modern GCC compiler. If you already have one, go straight to the MPI setup.

sudo apt install gcc g++ cmake git build-essential unzip

Install MPICH

sudo apt install mpich

Install BOOST

Install BOOST to the default path, name $HOME/BOOST. Or edit the prefix option to the preferred path where you want to install.

# download and unzip
cd ~
wget -c https://boostorg.jfrog.io/artifactory/main/release/1.64.0/source/boost_1_64_0.tar.gz

tar -xf boost_1_64_0.tar.gz
cd boost_1_64_0

# install
./bootstrap.sh --prefix=$HOME/BOOST --with-libraries=signals,\
regex,filesystem,system,mpi,serialization,thread,program_options,exception
./b2 -j 4 install

Now the Boost has been installed***.***

Install YAML

Install BOOST to the default path, name $HOME/YAML. Or edit the prefix option to the preferred path where you want to install.

# download and unzip
cd ~
wget -c https://github.com/jbeder/yaml-cpp/archive/refs/tags/release-0.3.0.tar.gz
tar -xf release-0.3.0.tar.gz
cd yaml-cpp-release-0.3.0/
mkdir build
cd build
# install
cmake -DCMAKE_CXX_COMPILER=mpicxx -DCMAKE_CXX_FLAGS=-std=c++11 \
-DCMAKE_CC_COMPILER=mpicc -DCMAKE_INSTALL_PREFIX=$HOME/YAML ..
make
make install

Now the YAML has been installed***.***

Install AMCA3D

Step1

# download
cd ~
git clone https://github.com/YPLianGroup/AMCA3D.git
cd AMCA3D
mkdir build
cd build
cp ../configure.sh .

Or you can click here (Github & LianGroup) to download the code.

Step2

If the BOOST and YAML have been installed to the default path, skip this step and go to Step 3 directly.

Then set the directories for both Boost and YAML by editing the first 3 lines of the configure.sh script via notepad or vim. Let’s see the first 3 lines of configure.sh:

# set "boost_root" and "yaml_root" to the your path of BOOST and YAML
boost_root= {YOUR ***BOOST_ROOT_DIR***}
yaml_root= {YOUR ***YAML_ROOT_DIR***}

Step3

Execute this for an executable file AMCA3D:

./configure.sh
make

Tutorial & examples

Nucleation

This example shows the nucleation in a uniform temperature field with a consistent cooling rate. The nucleation site is randomly distributed in the domain and its critical undercooling follows a Gaussian distribution.

To run this example, go to the example folder, name \CA_ROOT\example\nucleation, then execute:

./nucleation.sh

The script nucleation.sh looks like

cp ../../build/AMCA3D ./
mpirun -np 4 AMCA3D -i Inputfile.i -o run.log

The first line is to copy the AMCA3D to the working path, and the second line is to run the simulation. mpirun -np <number of processes> [*program-name]* is a commend to run the program (AMCA3D here) as multiple processes. -i [inputfile-name] -o [outputfile-name] is using to specify the input and output file name. The input file tells the program how to set up the simulation, and the output file gives the detail of the simulation, including the review of the simulation, process monitor, or some error information.

Now the program is running, a \result folder is created and the frames of simulation is saved in this folder. Open the \CA_ROOT\example\nucleation\result\Grain.pvd to visualize results by a third-party open-source program paraview. Once the simulation is done, the final result is saved to finalGrain.vtk. If everything goes well, you can see the following result in paraview.

The color shows the grain structures.

The color shows the grain structures.

Currently, the first try is done, and we can modify the input file to set up our own simulation. so let’s take a look at the input files first. At first, the input file is written in a YAML format. It is OK if you do not know YAML before because it is very human-friendly, and we do not need to write input files from scratch.

The most important parameter is listed in the realms section. It looks like:

realms:
  - name: realm1
    type: cellular_automata
    dimension: 3

    domain:
      type: cubic
      original_point: [0,0,0]
      lateral_sizes: [0.03, 0.03, 0.03]

    discretization:
      cell_size: 0.0005

    nucleation_rules:
      - surface:
          type: Gaussian
          site_density: 0.0
          mean: 2
          standard_deviation: 0.5

      - bulk:
          type: Gaussian
          site_density: 10e6
          mean: 3
          standard_deviation: 1

    problem_physics:
        type: RappazGandin
        initial_temperature: -0.2
        melting_temperature: 0.0
        t_dot: -20
        a1: -0.544e-4 
        a2: 2.03e-4
        a3: 0.0

The domain and discretization set the location and size of the domain.

nucleation_rules controls the nucleation density and the critical undercooling of the site. Nucleation may occur both at the surface and in the bulk of the liquid volume. Taking the bulk nucleation as an example, we use $\rho$ to denote the nucleation site density for bulk liquid, and V represents the total volume of the simulation domain. Then the total number of bulk nucleation sites in the bulk is given by $N=\rho V$. mean and standard deviation are the parameters for the critical undercooling $\Delta T_c$ of the nucleation site. Once the undercooling is greater than the $\Delta T_c$, nucleation occurs.

problem_physics controls the nucleation condition (initial_temperature, t_dot: cooling rate) and the the property of cells (melting_temperature, a1 a2 a3: parameters for a polynomial $v(\Delta T)=a_1\Delta T+a_2\Delta T^2+a_3\Delta T^3$, which is obtain by dendrite tip growth kinetics).

Now, let's try to edit these parameters for your second simulation. Notice, AMCA3D is dimensionless, so the unit must be unified.

Additive manufacturing

Now let’s try to apply this program to an additive manufacturing process. A .txt format temperature field is needed, which can be obtained by thermal process modeling with a coarse mesh. The program read the temperature results and interpolates to fine CA mesh. Typically, the two modeling domains can be seen as follows.

The outline domain is for thermal modeling with a coarse mesh, and the solid domain is for CA with a fine mesh.

The outline domain is for thermal modeling with a coarse mesh, and the solid domain is for CA with a fine mesh.

Here are 2 powder bed fusion (PBF) examples in the \PBF_AM folder. Let’s try PBF_x first.

PBF_x

Go to the folder \example\PBF_x, then execute:

./PBF_x.sh

The script unzip PBF_x.zip for the temperature results file and run the simulation. If everything goes well, you can see the following image in your Paraview:

Left: grain growth evolution. Right: interpolated temperature field. The deep blue on Left shows the void cells and liquid cells. The deep blue on Right only shows the void region. Only a slice of temperature results is given due to reducing the file size.

Left: grain growth evolution. Right: interpolated temperature field. The deep blue on Left shows the void cells and liquid cells. The deep blue on Right only shows the void region. Only a slice of temperature results is given due to reducing the file size.

Let’s have a look at the input file. At first, two solvers should be selected in the solvers section:

solvers:
   - cellular_automata         # activate the cellular automata method
   - finite_element_method     # activate the finite element method to calculate temperature from coarse mesh to fine mesh

Second, a new section transfers should be defined. This section controls the algorithm to map CA mesh to FEM mesh. The initial settings are OK for simulation. The most important keyword is void_temperature here. The void_temperature defines a cutoff temperature for the void. All cells are deactivated in simulation if their temperature is less than void_temperature, and are reactivated again if their temperature is greater than void_temperature. Through this, the void between powder particles can be simulated.

Next, a new realm for finite_element should be defined. It look like:

- name: realm0
    type: finite_element
    dimension: 3
    mesh: ./PBF_x.txt

    solution_options:
       name: my_options

       options:
         - load_data_from_file:
             theta: theta
             for_whole_time: yes
             length_scale: 10.0
             time_scale: 1.0
             lines_for_title: 4
             lines_for_subtitle: 5
             x_offset: 0
             z_offset: 0

    output:
      output_data_base_name: ./Results/FEM
      output_frequency: 200000
      output_time_interval: 0.0002
      output_variables:
        - temperature

mesh specifies the path of temperature results. The options section is used to make sure the temperature field is well set up. For example, length_scale and time_scale are used to unify the unit of length and time be

Related Skills

diffs

338.0k

Use the diffs tool to produce real, shareable diffs (viewer URL, file artifact, or both) instead of manual edit summaries.

clearshot

Structured screenshot analysis for UI implementation and critique. Analyzes every UI screenshot with a 5×5 spatial grid, full element inventory, and design system extraction — facts and taste together, every time. Escalates to full implementation blueprint when building. Trigger on any digital interface image file (png, jpg, gif, webp — websites, apps, dashboards, mockups, wireframes) or commands like 'analyse this screenshot,' 'rebuild this,' 'match this design,' 'clone this.' Skip for non-UI images (photos, memes, charts) unless the user explicitly wants to build a UI from them. Does NOT trigger on HTML source code, CSS, SVGs, or any code pasted as text.

openpencil

1.8k

The world's first open-source AI-native vector design tool and the first to feature concurrent Agent Teams. Design-as-Code. Turn prompts into UI directly on the live canvas. A modern alternative to Pencil.

ui-ux-designer

Use this agent when you need to design, implement, or improve user interface components and user experience flows. Examples include: creating new pages or components, improving existing UI layouts, implementing responsive designs, optimizing user interactions, building forms or dashboards, analyzing existing UI through browser snapshots, or when you need to ensure UI components follow design system standards and shadcn/ui best practices.\n\n<example>\nContext: User needs to create a new dashboard page for team management.\nuser: "I need to create a team management dashboard where users can view team members, invite new members, and manage roles"\nassistant: "I'll use the ui-ux-designer agent to design and implement this dashboard with proper UX considerations, using shadcn/ui components and our design system tokens."\n</example>\n\n<example>\nContext: User wants to improve the user experience of an existing form.\nuser: "The signup form feels clunky and users are dropping off. Can you improve it?"\nassistant: "Let me use the ui-ux-designer agent to analyze the current form UX and implement improvements using our design system and shadcn/ui components."\n</example>\n\n<example>\nContext: User wants to evaluate and improve existing UI.\nuser: "Can you take a look at our pricing page and see how we can make it more appealing and user-friendly?"\nassistant: "I'll use the ui-ux-designer agent to take a snapshot of the current pricing page, analyze the UX against Notion-inspired design principles, and implement improvements using our design tokens."\n</example>

View on GitHub
GitHub Stars63
CategoryDesign
Updated14d ago
Forks12

Languages

C++

Security Score

95/100

Audited on Mar 13, 2026

No findings