# [**Workflows for atomistic simulations**](http://potentials.rub.de/)
%% Cell type:markdown id:straight-bicycle tags:
%% Cell type:markdown id:solid-explosion tags:
## **Day 1 - Atomistic simulations with [pyiron](https://pyiron.org)**
### **Exercise 2: Creating and working with structure databases**
Before the excercise, you should:
* Finish exercise 1
The aim of this exercise is to make you familiar with:
* Creating structure databases and working with them for potential fitting (day 2)
%% Cell type:markdown id:durable-leone tags:
%% Cell type:markdown id:apparent-assembly tags:
## **Importing necessary modules and creating a project**
This is done the same way as shown in the first exercise
%% Cell type:code id:novel-wisconsin tags:
%% Cell type:code id:fitting-testing tags:
``` python
importnumpyasnp
%matplotlibinline
importmatplotlib.pylabasplt
```
%% Cell type:code id:sitting-religious tags:
%% Cell type:code id:mature-bearing tags:
``` python
frompyironimportProject
```
%% Cell type:code id:technical-newport tags:
%% Cell type:code id:considered-karma tags:
``` python
pr=Project("creating_datasets")
```
%% Cell type:markdown id:based-kentucky tags:
%% Cell type:markdown id:controlled-david tags:
## Creating a structure "container" from the data
We now go over the jobs generated in the first notebook to store structures, energies, and forces into a structure container which will later be used for potential fitting
**Note**: Usually these datasets are created using highly accurate DFT calculations. But for practical reasons, we only demonstrate how to do this using data from LAMMPS calculations (the workflow remain the same)
%% Cell type:code id:attached-germany tags:
%% Cell type:code id:wrong-pickup tags:
``` python
# Access the project created in exercise 1
pr_fs=pr["../first_steps"]
```
%% Cell type:code id:filled-natural tags:
%% Cell type:code id:current-vanilla tags:
``` python
# Create a TrainingContainer job (to store structures and databases)
2021-03-08 11:55:40,043 - pyiron_log - WARNING - The job lammps_job_vac is being loaded instead of running. To re-run use the argument 'delete_existing_job=True in create_job'
The job lammps_job_vac was saved and received the ID: 303
2021-03-08 11:56:36,874 - pyiron_log - WARNING - The job lammps_job_surf is being loaded instead of running. To re-run use the argument 'delete_existing_job=True in create_job'
The job lammps_job_surf was saved and received the ID: 304
# We run the job sto store this dataset in the pyiron database
container.run()
```
%%%% Output: stream
2021-03-08 11:59:00,874 - pyiron_log - WARNING - The job dataset_example is being loaded instead of running. To re-run use the argument 'delete_existing_job=True in create_job'
The job dataset_example was saved and received the ID: 306