Skip to content

Commit

Permalink
Updating user parameters & Removing need for postprocessed fields to …
Browse files Browse the repository at this point in the history
…have boundary conditions (#443)

* script that remove comments from *.prm

* removed comments

* remove some misc stuff

* postprocess fields don't need boundary conditions
  • Loading branch information
landinjm authored Feb 20, 2025
1 parent 64b20eb commit b78d45d
Show file tree
Hide file tree
Showing 82 changed files with 1,006 additions and 86,626 deletions.
18 changes: 9 additions & 9 deletions applications/CHAC_anisotropy/ICs_and_BCs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,24 @@ customPDE<dim, degree>::setInitialCondition([[maybe_unused]] const Point<dim> &
r = 0.0;
for (unsigned int dir = 0; dir < dim; dir++)
{
r += (p[dir] - userInputs.domain_size[dir] / 2.0) *
(p[dir] - userInputs.domain_size[dir] / 2.0);
r +=
(p[dir] - userInputs.size[dir] / 2.0) * (p[dir] - userInputs.size[dir] / 2.0);
}
r = std::sqrt(r);
double n = 0.5 * (1.0 - std::tanh((r - userInputs.domain_size[0] / 4.0) / 4.0));
scalar_IC = 0.082 * 16.0 / (userInputs.domain_size[0] / 4.0) +
(3.0 * n * n - 2.0 * n * n * n);
r = std::sqrt(r);
double n = 0.5 * (1.0 - std::tanh((r - userInputs.size[0] / 4.0) / 4.0));
scalar_IC =
0.082 * 16.0 / (userInputs.size[0] / 4.0) + (3.0 * n * n - 2.0 * n * n * n);
}
else
{
r = 0.0;
for (unsigned int dir = 0; dir < dim; dir++)
{
r += (p[dir] - userInputs.domain_size[dir] / 2.0) *
(p[dir] - userInputs.domain_size[dir] / 2.0);
r +=
(p[dir] - userInputs.size[dir] / 2.0) * (p[dir] - userInputs.size[dir] / 2.0);
}
r = std::sqrt(r);
scalar_IC = 0.5 * (1.0 - std::tanh((r - userInputs.domain_size[0] / 4.0) / 4.0));
scalar_IC = 0.5 * (1.0 - std::tanh((r - userInputs.size[0] / 4.0) / 4.0));
}

// --------------------------------------------------------------------------
Expand Down
72 changes: 0 additions & 72 deletions applications/CHAC_anisotropy/parameters.prm
Original file line number Diff line number Diff line change
@@ -1,119 +1,47 @@
# =================================================================================
# Set the number of dimensions (2 or 3 for a 2D or 3D calculation)
# =================================================================================
set Number of dimensions = 2

# =================================================================================
# Set the length of the domain in all three dimensions
# (Domain size Z ignored in 2D)
# =================================================================================
# Each axes spans from zero to the specified length
set Domain size X = 100
set Domain size Y = 100
set Domain size Z = 100

# =================================================================================
# Set the element parameters
# =================================================================================
# The number of elements in each direction is 2^(refineFactor) * subdivisions
# Subdivisions Z ignored in 2D
# For optimal performance, use refineFactor primarily to determine the element size
set Subdivisions X = 1
set Subdivisions Y = 1
set Subdivisions Z = 1

set Refine factor = 7

# Set the polynomial degree of the element (allowed values: 1, 2, or 3)
set Element degree = 1

# =================================================================================
# Set the adaptive mesh refinement parameters
# =================================================================================
# Set the flag determining if adaptive meshing is activated
set Mesh adaptivity = true

# Set the maximum and minimum level of refinement
# When adaptive meshing is enabled, the refine factor set in the block above is
# only used to generate the first pass of the mesh as the initial conditions are
# applied. It should be set somewhere between the max and min levels below.
set Max refinement level = 7
set Min refinement level = 4

# Set the number of time steps between remeshing operations
set Steps between remeshing operations = 1000

# Set the criteria for adapting the mesh
subsection Refinement criterion: n
# Select whether the mesh is refined based on the variable value (VALUE),
# its gradient (GRADIENT), or both (VALUE_AND_GRADIENT)
set Criterion type = VALUE
# Set the lower and upper bounds for the value-based refinement window
set Value lower bound = 0.001
set Value upper bound = 0.999
end

# =================================================================================
# Set the time step parameters
# =================================================================================
# The size of the time step
set Time step = 1.0e0

# The simulation ends when either the number of time steps is reached or the
# simulation time is reached.
set Number of time steps = 10000

# =================================================================================
# Set the boundary conditions
# =================================================================================
# Set the boundary condition for each variable, where each variable is given by
# its name, as defined in equations.h. The four boundary condition
# types are NATURAL, DIRICHLET, NON_UNIFORM_DIRICHLET and PERIODIC. If all
# of the boundaries have the same boundary condition, only one boundary condition
# type needs to be given. If multiple boundary condition types are needed, give a
# comma-separated list of the types. The order is the miniumum of x, maximum of x,
# minimum of y, maximum of y, minimum of z, maximum of z (i.e left, right, bottom,
# top in 2D and left, right, bottom, top, front, back in 3D). The value of a
# Dirichlet BC is specfied in the following way -- DIRCHILET: val -- where 'val' is
# the desired value. If the boundary condition is NON_UNIFORM_DIRICHLET, the
# boundary condition should be specified in the appropriate function in 'ICs_and_BCs.h'.
# Example 1: All periodic BCs for variable 'c'
# set Boundary condition for variable c = PERIODIC
# Example 2: Zero-derivative BCs on the left and right, Dirichlet BCs with value
# 1.5 on the top and bottom for variable 'n' in 2D
# set Boundary condition for variable n = NATURAL, NATURAL, DIRICHLET: 1.5, DIRICHLET: 1.5

set Boundary condition for variable c = NATURAL
set Boundary condition for variable n = NATURAL

# =================================================================================
# Set the model constants
# =================================================================================
# Set the user-defined model constants, which must have a counter-part given in
# customPDE.h. These are most often used in the residual equations in equations.h,
# but may also be used for initial conditions and nucleation calculations. The type
# options currently are DOUBLE, INT, BOOL, TENSOR, and [symmetry] ELASTIC CONSTANTS
# where [symmetry] is ISOTROPIC, TRANSVERSE, ORTHOTROPIC, or ANISOTROPIC.

# The CH mobility, McV in equations.h
set Model constant McV = 1.0, DOUBLE

# The AC mobility, MnV in equations.h
set Model constant MnV = 0.1, DOUBLE

# Anisotropy parameter
set Model constant epsilonM = 0.06, DOUBLE

# =================================================================================
# Set the output parameters
# =================================================================================
# Type of spacing between outputs ("EQUAL_SPACING", "LOG_SPACING", "N_PER_DECADE",
# or "LIST")
set Output condition = EQUAL_SPACING

# Number of times the program outputs the fields (total number for "EQUAL_SPACING"
# and "LOG_SPACING", number per decade for "N_PER_DECADE", ignored for "LIST")
set Number of outputs = 10

# The number of time steps between updates being printed to the screen
set Skip print steps = 1000
18 changes: 9 additions & 9 deletions applications/CHAC_anisotropyRegularized/ICs_and_BCs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,24 @@ customPDE<dim, degree>::setInitialCondition([[maybe_unused]] const Point<dim> &
r = 0.0;
for (unsigned int dir = 0; dir < dim; dir++)
{
r += (p[dir] - userInputs.domain_size[dir] / 2.0) *
(p[dir] - userInputs.domain_size[dir] / 2.0);
r +=
(p[dir] - userInputs.size[dir] / 2.0) * (p[dir] - userInputs.size[dir] / 2.0);
}
r = std::sqrt(r);
double n = 0.5 * (1.0 - std::tanh((r - userInputs.domain_size[0] / 4.0) / 4.0));
scalar_IC = 0.082 * 16.0 / (userInputs.domain_size[0] / 4.0) +
(3.0 * n * n - 2.0 * n * n * n);
r = std::sqrt(r);
double n = 0.5 * (1.0 - std::tanh((r - userInputs.size[0] / 4.0) / 4.0));
scalar_IC =
0.082 * 16.0 / (userInputs.size[0] / 4.0) + (3.0 * n * n - 2.0 * n * n * n);
}
else if (index == 1)
{
r = 0.0;
for (unsigned int dir = 0; dir < dim; dir++)
{
r += (p[dir] - userInputs.domain_size[dir] / 2.0) *
(p[dir] - userInputs.domain_size[dir] / 2.0);
r +=
(p[dir] - userInputs.size[dir] / 2.0) * (p[dir] - userInputs.size[dir] / 2.0);
}
r = std::sqrt(r);
scalar_IC = 0.5 * (1.0 - std::tanh((r - userInputs.domain_size[0] / 4.0) / 4.0));
scalar_IC = 0.5 * (1.0 - std::tanh((r - userInputs.size[0] / 4.0) / 4.0));
}
else
{
Expand Down
73 changes: 0 additions & 73 deletions applications/CHAC_anisotropyRegularized/parameters.prm
Original file line number Diff line number Diff line change
@@ -1,123 +1,50 @@
# =================================================================================
# Set the number of dimensions (2 or 3 for a 2D or 3D calculation)
# =================================================================================
set Number of dimensions = 2

# =================================================================================
# Set the length of the domain in all three dimensions
# (Domain size Z ignored in 2D)
# =================================================================================
# Each axes spans from zero to the specified length
set Domain size X = 100
set Domain size Y = 100
set Domain size Z = 100

# =================================================================================
# Set the element parameters
# =================================================================================
# The number of elements in each direction is 2^(refineFactor) * subdivisions
# Subdivisions Z ignored in 2D
# For optimal performance, use refineFactor primarily to determine the element size
set Subdivisions X = 1
set Subdivisions Y = 1
set Subdivisions Z = 1

set Refine factor = 7

# Set the polynomial degree of the element (allowed values: 1, 2, or 3)
set Element degree = 1

# =================================================================================
# Set the adaptive mesh refinement parameters
# =================================================================================
# Set the flag determining if adaptive meshing is activated
set Mesh adaptivity = true

# Set the maximum and minimum level of refinement
# When adaptive meshing is enabled, the refine factor set in the block above is
# only used to generate the first pass of the mesh as the initial conditions are
# applied. It should be set somewhere between the max and min levels below.
set Max refinement level = 7
set Min refinement level = 4

# Set the number of time steps between remeshing operations
set Steps between remeshing operations = 1000

# Set the criteria for adapting the mesh
subsection Refinement criterion: n
# Select whether the mesh is refined based on the variable value (VALUE),
# its gradient (GRADIENT), or both (VALUE_AND_GRADIENT)
set Criterion type = VALUE
# Set the lower and upper bounds for the value-based refinement window
set Value lower bound = 0.001
set Value upper bound = 0.999
end

# =================================================================================
# Set the time step parameters
# =================================================================================
# The size of the time step
set Time step = 5.0e-2

# The simulation ends when either the number of time steps is reached or the
# simulation time is reached.
set Number of time steps = 40000

# =================================================================================
# Set the boundary conditions
# =================================================================================
# Set the boundary condition for each variable, where each variable is given by
# its name, as defined in equations.h. The four boundary condition
# types are NATURAL, DIRICHLET, NON_UNIFORM_DIRICHLET and PERIODIC. If all
# of the boundaries have the same boundary condition, only one boundary condition
# type needs to be given. If multiple boundary condition types are needed, give a
# comma-separated list of the types. The order is the miniumum of x, maximum of x,
# minimum of y, maximum of y, minimum of z, maximum of z (i.e left, right, bottom,
# top in 2D and left, right, bottom, top, front, back in 3D). The value of a
# Dirichlet BC is specfied in the following way -- DIRCHILET: val -- where 'val' is
# the desired value. If the boundary condition is NON_UNIFORM_DIRICHLET, the
# boundary condition should be specified in the appropriate function in 'ICs_and_BCs.h'.
# Example 1: All periodic BCs for variable 'c'
# set Boundary condition for variable c = PERIODIC
# Example 2: Zero-derivative BCs on the left and right, Dirichlet BCs with value
# 1.5 on the top and bottom for variable 'n' in 2D
# set Boundary condition for variable n = NATURAL, NATURAL, DIRICHLET: 1.5, DIRICHLET: 1.5

set Boundary condition for variable c = NATURAL
set Boundary condition for variable n = NATURAL
set Boundary condition for variable biharm = NATURAL

# =================================================================================
# Set the model constants
# =================================================================================
# Set the user-defined model constants, which must have a counter-part given in
# customPDE.h. These are most often used in the residual equations in equations.h,
# but may also be used for initial conditions and nucleation calculations. The type
# options currently are DOUBLE, INT, BOOL, TENSOR, and [symmetry] ELASTIC CONSTANTS
# where [symmetry] is ISOTROPIC, TRANSVERSE, ORTHOTROPIC, or ANISOTROPIC.

# The CH mobility, McV in equations.h
set Model constant McV = 1.0, DOUBLE

# The AC mobility, MnV in equations.h
set Model constant MnV = 0.1, DOUBLE

# Anisotropy parameter
set Model constant epsilonM = 0.2, DOUBLE

# Regularization parameter
set Model constant delta2 = 1.0, DOUBLE

# =================================================================================
# Set the output parameters
# =================================================================================
# Type of spacing between outputs ("EQUAL_SPACING", "LOG_SPACING", "N_PER_DECADE",
# or "LIST")
set Output condition = EQUAL_SPACING

# Number of times the program outputs the fields (total number for "EQUAL_SPACING"
# and "LOG_SPACING", number per decade for "N_PER_DECADE", ignored for "LIST")
set Number of outputs = 10

# The number of time steps between updates being printed to the screen
set Skip print steps = 1000
Loading

0 comments on commit b78d45d

Please sign in to comment.