Skip to content

Commit

Permalink
refactored majority of variableAttributeLoader and its affected files
Browse files Browse the repository at this point in the history
compiles, runs cahnHilliard

11-12
  • Loading branch information
fractalsbyx authored and landinjm committed Nov 21, 2024
1 parent 6bcfda8 commit e509e76
Show file tree
Hide file tree
Showing 23 changed files with 545 additions and 1,175 deletions.
9 changes: 5 additions & 4 deletions applications/allenCahn_conserved/customPDE.h
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ customPDE<dim, degree>::solveIncrement(bool skip_time_dependent)
this->fields[fieldIndex].pdetype == TIME_INDEPENDENT)
{
if (this->currentIncrement % userInputs.skip_print_steps == 0 &&
userInputs.var_nonlinear[fieldIndex])
this->var_attributes.attributes.at(fieldIndex).is_nonlinear)
{
snprintf(buffer,
sizeof(buffer),
Expand All @@ -222,11 +222,12 @@ customPDE<dim, degree>::solveIncrement(bool skip_time_dependent)
}
else if (this->fields[fieldIndex].pdetype == AUXILIARY)
{
if (userInputs.var_nonlinear[fieldIndex] || nonlinear_it_index == 0)
if (this->var_attributes.attributes.at(fieldIndex).is_nonlinear ||
nonlinear_it_index == 0)
{
// If the equation for this field is nonlinear, save the
// old solution
if (userInputs.var_nonlinear[fieldIndex])
if (this->var_attributes.attributes.at(fieldIndex).is_nonlinear)
{
if (this->fields[fieldIndex].type == SCALAR)
{
Expand Down Expand Up @@ -257,7 +258,7 @@ customPDE<dim, degree>::solveIncrement(bool skip_time_dependent)
}

// Check to see if this individual variable has converged
if (userInputs.var_nonlinear[fieldIndex])
if (this->var_attributes.attributes.at(fieldIndex).is_nonlinear)
{
if (MatrixFreePDE<dim, degree>::userInputs
.nonlinear_solver_parameters.getToleranceType(
Expand Down
105 changes: 0 additions & 105 deletions include/EquationDependencyParser.h

This file was deleted.

15 changes: 4 additions & 11 deletions include/inputFileReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class inputFileReader
public:
// Constructor
inputFileReader(const std::string &input_file_name,
variableAttributeLoader &variable_attributes);
variableAttributeLoader &_variable_attributes);

// Method to get a list of entry values from multiple subsections in an input
// file
Expand All @@ -41,11 +41,8 @@ class inputFileReader

// Method to declare the parameters to be read from an input file
void
declare_parameters(dealii::ParameterHandler &parameter_handler,
const std::vector<fieldType> &var_types,
const std::vector<PDEType> &var_eq_types,
const unsigned int num_of_constants,
const std::vector<bool> &var_nucleates) const;
declare_parameters(dealii::ParameterHandler &parameter_handler,
const unsigned int num_of_constants) const;

// Method to check if a line has the desired contents and if so, extract it
bool
Expand All @@ -56,16 +53,12 @@ class inputFileReader
bool expect_equals_sign) const;

// Variables
variableAttributeLoader &variable_attributes;
dealii::ParameterHandler parameter_handler;
std::vector<fieldType> var_types;
std::vector<PDEType> var_eq_types;
unsigned int num_pp_vars;
unsigned int num_constants;
std::vector<std::string> model_constant_names;
std::vector<std::string> var_names;
unsigned int number_of_dimensions;
std::vector<bool> var_nucleates;
std::vector<bool> var_nonlinear;
};

#endif /* INCLUDE_INPUTFILEREADER_H_ */
32 changes: 0 additions & 32 deletions include/sortIndexEntryPairList.h

This file was deleted.

8 changes: 1 addition & 7 deletions include/userInputParameters.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ class userInputParameters

// Method to load in the variable attributes
void
loadVariableAttributes(variableAttributeLoader variable_attributes);
loadVariableAttributes(const variableAttributeLoader &variable_attributes);

// Nucleation attribute methods
std::vector<double>
Expand Down Expand Up @@ -252,12 +252,6 @@ class userInputParameters
// variable_attributes)
unsigned int number_of_variables;

std::vector<std::string> var_name;
std::vector<fieldType> var_type;
std::vector<PDEType> var_eq_type;

std::vector<bool> var_nonlinear;

// Variables needed to calculate the RHS
unsigned int num_var_explicit_RHS, num_var_nonexplicit_RHS;
std::vector<variable_info> varInfoListExplicitRHS, varInfoListNonexplicitRHS;
Expand Down
2 changes: 2 additions & 0 deletions include/varTypeEnums.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@

enum fieldType
{
UNDEFINED_FIELD,
SCALAR,
VECTOR
};

enum PDEType
{
UNDEFINED_PDE,
EXPLICIT_TIME_DEPENDENT,
IMPLICIT_TIME_DEPENDENT,
TIME_INDEPENDENT,
Expand Down
Loading

0 comments on commit e509e76

Please sign in to comment.