Skip to content

Commit

Permalink
Merge pull request #93 from ManuelLerchner/87-sheet-5-task-4b-crystal…
Browse files Browse the repository at this point in the history
…lization-of-argon

Crystallization of Argon (Option B)
  • Loading branch information
TobiasEppacher authored Jan 10, 2024
2 parents 570429f + 620c0f5 commit 4bcf016
Show file tree
Hide file tree
Showing 29 changed files with 1,845 additions and 97 deletions.
47 changes: 47 additions & 0 deletions input/crystallization_argon/cooling_argon.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?xml version="1.0"?>
<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../simulation_schema.xsd">

<settings>
<delta_t>0.001</delta_t>
<end_time>250.0</end_time>
<third_dimension>true</third_dimension>
<particle_container>
<linkedcells_container>
<domain_size>
<x>9.2</x>
<y>9.2</y>
<z>9.2</z>
</domain_size>
<cutoff_radius>2.3</cutoff_radius>
<boundary_conditions>
<left>Periodic</left>
<right>Periodic</right>
<bottom>Periodic</bottom>
<top>Periodic</top>
<back>Periodic</back>
<front>Periodic</front>
</boundary_conditions>
</linkedcells_container>
</particle_container>
<forces>
<SmoothedLennardJones r_c="2.3" r_l="1.9" />
</forces>
<interceptors>
<Thermostat application_interval="50" target_temperature="0.5"
max_temperature_change="7.8E-4">
<temperature_sensor sample_every_x_percent="1" />
</Thermostat>
<FrameWriter output_format="vtu" fps="240" video_length_s="30" />
<RadialDistributionFunction bin_width="0.05" sample_every_x_percent="10" />
<DiffusionFunction sample_every_x_percent="1" />
</interceptors>
</settings>


<particle_source>
<!-- 3°K Equilibrated Argon Fluid -->
<sub_simulation path="subsimulations/base_fluid.xml" />
</particle_source>

</configuration>
67 changes: 67 additions & 0 deletions input/crystallization_argon/subsimulations/base_fluid.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?xml version="1.0"?>
<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../simulation_schema.xsd">

<settings>
<delta_t>0.001</delta_t>
<end_time>150.0</end_time>
<third_dimension>true</third_dimension>
<particle_container>
<linkedcells_container>
<domain_size>
<x>9.2</x>
<y>9.2</y>
<z>9.2</z>
</domain_size>
<cutoff_radius>2.3</cutoff_radius>
<boundary_conditions>
<left>Periodic</left>
<right>Periodic</right>
<bottom>Periodic</bottom>
<top>Periodic</top>
<back>Periodic</back>
<front>Periodic</front>
</boundary_conditions>
</linkedcells_container>
</particle_container>
<forces>
<SmoothedLennardJones r_c="2.3" r_l="1.9" />
</forces>
<interceptors>
<Thermostat application_interval="40" target_temperature="3"
max_temperature_change="0.001">
<temperature_sensor sample_every_x_percent="0.2" />
</Thermostat>
<FrameWriter output_format="vtu" fps="24" video_length_s="30" />
</interceptors>
</settings>


<particle_source>
<cuboid_spawner>
<lower_left_front_corner>
<x>0.575</x>
<y>0.575</y>
<z>0.575</z>
</lower_left_front_corner>
<grid_dim>
<x>8</x>
<y>8</y>
<z>8</z>
</grid_dim>
<grid_spacing>1.15</grid_spacing>
<temperature>0.01</temperature>
<mass>1.0</mass>
<velocity>
<x>0.0</x>
<y>0.0</y>
<z>0.0</z>
</velocity>
<type>0</type>
<epsilon>1.0</epsilon>
<sigma>1.0</sigma>
</cuboid_spawner>

</particle_source>

</configuration>
47 changes: 47 additions & 0 deletions input/crystallization_argon/supercooling_argon.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?xml version="1.0"?>
<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../simulation_schema.xsd">

<settings>
<delta_t>0.001</delta_t>
<end_time>250.0</end_time>
<third_dimension>true</third_dimension>
<particle_container>
<linkedcells_container>
<domain_size>
<x>9.2</x>
<y>9.2</y>
<z>9.2</z>
</domain_size>
<cutoff_radius>2.3</cutoff_radius>
<boundary_conditions>
<left>Periodic</left>
<right>Periodic</right>
<bottom>Periodic</bottom>
<top>Periodic</top>
<back>Periodic</back>
<front>Periodic</front>
</boundary_conditions>
</linkedcells_container>
</particle_container>
<forces>
<SmoothedLennardJones r_c="2.3" r_l="1.9" />
</forces>
<interceptors>
<Thermostat application_interval="25" target_temperature="0.02"
max_temperature_change="2.5E-3">
<temperature_sensor sample_every_x_percent="1" />
</Thermostat>
<FrameWriter output_format="vtu" fps="240" video_length_s="30" />
<RadialDistributionFunction bin_width="0.05" sample_every_x_percent="10" />
<DiffusionFunction sample_every_x_percent="1" />
</interceptors>
</settings>


<particle_source>
<!-- 3°K Equilibrated Argon Fluid -->
<sub_simulation path="subsimulations/base_fluid.xml" />
</particle_source>

</configuration>
77 changes: 71 additions & 6 deletions src/io/xml_schemas/checkpoint/checkpoint_schema.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,18 @@ ParticleType::type_type& ParticleType::type() { return this->type_.get(); }

void ParticleType::type(const type_type& x) { this->type_.set(x); }

