Skip to content

Commit

Permalink
improved the non-uniform dirichlet BC description in ICs_and_BCs.h
Browse files Browse the repository at this point in the history
  • Loading branch information
stvdwtt committed Aug 23, 2017
1 parent b88cf52 commit a543aa7
Show file tree
Hide file tree
Showing 22 changed files with 250 additions and 82 deletions.
16 changes: 12 additions & 4 deletions applications/CHAC_anisotropy/ICs_and_BCs.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,14 @@ double NonUniformDirichletBC<dim>::value (const dealii::Point<dim> &p, const uns
// --------------------------------------------------------------------------
// ENTER THE NON-UNIFORM DIRICHLET BOUNDARY CONDITIONS HERE FOR SCALAR FIELDS
// --------------------------------------------------------------------------
// Enter the function describing conditions for the fields at point "p".
// Enter the function describing conditions for the fields at point "p".
// Use "if" statements to set the boundary condition for each variable
// according to its variable index. This function can be left blank if there
// are no non-uniform Dirichlet boundary conditions.
// are no non-uniform Dirichlet boundary conditions. For BCs that change in
// time, you can access the current time through the variable "time". The
// boundary index can be accessed via the variable "direction", which starts
// at zero and uses the same order as the BC specification in parameters.in
// (i.e. left = 0, right = 1, bottom = 2, top = 3, front = 4, back = 5).


// -------------------------------------------------------------------------
Expand All @@ -80,10 +84,14 @@ void NonUniformDirichletBCVec<dim>::vector_value (const dealii::Point<dim> &p, d
// --------------------------------------------------------------------------
// ENTER THE NON-UNIFORM DIRICHLET BOUNDARY CONDITIONS HERE FOR VECTOR FIELDS
// --------------------------------------------------------------------------
// Enter the function describing conditions for the fields at point "p".
// Enter the function describing conditions for the fields at point "p".
// Use "if" statements to set the boundary condition for each variable
// according to its variable index. This function can be left blank if there
// are no non-uniform Dirichlet boundary conditions.
// are no non-uniform Dirichlet boundary conditions. For BCs that change in
// time, you can access the current time through the variable "time". The
// boundary index can be accessed via the variable "direction", which starts
// at zero and uses the same order as the BC specification in parameters.in
// (i.e. left = 0, right = 1, bottom = 2, top = 3, front = 4, back = 5).


// -------------------------------------------------------------------------
Expand Down
15 changes: 11 additions & 4 deletions applications/CHAC_anisotropyRegularized/ICs_and_BCs.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,14 @@ double NonUniformDirichletBC<dim>::value (const dealii::Point<dim> &p, const uns
// --------------------------------------------------------------------------
// ENTER THE NON-UNIFORM DIRICHLET BOUNDARY CONDITIONS HERE FOR SCALAR FIELDS
// --------------------------------------------------------------------------
// Enter the function describing conditions for the fields at point "p".
// Enter the function describing conditions for the fields at point "p".
// Use "if" statements to set the boundary condition for each variable
// according to its variable index. This function can be left blank if there
// are no non-uniform Dirichlet boundary conditions.

// are no non-uniform Dirichlet boundary conditions. For BCs that change in
// time, you can access the current time through the variable "time". The
// boundary index can be accessed via the variable "direction", which starts
// at zero and uses the same order as the BC specification in parameters.in
// (i.e. left = 0, right = 1, bottom = 2, top = 3, front = 4, back = 5).

// -------------------------------------------------------------------------
return scalar_BC;
Expand All @@ -87,7 +90,11 @@ void NonUniformDirichletBCVec<dim>::vector_value (const dealii::Point<dim> &p, d
// Enter the function describing conditions for the fields at point "p".
// Use "if" statements to set the boundary condition for each variable
// according to its variable index. This function can be left blank if there
// are no non-uniform Dirichlet boundary conditions.
// are no non-uniform Dirichlet boundary conditions. For BCs that change in
// time, you can access the current time through the variable "time". The
// boundary index can be accessed via the variable "direction", which starts
// at zero and uses the same order as the BC specification in parameters.in
// (i.e. left = 0, right = 1, bottom = 2, top = 3, front = 4, back = 5).


// -------------------------------------------------------------------------
Expand Down
13 changes: 10 additions & 3 deletions applications/CHiMaD_benchmark1a/ICs_and_BCs.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,11 @@ double NonUniformDirichletBC<dim>::value (const dealii::Point<dim> &p, const uns
// Enter the function describing conditions for the fields at point "p".
// Use "if" statements to set the boundary condition for each variable
// according to its variable index. This function can be left blank if there
// are no non-uniform Dirichlet boundary conditions.
// are no non-uniform Dirichlet boundary conditions. For BCs that change in
// time, you can access the current time through the variable "time". The
// boundary index can be accessed via the variable "direction", which starts
// at zero and uses the same order as the BC specification in parameters.in
// (i.e. left = 0, right = 1, bottom = 2, top = 3, front = 4, back = 5).


// -------------------------------------------------------------------------
Expand All @@ -75,8 +79,11 @@ void NonUniformDirichletBCVec<dim>::vector_value (const dealii::Point<dim> &p, d
// Enter the function describing conditions for the fields at point "p".
// Use "if" statements to set the boundary condition for each variable
// according to its variable index. This function can be left blank if there
// are no non-uniform Dirichlet boundary conditions.

// are no non-uniform Dirichlet boundary conditions. For BCs that change in
// time, you can access the current time through the variable "time". The
// boundary index can be accessed via the variable "direction", which starts
// at zero and uses the same order as the BC specification in parameters.in
// (i.e. left = 0, right = 1, bottom = 2, top = 3, front = 4, back = 5).

// -------------------------------------------------------------------------

Expand Down
14 changes: 11 additions & 3 deletions applications/CHiMaD_benchmark2a/ICs_and_BCs.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,14 @@ double NonUniformDirichletBC<dim>::value (const dealii::Point<dim> &p, const uns
// --------------------------------------------------------------------------
// ENTER THE NON-UNIFORM DIRICHLET BOUNDARY CONDITIONS HERE FOR SCALAR FIELDS
// --------------------------------------------------------------------------
// Enter the function describing conditions for the fields at point "p".
// Enter the function describing conditions for the fields at point "p".
// Use "if" statements to set the boundary condition for each variable
// according to its variable index. This function can be left blank if there
// are no non-uniform Dirichlet boundary conditions.
// are no non-uniform Dirichlet boundary conditions. For BCs that change in
// time, you can access the current time through the variable "time". The
// boundary index can be accessed via the variable "direction", which starts
// at zero and uses the same order as the BC specification in parameters.in
// (i.e. left = 0, right = 1, bottom = 2, top = 3, front = 4, back = 5).


// -------------------------------------------------------------------------
Expand All @@ -110,7 +114,11 @@ void NonUniformDirichletBCVec<dim>::vector_value (const dealii::Point<dim> &p, d
// Enter the function describing conditions for the fields at point "p".
// Use "if" statements to set the boundary condition for each variable
// according to its variable index. This function can be left blank if there
// are no non-uniform Dirichlet boundary conditions.
// are no non-uniform Dirichlet boundary conditions. For BCs that change in
// time, you can access the current time through the variable "time". The
// boundary index can be accessed via the variable "direction", which starts
// at zero and uses the same order as the BC specification in parameters.in
// (i.e. left = 0, right = 1, bottom = 2, top = 3, front = 4, back = 5).


// -------------------------------------------------------------------------
Expand Down
28 changes: 18 additions & 10 deletions applications/CHiMaD_benchmark6a/ICs_and_BCs.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ double InitialCondition<dim>::value (const dealii::Point<dim> &p, const unsigned
double y=p[1];
double c0=0.5;
double c1=0.04;

double t1=std::cos(0.2*x)*std::cos(0.11*y);
double t2=std::cos(0.13*x)*std::cos(0.087*y)*std::cos(0.13*x)*std::cos(0.087*y);
double t3=std::cos(0.025*x-0.15*y)*std::cos(0.07*x-0.02*y);

scalar_IC = c0 + c1*(t1+t2+t3);
}
else {
Expand Down Expand Up @@ -62,8 +62,12 @@ double NonUniformDirichletBC<dim>::value (const dealii::Point<dim> &p, const uns
// Enter the function describing conditions for the fields at point "p".
// Use "if" statements to set the boundary condition for each variable
// according to its variable index. This function can be left blank if there
// are no non-uniform Dirichlet boundary conditions.

// are no non-uniform Dirichlet boundary conditions. For BCs that change in
// time, you can access the current time through the variable "time". The
// boundary index can be accessed via the variable "direction", which starts
// at zero and uses the same order as the BC specification in parameters.in
// (i.e. left = 0, right = 1, bottom = 2, top = 3, front = 4, back = 5).

if (index == 2){
if (direction == 1){
double x=p[0];
Expand All @@ -78,16 +82,20 @@ double NonUniformDirichletBC<dim>::value (const dealii::Point<dim> &p, const uns
template <int dim>
void NonUniformDirichletBCVec<dim>::vector_value (const dealii::Point<dim> &p, dealii::Vector<double> &vector_BC) const
{

// --------------------------------------------------------------------------
// ENTER THE NON-UNIFORM DIRICHLET BOUNDARY CONDITIONS HERE FOR VECTOR FIELDS
// --------------------------------------------------------------------------
// Enter the function describing conditions for the fields at point "p".
// Use "if" statements to set the boundary condition for each variable
// according to its variable index. This function can be left blank if there
// are no non-uniform Dirichlet boundary conditions.


// are no non-uniform Dirichlet boundary conditions. For BCs that change in
// time, you can access the current time through the variable "time". The
// boundary index can be accessed via the variable "direction", which starts
// at zero and uses the same order as the BC specification in parameters.in
// (i.e. left = 0, right = 1, bottom = 2, top = 3, front = 4, back = 5).


// -------------------------------------------------------------------------
}

}
28 changes: 18 additions & 10 deletions applications/CHiMaD_benchmark6b/ICs_and_BCs.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ double InitialCondition<dim>::value (const dealii::Point<dim> &p, const unsigned
double y=p[1];
double c0=0.5;
double c1=0.04;

double t1=std::cos(0.2*x)*std::cos(0.11*y);
double t2=std::cos(0.13*x)*std::cos(0.087*y)*std::cos(0.13*x)*std::cos(0.087*y);
double t3=std::cos(0.025*x-0.15*y)*std::cos(0.07*x-0.02*y);

scalar_IC = c0 + c1*(t1+t2+t3);
}
else {
Expand Down Expand Up @@ -62,8 +62,12 @@ double NonUniformDirichletBC<dim>::value (const dealii::Point<dim> &p, const uns
// Enter the function describing conditions for the fields at point "p".
// Use "if" statements to set the boundary condition for each variable
// according to its variable index. This function can be left blank if there
// are no non-uniform Dirichlet boundary conditions.

// are no non-uniform Dirichlet boundary conditions. For BCs that change in
// time, you can access the current time through the variable "time". The
// boundary index can be accessed via the variable "direction", which starts
// at zero and uses the same order as the BC specification in parameters.in
// (i.e. left = 0, right = 1, bottom = 2, top = 3, front = 4, back = 5).

if (index == 2){
if (direction == 1){
double x=p[0];
Expand All @@ -78,16 +82,20 @@ double NonUniformDirichletBC<dim>::value (const dealii::Point<dim> &p, const uns
template <int dim>
void NonUniformDirichletBCVec<dim>::vector_value (const dealii::Point<dim> &p, dealii::Vector<double> &vector_BC) const
{

// --------------------------------------------------------------------------
// ENTER THE NON-UNIFORM DIRICHLET BOUNDARY CONDITIONS HERE FOR VECTOR FIELDS
// --------------------------------------------------------------------------
// Enter the function describing conditions for the fields at point "p".
// Use "if" statements to set the boundary condition for each variable
// according to its variable index. This function can be left blank if there
// are no non-uniform Dirichlet boundary conditions.


// are no non-uniform Dirichlet boundary conditions. For BCs that change in
// time, you can access the current time through the variable "time". The
// boundary index can be accessed via the variable "direction", which starts
// at zero and uses the same order as the BC specification in parameters.in
// (i.e. left = 0, right = 1, bottom = 2, top = 3, front = 4, back = 5).


// -------------------------------------------------------------------------
}

}
13 changes: 10 additions & 3 deletions applications/allenCahn/ICs_and_BCs.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,11 @@ double NonUniformDirichletBC<dim>::value (const dealii::Point<dim> &p, const uns
// Enter the function describing conditions for the fields at point "p".
// Use "if" statements to set the boundary condition for each variable
// according to its variable index. This function can be left blank if there
// are no non-uniform Dirichlet boundary conditions.
// are no non-uniform Dirichlet boundary conditions. For BCs that change in
// time, you can access the current time through the variable "time". The
// boundary index can be accessed via the variable "direction", which starts
// at zero and uses the same order as the BC specification in parameters.in
// (i.e. left = 0, right = 1, bottom = 2, top = 3, front = 4, back = 5).


// -------------------------------------------------------------------------
Expand All @@ -81,8 +85,11 @@ void NonUniformDirichletBCVec<dim>::vector_value (const dealii::Point<dim> &p, d
// Enter the function describing conditions for the fields at point "p".
// Use "if" statements to set the boundary condition for each variable
// according to its variable index. This function can be left blank if there
// are no non-uniform Dirichlet boundary conditions.

// are no non-uniform Dirichlet boundary conditions. For BCs that change in
// time, you can access the current time through the variable "time". The
// boundary index can be accessed via the variable "direction", which starts
// at zero and uses the same order as the BC specification in parameters.in
// (i.e. left = 0, right = 1, bottom = 2, top = 3, front = 4, back = 5).

// -------------------------------------------------------------------------

Expand Down
13 changes: 10 additions & 3 deletions applications/allenCahn_pfield/ICs_and_BCs.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,11 @@ double NonUniformDirichletBC<dim>::value (const dealii::Point<dim> &p, const uns
// Enter the function describing conditions for the fields at point "p".
// Use "if" statements to set the boundary condition for each variable
// according to its variable index. This function can be left blank if there
// are no non-uniform Dirichlet boundary conditions.

// are no non-uniform Dirichlet boundary conditions. For BCs that change in
// time, you can access the current time through the variable "time". The
// boundary index can be accessed via the variable "direction", which starts
// at zero and uses the same order as the BC specification in parameters.in
// (i.e. left = 0, right = 1, bottom = 2, top = 3, front = 4, back = 5).

// -------------------------------------------------------------------------
return scalar_BC;
Expand All @@ -81,7 +84,11 @@ void NonUniformDirichletBCVec<dim>::vector_value (const dealii::Point<dim> &p, d
// Enter the function describing conditions for the fields at point "p".
// Use "if" statements to set the boundary condition for each variable
// according to its variable index. This function can be left blank if there
// are no non-uniform Dirichlet boundary conditions.
// are no non-uniform Dirichlet boundary conditions. For BCs that change in
// time, you can access the current time through the variable "time". The
// boundary index can be accessed via the variable "direction", which starts
// at zero and uses the same order as the BC specification in parameters.in
// (i.e. left = 0, right = 1, bottom = 2, top = 3, front = 4, back = 5).


// -------------------------------------------------------------------------
Expand Down
17 changes: 12 additions & 5 deletions applications/anisotropyFacet/ICs_and_BCs.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,14 @@ double NonUniformDirichletBC<dim>::value (const dealii::Point<dim> &p, const uns
// --------------------------------------------------------------------------
// ENTER THE NON-UNIFORM DIRICHLET BOUNDARY CONDITIONS HERE FOR SCALAR FIELDS
// --------------------------------------------------------------------------
// Enter the function describing conditions for the fields at point "p".
// Enter the function describing conditions for the fields at point "p".
// Use "if" statements to set the boundary condition for each variable
// according to its variable index. This function can be left blank if there
// are no non-uniform Dirichlet boundary conditions.
// are no non-uniform Dirichlet boundary conditions. For BCs that change in
// time, you can access the current time through the variable "time". The
// boundary index can be accessed via the variable "direction", which starts
// at zero and uses the same order as the BC specification in parameters.in
// (i.e. left = 0, right = 1, bottom = 2, top = 3, front = 4, back = 5).


// -------------------------------------------------------------------------
Expand All @@ -84,11 +88,14 @@ void NonUniformDirichletBCVec<dim>::vector_value (const dealii::Point<dim> &p, d
// --------------------------------------------------------------------------
// ENTER THE NON-UNIFORM DIRICHLET BOUNDARY CONDITIONS HERE FOR VECTOR FIELDS
// --------------------------------------------------------------------------
// Enter the function describing conditions for the fields at point "p".
// Enter the function describing conditions for the fields at point "p".
// Use "if" statements to set the boundary condition for each variable
// according to its variable index. This function can be left blank if there
// are no non-uniform Dirichlet boundary conditions.

// are no non-uniform Dirichlet boundary conditions. For BCs that change in
// time, you can access the current time through the variable "time". The
// boundary index can be accessed via the variable "direction", which starts
// at zero and uses the same order as the BC specification in parameters.in
// (i.e. left = 0, right = 1, bottom = 2, top = 3, front = 4, back = 5).

// -------------------------------------------------------------------------

Expand Down
Loading

0 comments on commit a543aa7

Please sign in to comment.