const ParticleType::epsilon_type& ParticleType::epsilon() const { return this->epsilon_.get(); }

ParticleType::epsilon_type& ParticleType::epsilon() { return this->epsilon_.get(); }

void ParticleType::epsilon(const epsilon_type& x) { this->epsilon_.set(x); }

const ParticleType::sigma_type& ParticleType::sigma() const { return this->sigma_.get(); }

ParticleType::sigma_type& ParticleType::sigma() { return this->sigma_.get(); }

void ParticleType::sigma(const sigma_type& x) { this->sigma_.set(x); }

#include <xsd/cxx/xml/dom/parsing-source.hxx>

// CheckPointFileType
Expand Down Expand Up @@ -381,25 +393,30 @@ ParticleDataType::~ParticleDataType() {}
//

ParticleType::ParticleType(const position_type& position, const velocity_type& velocity, const force_type& force,
const old_force_type& old_force, const mass_type& mass, const type_type& type)
const old_force_type& old_force, const mass_type& mass, const type_type& type, const epsilon_type& epsilon,
const sigma_type& sigma)
: ::xml_schema::type(),
position_(position, this),
velocity_(velocity, this),
force_(force, this),
old_force_(old_force, this),
mass_(mass, this),
type_(type, this) {}
type_(type, this),
epsilon_(epsilon, this),
sigma_(sigma, this) {}

ParticleType::ParticleType(::std::unique_ptr<position_type> position, ::std::unique_ptr<velocity_type> velocity,
::std::unique_ptr<force_type> force, ::std::unique_ptr<old_force_type> old_force, const mass_type& mass,
const type_type& type)
const type_type& type, const epsilon_type& epsilon, const sigma_type& sigma)
: ::xml_schema::type(),
position_(std::move(position), this),
velocity_(std::move(velocity), this),
force_(std::move(force), this),
old_force_(std::move(old_force), this),
mass_(mass, this),
type_(type, this) {}
type_(type, this),
epsilon_(epsilon, this),
sigma_(sigma, this) {}

ParticleType::ParticleType(const ParticleType& x, ::xml_schema::flags f, ::xml_schema::container* c)
: ::xml_schema::type(x, f, c),
Expand All @@ -408,7 +425,9 @@ ParticleType::ParticleType(const ParticleType& x, ::xml_schema::flags f, ::xml_s
force_(x.force_, f, this),
old_force_(x.old_force_, f, this),
mass_(x.mass_, f, this),
type_(x.type_, f, this) {}
type_(x.type_, f, this),
epsilon_(x.epsilon_, f, this),
sigma_(x.sigma_, f, this) {}

ParticleType::ParticleType(const ::xercesc::DOMElement& e, ::xml_schema::flags f, ::xml_schema::container* c)
: ::xml_schema::type(e, f | ::xml_schema::flags::base, c),
Expand All @@ -417,7 +436,9 @@ ParticleType::ParticleType(const ::xercesc::DOMElement& e, ::xml_schema::flags f
force_(this),
old_force_(this),
mass_(this),
type_(this) {
type_(this),
epsilon_(this),
sigma_(this) {
if ((f & ::xml_schema::flags::base) == 0) {
::xsd::cxx::xml::dom::parser<char> p(e, true, false, false);
this->parse(p, f);
Expand Down Expand Up @@ -491,6 +512,24 @@ void ParticleType::parse(::xsd::cxx::xml::dom::parser<char>& p, ::xml_schema::fl
}
}

// epsilon
//
if (n.name() == "epsilon" && n.namespace_().empty()) {
if (!epsilon_.present()) {
this->epsilon_.set(epsilon_traits::create(i, f, this));
continue;
}
}

// sigma
//
if (n.name() == "sigma" && n.namespace_().empty()) {
if (!sigma_.present()) {
this->sigma_.set(sigma_traits::create(i, f, this));
continue;
}
}

break;
}

Expand All @@ -517,6 +556,14 @@ void ParticleType::parse(::xsd::cxx::xml::dom::parser<char>& p, ::xml_schema::fl
if (!type_.present()) {
throw ::xsd::cxx::tree::expected_element<char>("type", "");
}

if (!epsilon_.present()) {
throw ::xsd::cxx::tree::expected_element<char>("epsilon", "");
}

if (!sigma_.present()) {
throw ::xsd::cxx::tree::expected_element<char>("sigma", "");
}
}

ParticleType* ParticleType::_clone(::xml_schema::flags f, ::xml_schema::container* c) const { return new class ParticleType(*this, f, c); }
Expand All @@ -530,6 +577,8 @@ ParticleType& ParticleType::operator=(const ParticleType& x) {
this->old_force_ = x.old_force_;
this->mass_ = x.mass_;
this->type_ = x.type_;
this->epsilon_ = x.epsilon_;
this->sigma_ = x.sigma_;
}

return *this;
Expand Down Expand Up @@ -888,6 +937,22 @@ void operator<<(::xercesc::DOMElement& e, const ParticleType& i) {

s << i.type();
}

// epsilon
//
{
::xercesc::DOMElement& s(::xsd::cxx::xml::dom::create_element("epsilon", e));

s << ::xml_schema::as_double(i.epsilon());
}

// sigma
//
{
::xercesc::DOMElement& s(::xsd::cxx::xml::dom::create_element("sigma", e));

s << ::xml_schema::as_double(i.sigma());
}
}

#include <xsd/cxx/post.hxx>
Expand Down
Loading

0 comments on commit 4bcf016

Please sign in to comment.