From d929714a1b83a5e90f2608721e154893ea43d86d Mon Sep 17 00:00:00 2001 From: landinjm Date: Thu, 2 Jan 2025 22:13:30 -0500 Subject: [PATCH] changing application implementation to a derived class too --- applications/CHAC_anisotropy/equations.cc | 2 +- applications/CHAC_anisotropy/postprocess.cc | 2 +- .../CHAC_anisotropyRegularized/equations.cc | 2 +- .../CHAC_anisotropyRegularized/postprocess.cc | 2 +- .../CHAC_performance_test/equations.cc | 2 +- .../CHAC_performance_test/postprocess.cc | 2 +- .../CHiMaD_benchmark1a/equations.cc | 2 +- .../CHiMaD_benchmark1a/postprocess.cc | 2 +- .../CHiMaD_benchmark1b/equations.cc | 2 +- .../CHiMaD_benchmark1b/postprocess.cc | 2 +- .../CHiMaD_benchmark1c/equations.cc | 2 +- .../CHiMaD_benchmark1c/postprocess.cc | 2 +- .../CHiMaD_benchmark2a/equations.cc | 2 +- .../CHiMaD_benchmark2a/postprocess.cc | 2 +- .../CHiMaD_benchmark3a/equations.cc | 2 +- .../CHiMaD_benchmark3a/postprocess.cc | 2 +- .../CHiMaD_benchmark6a/equations.cc | 2 +- .../CHiMaD_benchmark6a/postprocess.cc | 2 +- .../CHiMaD_benchmark6b/equations.cc | 2 +- .../CHiMaD_benchmark6b/postprocess.cc | 2 +- .../CHiMaD_benchmark7a/equations.cc | 2 +- .../CHiMaD_benchmark7a/postprocess.cc | 2 +- .../MgNd_precipitate_single_Bppp/equations.cc | 2 +- .../postprocess.cc | 2 +- applications/allenCahn/equations.cc | 2 +- applications/allenCahn/postprocess.cc | 2 +- applications/allenCahn_conserved/equations.cc | 2 +- .../allenCahn_conserved/postprocess.cc | 2 +- applications/alloySolidification/equations.cc | 2 +- .../alloySolidification/postprocess.cc | 2 +- .../alloySolidification_uniform/equations.cc | 2 +- applications/anisotropyFacet/equations.cc | 2 +- applications/anisotropyFacet/postprocess.cc | 2 +- applications/cahnHilliard/equations.cc | 2 +- applications/cahnHilliard/postprocess.cc | 2 +- applications/corrosion/equations.cc | 2 +- .../corrosion_microgalvanic/equations.cc | 2 +- .../coupledCahnHilliardAllenCahn/equations.cc | 2 +- .../postprocess.cc | 2 +- .../dendriticSolidification/equations.cc | 2 +- applications/eshelbyInclusion/equations.cc | 2 +- applications/fickianDiffusion/equations.cc | 2 +- applications/grainGrowth/equations.cc | 2 +- applications/grainGrowth/postprocess.cc | 2 +- applications/grainGrowth_dream3d/equations.cc | 2 +- .../grainGrowth_dream3d/postprocess.cc | 2 +- applications/main.cc | 12 ++-- applications/mechanics/equations.cc | 2 +- applications/nucleationModel/equations.cc | 2 +- .../nucleationModel_preferential/equations.cc | 2 +- .../precipitateEvolution/equations.cc | 2 +- .../precipitateEvolution/postprocess.cc | 2 +- .../equations.cc | 2 +- .../postprocess.cc | 2 +- .../spinodalDecomposition/equations.cc | 2 +- .../spinodalDecomposition/postprocess.cc | 2 +- .../CHAC_anisotropyRegularized/equations.cc | 2 +- .../CHAC_anisotropyRegularized/postprocess.cc | 2 +- .../CHiMaD_benchmark6a/equations.cc | 2 +- .../CHiMaD_benchmark6a/postprocess.cc | 2 +- automatic_tests/allenCahn/equations.cc | 2 +- automatic_tests/allenCahn/postprocess.cc | 2 +- automatic_tests/cahnHilliard/equations.cc | 2 +- automatic_tests/cahnHilliard/postprocess.cc | 2 +- .../corrosion_microgalvanic/equations.cc | 2 +- .../corrosion_microgalvanic/postprocess.cc | 2 +- .../coupledCahnHilliardAllenCahn/equations.cc | 2 +- .../postprocess.cc | 2 +- automatic_tests/grainGrowth/equations.cc | 2 +- automatic_tests/grainGrowth/postprocess.cc | 2 +- automatic_tests/main.cc | 13 ++-- .../precipitateEvolution/equations.cc | 2 +- .../precipitateEvolution/postprocess.cc | 2 +- .../equations.cc | 2 +- .../postprocess.cc | 2 +- .../spinodalDecomposition/equations.cc | 2 +- .../spinodalDecomposition/postprocess.cc | 2 +- include/core/variableAttributeLoader.h | 61 ++++++++++++------- src/core/variableAttributeLoader.cc | 10 +-- tests/core/nonlinearity.cc | 35 ++--------- 80 files changed, 133 insertions(+), 148 deletions(-) diff --git a/applications/CHAC_anisotropy/equations.cc b/applications/CHAC_anisotropy/equations.cc index cf26337f2..a8a365caf 100644 --- a/applications/CHAC_anisotropy/equations.cc +++ b/applications/CHAC_anisotropy/equations.cc @@ -14,7 +14,7 @@ // rate calculations. void -variableAttributeLoader::loadVariableAttributes() +customAttributeLoader::loadVariableAttributes() { // Variable 0 set_variable_name(0, "c"); diff --git a/applications/CHAC_anisotropy/postprocess.cc b/applications/CHAC_anisotropy/postprocess.cc index 4042fa6b7..9a9b9e3de 100644 --- a/applications/CHAC_anisotropy/postprocess.cc +++ b/applications/CHAC_anisotropy/postprocess.cc @@ -11,7 +11,7 @@ // member of customPDE. void -variableAttributeLoader::loadPostProcessorVariableAttributes() +customAttributeLoader::loadPostProcessorVariableAttributes() { // Variable 0 set_variable_name(0, "f_tot"); diff --git a/applications/CHAC_anisotropyRegularized/equations.cc b/applications/CHAC_anisotropyRegularized/equations.cc index 34d6efdd6..3237df286 100644 --- a/applications/CHAC_anisotropyRegularized/equations.cc +++ b/applications/CHAC_anisotropyRegularized/equations.cc @@ -14,7 +14,7 @@ // rate calculations. void -variableAttributeLoader::loadVariableAttributes() +customAttributeLoader::loadVariableAttributes() { // Variable 0 set_variable_name(0, "c"); diff --git a/applications/CHAC_anisotropyRegularized/postprocess.cc b/applications/CHAC_anisotropyRegularized/postprocess.cc index 921fc6952..769433fa9 100644 --- a/applications/CHAC_anisotropyRegularized/postprocess.cc +++ b/applications/CHAC_anisotropyRegularized/postprocess.cc @@ -11,7 +11,7 @@ // member of customPDE. void -variableAttributeLoader::loadPostProcessorVariableAttributes() +customAttributeLoader::loadPostProcessorVariableAttributes() { // Variable 0 set_variable_name(0, "f_tot"); diff --git a/applications/CHAC_performance_test/equations.cc b/applications/CHAC_performance_test/equations.cc index d05a7e466..1207100e7 100644 --- a/applications/CHAC_performance_test/equations.cc +++ b/applications/CHAC_performance_test/equations.cc @@ -14,7 +14,7 @@ // rate calculations. void -variableAttributeLoader::loadVariableAttributes() +customAttributeLoader::loadVariableAttributes() { // Variable 0 set_variable_name(0, "c"); diff --git a/applications/CHAC_performance_test/postprocess.cc b/applications/CHAC_performance_test/postprocess.cc index a2a9ab921..33a4da316 100644 --- a/applications/CHAC_performance_test/postprocess.cc +++ b/applications/CHAC_performance_test/postprocess.cc @@ -9,7 +9,7 @@ // postprocessed quantity over the entire domain. void -variableAttributeLoader::loadPostProcessorVariableAttributes() +customAttributeLoader::loadPostProcessorVariableAttributes() { // Variable 0 set_variable_name(0, "f_tot"); diff --git a/applications/CHiMaD_benchmarks/CHiMaD_benchmark1a/equations.cc b/applications/CHiMaD_benchmarks/CHiMaD_benchmark1a/equations.cc index 2d2595da7..205d73881 100644 --- a/applications/CHiMaD_benchmarks/CHiMaD_benchmark1a/equations.cc +++ b/applications/CHiMaD_benchmarks/CHiMaD_benchmark1a/equations.cc @@ -14,7 +14,7 @@ // rate calculations. void -variableAttributeLoader::loadVariableAttributes() +customAttributeLoader::loadVariableAttributes() { // Variable 0 set_variable_name(0, "c"); diff --git a/applications/CHiMaD_benchmarks/CHiMaD_benchmark1a/postprocess.cc b/applications/CHiMaD_benchmarks/CHiMaD_benchmark1a/postprocess.cc index 041e61e64..cbc7cd89f 100644 --- a/applications/CHiMaD_benchmarks/CHiMaD_benchmark1a/postprocess.cc +++ b/applications/CHiMaD_benchmarks/CHiMaD_benchmark1a/postprocess.cc @@ -11,7 +11,7 @@ // member of customPDE. void -variableAttributeLoader::loadPostProcessorVariableAttributes() +customAttributeLoader::loadPostProcessorVariableAttributes() { // Variable 0 set_variable_name(0, "f_tot"); diff --git a/applications/CHiMaD_benchmarks/CHiMaD_benchmark1b/equations.cc b/applications/CHiMaD_benchmarks/CHiMaD_benchmark1b/equations.cc index 2d2595da7..205d73881 100644 --- a/applications/CHiMaD_benchmarks/CHiMaD_benchmark1b/equations.cc +++ b/applications/CHiMaD_benchmarks/CHiMaD_benchmark1b/equations.cc @@ -14,7 +14,7 @@ // rate calculations. void -variableAttributeLoader::loadVariableAttributes() +customAttributeLoader::loadVariableAttributes() { // Variable 0 set_variable_name(0, "c"); diff --git a/applications/CHiMaD_benchmarks/CHiMaD_benchmark1b/postprocess.cc b/applications/CHiMaD_benchmarks/CHiMaD_benchmark1b/postprocess.cc index 041e61e64..cbc7cd89f 100644 --- a/applications/CHiMaD_benchmarks/CHiMaD_benchmark1b/postprocess.cc +++ b/applications/CHiMaD_benchmarks/CHiMaD_benchmark1b/postprocess.cc @@ -11,7 +11,7 @@ // member of customPDE. void -variableAttributeLoader::loadPostProcessorVariableAttributes() +customAttributeLoader::loadPostProcessorVariableAttributes() { // Variable 0 set_variable_name(0, "f_tot"); diff --git a/applications/CHiMaD_benchmarks/CHiMaD_benchmark1c/equations.cc b/applications/CHiMaD_benchmarks/CHiMaD_benchmark1c/equations.cc index 2d2595da7..205d73881 100644 --- a/applications/CHiMaD_benchmarks/CHiMaD_benchmark1c/equations.cc +++ b/applications/CHiMaD_benchmarks/CHiMaD_benchmark1c/equations.cc @@ -14,7 +14,7 @@ // rate calculations. void -variableAttributeLoader::loadVariableAttributes() +customAttributeLoader::loadVariableAttributes() { // Variable 0 set_variable_name(0, "c"); diff --git a/applications/CHiMaD_benchmarks/CHiMaD_benchmark1c/postprocess.cc b/applications/CHiMaD_benchmarks/CHiMaD_benchmark1c/postprocess.cc index 041e61e64..cbc7cd89f 100644 --- a/applications/CHiMaD_benchmarks/CHiMaD_benchmark1c/postprocess.cc +++ b/applications/CHiMaD_benchmarks/CHiMaD_benchmark1c/postprocess.cc @@ -11,7 +11,7 @@ // member of customPDE. void -variableAttributeLoader::loadPostProcessorVariableAttributes() +customAttributeLoader::loadPostProcessorVariableAttributes() { // Variable 0 set_variable_name(0, "f_tot"); diff --git a/applications/CHiMaD_benchmarks/CHiMaD_benchmark2a/equations.cc b/applications/CHiMaD_benchmarks/CHiMaD_benchmark2a/equations.cc index 6d5c200b4..b859670c6 100644 --- a/applications/CHiMaD_benchmarks/CHiMaD_benchmark2a/equations.cc +++ b/applications/CHiMaD_benchmarks/CHiMaD_benchmark2a/equations.cc @@ -14,7 +14,7 @@ // rate calculations. void -variableAttributeLoader::loadVariableAttributes() +customAttributeLoader::loadVariableAttributes() { // Variable 0 set_variable_name(0, "c"); diff --git a/applications/CHiMaD_benchmarks/CHiMaD_benchmark2a/postprocess.cc b/applications/CHiMaD_benchmarks/CHiMaD_benchmark2a/postprocess.cc index bc3c3f833..274fb2973 100644 --- a/applications/CHiMaD_benchmarks/CHiMaD_benchmark2a/postprocess.cc +++ b/applications/CHiMaD_benchmarks/CHiMaD_benchmark2a/postprocess.cc @@ -11,7 +11,7 @@ // member of customPDE. void -variableAttributeLoader::loadPostProcessorVariableAttributes() +customAttributeLoader::loadPostProcessorVariableAttributes() { // Variable 0 set_variable_name(0, "f_tot"); diff --git a/applications/CHiMaD_benchmarks/CHiMaD_benchmark3a/equations.cc b/applications/CHiMaD_benchmarks/CHiMaD_benchmark3a/equations.cc index 37f6b39f2..e49caba5c 100755 --- a/applications/CHiMaD_benchmarks/CHiMaD_benchmark3a/equations.cc +++ b/applications/CHiMaD_benchmarks/CHiMaD_benchmark3a/equations.cc @@ -14,7 +14,7 @@ // rate calculations. void -variableAttributeLoader::loadVariableAttributes() +customAttributeLoader::loadVariableAttributes() { // Variable 0 set_variable_name(0, "u"); diff --git a/applications/CHiMaD_benchmarks/CHiMaD_benchmark3a/postprocess.cc b/applications/CHiMaD_benchmarks/CHiMaD_benchmark3a/postprocess.cc index d2df2a25f..5230390bb 100755 --- a/applications/CHiMaD_benchmarks/CHiMaD_benchmark3a/postprocess.cc +++ b/applications/CHiMaD_benchmarks/CHiMaD_benchmark3a/postprocess.cc @@ -11,7 +11,7 @@ // member of customPDE. void -variableAttributeLoader::loadPostProcessorVariableAttributes() +customAttributeLoader::loadPostProcessorVariableAttributes() { // Variable 1 set_variable_name(0, "f_tot"); diff --git a/applications/CHiMaD_benchmarks/CHiMaD_benchmark6a/equations.cc b/applications/CHiMaD_benchmarks/CHiMaD_benchmark6a/equations.cc index 7e04322c0..5578eb062 100644 --- a/applications/CHiMaD_benchmarks/CHiMaD_benchmark6a/equations.cc +++ b/applications/CHiMaD_benchmarks/CHiMaD_benchmark6a/equations.cc @@ -14,7 +14,7 @@ // rate calculations. void -variableAttributeLoader::loadVariableAttributes() +customAttributeLoader::loadVariableAttributes() { // Variable 0 set_variable_name(0, "c"); diff --git a/applications/CHiMaD_benchmarks/CHiMaD_benchmark6a/postprocess.cc b/applications/CHiMaD_benchmarks/CHiMaD_benchmark6a/postprocess.cc index 7292e9eb6..f761890f1 100644 --- a/applications/CHiMaD_benchmarks/CHiMaD_benchmark6a/postprocess.cc +++ b/applications/CHiMaD_benchmarks/CHiMaD_benchmark6a/postprocess.cc @@ -11,7 +11,7 @@ // member of customPDE. void -variableAttributeLoader::loadPostProcessorVariableAttributes() +customAttributeLoader::loadPostProcessorVariableAttributes() { // Variable 0 set_variable_name(0, "f_tot"); diff --git a/applications/CHiMaD_benchmarks/CHiMaD_benchmark6b/equations.cc b/applications/CHiMaD_benchmarks/CHiMaD_benchmark6b/equations.cc index 96beda0e9..1f10a131b 100644 --- a/applications/CHiMaD_benchmarks/CHiMaD_benchmark6b/equations.cc +++ b/applications/CHiMaD_benchmarks/CHiMaD_benchmark6b/equations.cc @@ -14,7 +14,7 @@ // rate calculations. void -variableAttributeLoader::loadVariableAttributes() +customAttributeLoader::loadVariableAttributes() { // Variable 0 set_variable_name(0, "c"); diff --git a/applications/CHiMaD_benchmarks/CHiMaD_benchmark6b/postprocess.cc b/applications/CHiMaD_benchmarks/CHiMaD_benchmark6b/postprocess.cc index 7292e9eb6..f761890f1 100644 --- a/applications/CHiMaD_benchmarks/CHiMaD_benchmark6b/postprocess.cc +++ b/applications/CHiMaD_benchmarks/CHiMaD_benchmark6b/postprocess.cc @@ -11,7 +11,7 @@ // member of customPDE. void -variableAttributeLoader::loadPostProcessorVariableAttributes() +customAttributeLoader::loadPostProcessorVariableAttributes() { // Variable 0 set_variable_name(0, "f_tot"); diff --git a/applications/CHiMaD_benchmarks/CHiMaD_benchmark7a/equations.cc b/applications/CHiMaD_benchmarks/CHiMaD_benchmark7a/equations.cc index 7292ae762..b231d3637 100644 --- a/applications/CHiMaD_benchmarks/CHiMaD_benchmark7a/equations.cc +++ b/applications/CHiMaD_benchmarks/CHiMaD_benchmark7a/equations.cc @@ -14,7 +14,7 @@ // rate calculations. void -variableAttributeLoader::loadVariableAttributes() +customAttributeLoader::loadVariableAttributes() { // Variable 0 set_variable_name(0, "n"); diff --git a/applications/CHiMaD_benchmarks/CHiMaD_benchmark7a/postprocess.cc b/applications/CHiMaD_benchmarks/CHiMaD_benchmark7a/postprocess.cc index 323aee7c0..c7d71cdca 100644 --- a/applications/CHiMaD_benchmarks/CHiMaD_benchmark7a/postprocess.cc +++ b/applications/CHiMaD_benchmarks/CHiMaD_benchmark7a/postprocess.cc @@ -11,7 +11,7 @@ // member of customPDE. void -variableAttributeLoader::loadPostProcessorVariableAttributes() +customAttributeLoader::loadPostProcessorVariableAttributes() { // Variable 0 set_variable_name(0, "error_squared"); diff --git a/applications/MgNd_precipitate_single_Bppp/equations.cc b/applications/MgNd_precipitate_single_Bppp/equations.cc index ebecb287b..6f3da9890 100644 --- a/applications/MgNd_precipitate_single_Bppp/equations.cc +++ b/applications/MgNd_precipitate_single_Bppp/equations.cc @@ -14,7 +14,7 @@ // rate calculations. void -variableAttributeLoader::loadVariableAttributes() +customAttributeLoader::loadVariableAttributes() { // Variable 0 set_variable_name(0, "c"); diff --git a/applications/MgNd_precipitate_single_Bppp/postprocess.cc b/applications/MgNd_precipitate_single_Bppp/postprocess.cc index 4e00a269e..49ed8b80b 100644 --- a/applications/MgNd_precipitate_single_Bppp/postprocess.cc +++ b/applications/MgNd_precipitate_single_Bppp/postprocess.cc @@ -11,7 +11,7 @@ // member of customPDE. void -variableAttributeLoader::loadPostProcessorVariableAttributes() +customAttributeLoader::loadPostProcessorVariableAttributes() { // Variable 0 set_variable_name(0, "f_tot"); diff --git a/applications/allenCahn/equations.cc b/applications/allenCahn/equations.cc index 9ba53a23d..5b09a18c2 100644 --- a/applications/allenCahn/equations.cc +++ b/applications/allenCahn/equations.cc @@ -14,7 +14,7 @@ // rate calculations. void -variableAttributeLoader::loadVariableAttributes() +customAttributeLoader::loadVariableAttributes() { // Variable 0 set_variable_name(0, "n"); diff --git a/applications/allenCahn/postprocess.cc b/applications/allenCahn/postprocess.cc index 9dc68bc25..eecfce5b1 100644 --- a/applications/allenCahn/postprocess.cc +++ b/applications/allenCahn/postprocess.cc @@ -9,7 +9,7 @@ // postprocessed quantity over the entire domain. void -variableAttributeLoader::loadPostProcessorVariableAttributes() +customAttributeLoader::loadPostProcessorVariableAttributes() { // Variable 0 set_variable_name(0, "mg_n"); diff --git a/applications/allenCahn_conserved/equations.cc b/applications/allenCahn_conserved/equations.cc index 5e8c428f5..0391fc2f1 100644 --- a/applications/allenCahn_conserved/equations.cc +++ b/applications/allenCahn_conserved/equations.cc @@ -14,7 +14,7 @@ // rate calculations. void -variableAttributeLoader::loadVariableAttributes() +customAttributeLoader::loadVariableAttributes() { // Variable 0 set_variable_name(0, "n"); diff --git a/applications/allenCahn_conserved/postprocess.cc b/applications/allenCahn_conserved/postprocess.cc index 5b2c72361..cc8796fbe 100644 --- a/applications/allenCahn_conserved/postprocess.cc +++ b/applications/allenCahn_conserved/postprocess.cc @@ -9,7 +9,7 @@ // postprocessed quantity over the entire domain. void -variableAttributeLoader::loadPostProcessorVariableAttributes() +customAttributeLoader::loadPostProcessorVariableAttributes() { // Variable 0 set_variable_name(0, "mg_n"); diff --git a/applications/alloySolidification/equations.cc b/applications/alloySolidification/equations.cc index 0e2af5ad4..a5e5422dd 100644 --- a/applications/alloySolidification/equations.cc +++ b/applications/alloySolidification/equations.cc @@ -14,7 +14,7 @@ // rate calculations. void -variableAttributeLoader::loadVariableAttributes() +customAttributeLoader::loadVariableAttributes() { // Variable 0 set_variable_name(0, "U"); diff --git a/applications/alloySolidification/postprocess.cc b/applications/alloySolidification/postprocess.cc index 4467a101b..dd7a22757 100644 --- a/applications/alloySolidification/postprocess.cc +++ b/applications/alloySolidification/postprocess.cc @@ -11,7 +11,7 @@ // member of customPDE. void -variableAttributeLoader::loadPostProcessorVariableAttributes() +customAttributeLoader::loadPostProcessorVariableAttributes() { // Variable 0 set_variable_name(0, "c"); diff --git a/applications/alloySolidification_uniform/equations.cc b/applications/alloySolidification_uniform/equations.cc index 983c82883..5e7396e8a 100644 --- a/applications/alloySolidification_uniform/equations.cc +++ b/applications/alloySolidification_uniform/equations.cc @@ -14,7 +14,7 @@ // rate calculations. void -variableAttributeLoader::loadVariableAttributes() +customAttributeLoader::loadVariableAttributes() { // Variable 0 set_variable_name(0, "phi"); diff --git a/applications/anisotropyFacet/equations.cc b/applications/anisotropyFacet/equations.cc index 60203f10b..29b871a1a 100644 --- a/applications/anisotropyFacet/equations.cc +++ b/applications/anisotropyFacet/equations.cc @@ -16,7 +16,7 @@ // rate calculations. void -variableAttributeLoader::loadVariableAttributes() +customAttributeLoader::loadVariableAttributes() { // Variable 0 set_variable_name(0, "c"); diff --git a/applications/anisotropyFacet/postprocess.cc b/applications/anisotropyFacet/postprocess.cc index 8a8c60d66..4ccfc2f44 100644 --- a/applications/anisotropyFacet/postprocess.cc +++ b/applications/anisotropyFacet/postprocess.cc @@ -11,7 +11,7 @@ // member of customPDE. void -variableAttributeLoader::loadPostProcessorVariableAttributes() +customAttributeLoader::loadPostProcessorVariableAttributes() { // Variable 0 set_variable_name(0, "f_tot"); diff --git a/applications/cahnHilliard/equations.cc b/applications/cahnHilliard/equations.cc index 8dbe9cb53..50958e855 100644 --- a/applications/cahnHilliard/equations.cc +++ b/applications/cahnHilliard/equations.cc @@ -14,7 +14,7 @@ // rate calculations. void -variableAttributeLoader::loadVariableAttributes() +customAttributeLoader::loadVariableAttributes() { // Variable 0 set_variable_name(0, "c"); diff --git a/applications/cahnHilliard/postprocess.cc b/applications/cahnHilliard/postprocess.cc index 031f595cb..37de70929 100644 --- a/applications/cahnHilliard/postprocess.cc +++ b/applications/cahnHilliard/postprocess.cc @@ -11,7 +11,7 @@ // member of customPDE. void -variableAttributeLoader::loadPostProcessorVariableAttributes() +customAttributeLoader::loadPostProcessorVariableAttributes() { // Variable 0 set_variable_name(0, "f_tot"); diff --git a/applications/corrosion/equations.cc b/applications/corrosion/equations.cc index a583208d0..34af0a3c1 100644 --- a/applications/corrosion/equations.cc +++ b/applications/corrosion/equations.cc @@ -14,7 +14,7 @@ // rate calculations. void -variableAttributeLoader::loadVariableAttributes() +customAttributeLoader::loadVariableAttributes() { // Variable 0 set_variable_name(0, "n"); diff --git a/applications/corrosion_microgalvanic/equations.cc b/applications/corrosion_microgalvanic/equations.cc index b0b827fd3..f987ea625 100644 --- a/applications/corrosion_microgalvanic/equations.cc +++ b/applications/corrosion_microgalvanic/equations.cc @@ -17,7 +17,7 @@ using namespace std; void -variableAttributeLoader::loadVariableAttributes() +customAttributeLoader::loadVariableAttributes() { // Declaring all the model variables as follows: // domain parameter for the electrolyte - psi diff --git a/applications/coupledCahnHilliardAllenCahn/equations.cc b/applications/coupledCahnHilliardAllenCahn/equations.cc index d3e5554c9..752672590 100644 --- a/applications/coupledCahnHilliardAllenCahn/equations.cc +++ b/applications/coupledCahnHilliardAllenCahn/equations.cc @@ -14,7 +14,7 @@ // rate calculations. void -variableAttributeLoader::loadVariableAttributes() +customAttributeLoader::loadVariableAttributes() { // Variable 0 set_variable_name(0, "c"); diff --git a/applications/coupledCahnHilliardAllenCahn/postprocess.cc b/applications/coupledCahnHilliardAllenCahn/postprocess.cc index 73ec2dab4..d76620548 100644 --- a/applications/coupledCahnHilliardAllenCahn/postprocess.cc +++ b/applications/coupledCahnHilliardAllenCahn/postprocess.cc @@ -9,7 +9,7 @@ // postprocessed quantity over the entire domain. void -variableAttributeLoader::loadPostProcessorVariableAttributes() +customAttributeLoader::loadPostProcessorVariableAttributes() { // Variable 0 set_variable_name(0, "f_tot"); diff --git a/applications/dendriticSolidification/equations.cc b/applications/dendriticSolidification/equations.cc index b44731950..cf90c9f9d 100644 --- a/applications/dendriticSolidification/equations.cc +++ b/applications/dendriticSolidification/equations.cc @@ -14,7 +14,7 @@ // rate calculations. void -variableAttributeLoader::loadVariableAttributes() +customAttributeLoader::loadVariableAttributes() { // Variable 0 set_variable_name(0, "u"); diff --git a/applications/eshelbyInclusion/equations.cc b/applications/eshelbyInclusion/equations.cc index a93ea5cf0..2b0268ef5 100644 --- a/applications/eshelbyInclusion/equations.cc +++ b/applications/eshelbyInclusion/equations.cc @@ -14,7 +14,7 @@ // rate calculations. void -variableAttributeLoader::loadVariableAttributes() +customAttributeLoader::loadVariableAttributes() { // Variable 0 set_variable_name(0, "u"); diff --git a/applications/fickianDiffusion/equations.cc b/applications/fickianDiffusion/equations.cc index 95e859551..8b37e5d76 100644 --- a/applications/fickianDiffusion/equations.cc +++ b/applications/fickianDiffusion/equations.cc @@ -14,7 +14,7 @@ // rate calculations. void -variableAttributeLoader::loadVariableAttributes() +customAttributeLoader::loadVariableAttributes() { // Variable 0 set_variable_name(0, "c"); diff --git a/applications/grainGrowth/equations.cc b/applications/grainGrowth/equations.cc index 0356c47f9..9a3f41fa7 100644 --- a/applications/grainGrowth/equations.cc +++ b/applications/grainGrowth/equations.cc @@ -14,7 +14,7 @@ // rate calculations. void -variableAttributeLoader::loadVariableAttributes() +customAttributeLoader::loadVariableAttributes() { for (unsigned int var_index = 0; var_index < 6; var_index++) { diff --git a/applications/grainGrowth/postprocess.cc b/applications/grainGrowth/postprocess.cc index 1db32fc59..4c7bc605d 100644 --- a/applications/grainGrowth/postprocess.cc +++ b/applications/grainGrowth/postprocess.cc @@ -9,7 +9,7 @@ // postprocessed quantity over the entire domain. void -variableAttributeLoader::loadPostProcessorVariableAttributes() +customAttributeLoader::loadPostProcessorVariableAttributes() { // Variable 0 set_variable_name(0, "feature_ids"); diff --git a/applications/grainGrowth_dream3d/equations.cc b/applications/grainGrowth_dream3d/equations.cc index 3fa22f814..492d05f80 100644 --- a/applications/grainGrowth_dream3d/equations.cc +++ b/applications/grainGrowth_dream3d/equations.cc @@ -14,7 +14,7 @@ // rate calculations. void -variableAttributeLoader::loadVariableAttributes() +customAttributeLoader::loadVariableAttributes() { // For the input file 'parameters.in' for (unsigned int var_index = 0; var_index < 8; var_index++) diff --git a/applications/grainGrowth_dream3d/postprocess.cc b/applications/grainGrowth_dream3d/postprocess.cc index 57996e9e4..1bf9dbc4a 100644 --- a/applications/grainGrowth_dream3d/postprocess.cc +++ b/applications/grainGrowth_dream3d/postprocess.cc @@ -9,7 +9,7 @@ // postprocessed quantity over the entire domain. void -variableAttributeLoader::loadPostProcessorVariableAttributes() +customAttributeLoader::loadPostProcessorVariableAttributes() { // Variable 0 set_variable_name(0, "feature_ids"); diff --git a/applications/main.cc b/applications/main.cc index cad7b7006..f5526507c 100644 --- a/applications/main.cc +++ b/applications/main.cc @@ -2,6 +2,7 @@ #include "customPDE.h" #include "ICs_and_BCs.cc" +#include "core/variableAttributes.h" #include "equations.cc" #include @@ -13,7 +14,7 @@ # include "postprocess.cc" #else void -variableAttributeLoader::loadPostProcessorVariableAttributes() +customAttributeLoader::loadPostProcessorVariableAttributes() {} #endif @@ -62,10 +63,11 @@ main(int argc, char **argv) // postprocessing variables there are, how many sets of elastic constants // there are, and how many user-defined constants there are. - const variableAttributeLoader attribute_loader; - const AttributesList var_attributes = attribute_loader.get_var_attributes(); - const AttributesList pp_attributes = attribute_loader.get_pp_attributes(); - inputFileReader input_file_reader(parameters_filename, + customAttributeLoader attribute_loader; + attribute_loader.init_variable_attributes(); + AttributesList var_attributes = attribute_loader.get_var_attributes(); + AttributesList pp_attributes = attribute_loader.get_pp_attributes(); + inputFileReader input_file_reader(parameters_filename, var_attributes, pp_attributes); diff --git a/applications/mechanics/equations.cc b/applications/mechanics/equations.cc index 287c27407..02fb54377 100644 --- a/applications/mechanics/equations.cc +++ b/applications/mechanics/equations.cc @@ -5,7 +5,7 @@ // Set the attributes of the primary field variables // ================================================================================= void -variableAttributeLoader::loadVariableAttributes() +customAttributeLoader::loadVariableAttributes() { // Variable 2 set_variable_name(0, "u"); diff --git a/applications/nucleationModel/equations.cc b/applications/nucleationModel/equations.cc index d74c6e3a0..c50567705 100644 --- a/applications/nucleationModel/equations.cc +++ b/applications/nucleationModel/equations.cc @@ -14,7 +14,7 @@ // rate calculations. void -variableAttributeLoader::loadVariableAttributes() +customAttributeLoader::loadVariableAttributes() { // Variable 0 set_variable_name(0, "c"); diff --git a/applications/nucleationModel_preferential/equations.cc b/applications/nucleationModel_preferential/equations.cc index 637dddf4a..3230ca1cb 100644 --- a/applications/nucleationModel_preferential/equations.cc +++ b/applications/nucleationModel_preferential/equations.cc @@ -14,7 +14,7 @@ // rate calculations. void -variableAttributeLoader::loadVariableAttributes() +customAttributeLoader::loadVariableAttributes() { // Variable 0 set_variable_name(0, "c"); diff --git a/applications/precipitateEvolution/equations.cc b/applications/precipitateEvolution/equations.cc index 2277cdf5b..6c0cc483a 100644 --- a/applications/precipitateEvolution/equations.cc +++ b/applications/precipitateEvolution/equations.cc @@ -14,7 +14,7 @@ // rate calculations. void -variableAttributeLoader::loadVariableAttributes() +customAttributeLoader::loadVariableAttributes() { // Variable 0 set_variable_name(0, "c"); diff --git a/applications/precipitateEvolution/postprocess.cc b/applications/precipitateEvolution/postprocess.cc index 7c1950d64..c20ffbfda 100644 --- a/applications/precipitateEvolution/postprocess.cc +++ b/applications/precipitateEvolution/postprocess.cc @@ -11,7 +11,7 @@ // member of customPDE. void -variableAttributeLoader::loadPostProcessorVariableAttributes() +customAttributeLoader::loadPostProcessorVariableAttributes() { // Variable 0 set_variable_name(0, "f_tot"); diff --git a/applications/precipitateEvolution_pfunction/equations.cc b/applications/precipitateEvolution_pfunction/equations.cc index edaa6603b..baeb2de16 100644 --- a/applications/precipitateEvolution_pfunction/equations.cc +++ b/applications/precipitateEvolution_pfunction/equations.cc @@ -14,7 +14,7 @@ // rate calculations. void -variableAttributeLoader::loadVariableAttributes() +customAttributeLoader::loadVariableAttributes() { // Variable 0 set_variable_name(0, "c"); diff --git a/applications/precipitateEvolution_pfunction/postprocess.cc b/applications/precipitateEvolution_pfunction/postprocess.cc index 077889a5c..9393940b9 100644 --- a/applications/precipitateEvolution_pfunction/postprocess.cc +++ b/applications/precipitateEvolution_pfunction/postprocess.cc @@ -11,7 +11,7 @@ // member of customPDE. void -variableAttributeLoader::loadPostProcessorVariableAttributes() +customAttributeLoader::loadPostProcessorVariableAttributes() { // Variable 0 set_variable_name(0, "f_tot"); diff --git a/applications/spinodalDecomposition/equations.cc b/applications/spinodalDecomposition/equations.cc index 467f47544..a50154610 100644 --- a/applications/spinodalDecomposition/equations.cc +++ b/applications/spinodalDecomposition/equations.cc @@ -14,7 +14,7 @@ // rate calculations. void -variableAttributeLoader::loadVariableAttributes() +customAttributeLoader::loadVariableAttributes() { // Variable 0 set_variable_name(0, "c"); diff --git a/applications/spinodalDecomposition/postprocess.cc b/applications/spinodalDecomposition/postprocess.cc index d4486ebc6..b1e5a4c7f 100644 --- a/applications/spinodalDecomposition/postprocess.cc +++ b/applications/spinodalDecomposition/postprocess.cc @@ -11,7 +11,7 @@ // member of customPDE. void -variableAttributeLoader::loadPostProcessorVariableAttributes() +customAttributeLoader::loadPostProcessorVariableAttributes() { // Variable 0 set_variable_name(0, "f_tot"); diff --git a/automatic_tests/CHAC_anisotropyRegularized/equations.cc b/automatic_tests/CHAC_anisotropyRegularized/equations.cc index 34d6efdd6..3237df286 100644 --- a/automatic_tests/CHAC_anisotropyRegularized/equations.cc +++ b/automatic_tests/CHAC_anisotropyRegularized/equations.cc @@ -14,7 +14,7 @@ // rate calculations. void -variableAttributeLoader::loadVariableAttributes() +customAttributeLoader::loadVariableAttributes() { // Variable 0 set_variable_name(0, "c"); diff --git a/automatic_tests/CHAC_anisotropyRegularized/postprocess.cc b/automatic_tests/CHAC_anisotropyRegularized/postprocess.cc index 921fc6952..769433fa9 100644 --- a/automatic_tests/CHAC_anisotropyRegularized/postprocess.cc +++ b/automatic_tests/CHAC_anisotropyRegularized/postprocess.cc @@ -11,7 +11,7 @@ // member of customPDE. void -variableAttributeLoader::loadPostProcessorVariableAttributes() +customAttributeLoader::loadPostProcessorVariableAttributes() { // Variable 0 set_variable_name(0, "f_tot"); diff --git a/automatic_tests/CHiMaD_benchmark6a/equations.cc b/automatic_tests/CHiMaD_benchmark6a/equations.cc index 7e04322c0..5578eb062 100644 --- a/automatic_tests/CHiMaD_benchmark6a/equations.cc +++ b/automatic_tests/CHiMaD_benchmark6a/equations.cc @@ -14,7 +14,7 @@ // rate calculations. void -variableAttributeLoader::loadVariableAttributes() +customAttributeLoader::loadVariableAttributes() { // Variable 0 set_variable_name(0, "c"); diff --git a/automatic_tests/CHiMaD_benchmark6a/postprocess.cc b/automatic_tests/CHiMaD_benchmark6a/postprocess.cc index 7292e9eb6..f761890f1 100644 --- a/automatic_tests/CHiMaD_benchmark6a/postprocess.cc +++ b/automatic_tests/CHiMaD_benchmark6a/postprocess.cc @@ -11,7 +11,7 @@ // member of customPDE. void -variableAttributeLoader::loadPostProcessorVariableAttributes() +customAttributeLoader::loadPostProcessorVariableAttributes() { // Variable 0 set_variable_name(0, "f_tot"); diff --git a/automatic_tests/allenCahn/equations.cc b/automatic_tests/allenCahn/equations.cc index 9ba53a23d..5b09a18c2 100644 --- a/automatic_tests/allenCahn/equations.cc +++ b/automatic_tests/allenCahn/equations.cc @@ -14,7 +14,7 @@ // rate calculations. void -variableAttributeLoader::loadVariableAttributes() +customAttributeLoader::loadVariableAttributes() { // Variable 0 set_variable_name(0, "n"); diff --git a/automatic_tests/allenCahn/postprocess.cc b/automatic_tests/allenCahn/postprocess.cc index 9dc68bc25..eecfce5b1 100644 --- a/automatic_tests/allenCahn/postprocess.cc +++ b/automatic_tests/allenCahn/postprocess.cc @@ -9,7 +9,7 @@ // postprocessed quantity over the entire domain. void -variableAttributeLoader::loadPostProcessorVariableAttributes() +customAttributeLoader::loadPostProcessorVariableAttributes() { // Variable 0 set_variable_name(0, "mg_n"); diff --git a/automatic_tests/cahnHilliard/equations.cc b/automatic_tests/cahnHilliard/equations.cc index 8dbe9cb53..50958e855 100644 --- a/automatic_tests/cahnHilliard/equations.cc +++ b/automatic_tests/cahnHilliard/equations.cc @@ -14,7 +14,7 @@ // rate calculations. void -variableAttributeLoader::loadVariableAttributes() +customAttributeLoader::loadVariableAttributes() { // Variable 0 set_variable_name(0, "c"); diff --git a/automatic_tests/cahnHilliard/postprocess.cc b/automatic_tests/cahnHilliard/postprocess.cc index 031f595cb..37de70929 100644 --- a/automatic_tests/cahnHilliard/postprocess.cc +++ b/automatic_tests/cahnHilliard/postprocess.cc @@ -11,7 +11,7 @@ // member of customPDE. void -variableAttributeLoader::loadPostProcessorVariableAttributes() +customAttributeLoader::loadPostProcessorVariableAttributes() { // Variable 0 set_variable_name(0, "f_tot"); diff --git a/automatic_tests/corrosion_microgalvanic/equations.cc b/automatic_tests/corrosion_microgalvanic/equations.cc index b0b827fd3..f987ea625 100644 --- a/automatic_tests/corrosion_microgalvanic/equations.cc +++ b/automatic_tests/corrosion_microgalvanic/equations.cc @@ -17,7 +17,7 @@ using namespace std; void -variableAttributeLoader::loadVariableAttributes() +customAttributeLoader::loadVariableAttributes() { // Declaring all the model variables as follows: // domain parameter for the electrolyte - psi diff --git a/automatic_tests/corrosion_microgalvanic/postprocess.cc b/automatic_tests/corrosion_microgalvanic/postprocess.cc index 928a6dae1..2e194a691 100644 --- a/automatic_tests/corrosion_microgalvanic/postprocess.cc +++ b/automatic_tests/corrosion_microgalvanic/postprocess.cc @@ -9,7 +9,7 @@ // postprocessed quantity over the entire domain. void -variableAttributeLoader::loadPostProcessorVariableAttributes() +customAttributeLoader::loadPostProcessorVariableAttributes() { // Variable 0 set_variable_name(0, "f_tot"); diff --git a/automatic_tests/coupledCahnHilliardAllenCahn/equations.cc b/automatic_tests/coupledCahnHilliardAllenCahn/equations.cc index d3e5554c9..752672590 100644 --- a/automatic_tests/coupledCahnHilliardAllenCahn/equations.cc +++ b/automatic_tests/coupledCahnHilliardAllenCahn/equations.cc @@ -14,7 +14,7 @@ // rate calculations. void -variableAttributeLoader::loadVariableAttributes() +customAttributeLoader::loadVariableAttributes() { // Variable 0 set_variable_name(0, "c"); diff --git a/automatic_tests/coupledCahnHilliardAllenCahn/postprocess.cc b/automatic_tests/coupledCahnHilliardAllenCahn/postprocess.cc index 73ec2dab4..d76620548 100644 --- a/automatic_tests/coupledCahnHilliardAllenCahn/postprocess.cc +++ b/automatic_tests/coupledCahnHilliardAllenCahn/postprocess.cc @@ -9,7 +9,7 @@ // postprocessed quantity over the entire domain. void -variableAttributeLoader::loadPostProcessorVariableAttributes() +customAttributeLoader::loadPostProcessorVariableAttributes() { // Variable 0 set_variable_name(0, "f_tot"); diff --git a/automatic_tests/grainGrowth/equations.cc b/automatic_tests/grainGrowth/equations.cc index 0356c47f9..9a3f41fa7 100644 --- a/automatic_tests/grainGrowth/equations.cc +++ b/automatic_tests/grainGrowth/equations.cc @@ -14,7 +14,7 @@ // rate calculations. void -variableAttributeLoader::loadVariableAttributes() +customAttributeLoader::loadVariableAttributes() { for (unsigned int var_index = 0; var_index < 6; var_index++) { diff --git a/automatic_tests/grainGrowth/postprocess.cc b/automatic_tests/grainGrowth/postprocess.cc index b7e77abea..e64567fc0 100644 --- a/automatic_tests/grainGrowth/postprocess.cc +++ b/automatic_tests/grainGrowth/postprocess.cc @@ -9,7 +9,7 @@ // postprocessed quantity over the entire domain. void -variableAttributeLoader::loadPostProcessorVariableAttributes() +customAttributeLoader::loadPostProcessorVariableAttributes() { // Variable 0 set_variable_name(0, "feature_ids"); diff --git a/automatic_tests/main.cc b/automatic_tests/main.cc index 1bc0af127..f5526507c 100644 --- a/automatic_tests/main.cc +++ b/automatic_tests/main.cc @@ -2,19 +2,19 @@ #include "customPDE.h" #include "ICs_and_BCs.cc" +#include "core/variableAttributes.h" #include "equations.cc" #include #include #include -#include // Header file for postprocessing that may or may not exist #ifdef POSTPROCESS_FILE_EXISTS # include "postprocess.cc" #else void -variableAttributeLoader::loadPostProcessorVariableAttributes() +customAttributeLoader::loadPostProcessorVariableAttributes() {} #endif @@ -63,10 +63,11 @@ main(int argc, char **argv) // postprocessing variables there are, how many sets of elastic constants // there are, and how many user-defined constants there are. - const variableAttributeLoader attribute_loader; - const AttributesList var_attributes = attribute_loader.get_var_attributes(); - const AttributesList pp_attributes = attribute_loader.get_pp_attributes(); - inputFileReader input_file_reader(parameters_filename, + customAttributeLoader attribute_loader; + attribute_loader.init_variable_attributes(); + AttributesList var_attributes = attribute_loader.get_var_attributes(); + AttributesList pp_attributes = attribute_loader.get_pp_attributes(); + inputFileReader input_file_reader(parameters_filename, var_attributes, pp_attributes); diff --git a/automatic_tests/precipitateEvolution/equations.cc b/automatic_tests/precipitateEvolution/equations.cc index 2277cdf5b..6c0cc483a 100644 --- a/automatic_tests/precipitateEvolution/equations.cc +++ b/automatic_tests/precipitateEvolution/equations.cc @@ -14,7 +14,7 @@ // rate calculations. void -variableAttributeLoader::loadVariableAttributes() +customAttributeLoader::loadVariableAttributes() { // Variable 0 set_variable_name(0, "c"); diff --git a/automatic_tests/precipitateEvolution/postprocess.cc b/automatic_tests/precipitateEvolution/postprocess.cc index 7c1950d64..c20ffbfda 100644 --- a/automatic_tests/precipitateEvolution/postprocess.cc +++ b/automatic_tests/precipitateEvolution/postprocess.cc @@ -11,7 +11,7 @@ // member of customPDE. void -variableAttributeLoader::loadPostProcessorVariableAttributes() +customAttributeLoader::loadPostProcessorVariableAttributes() { // Variable 0 set_variable_name(0, "f_tot"); diff --git a/automatic_tests/precipitateEvolution_pfunction/equations.cc b/automatic_tests/precipitateEvolution_pfunction/equations.cc index edaa6603b..baeb2de16 100644 --- a/automatic_tests/precipitateEvolution_pfunction/equations.cc +++ b/automatic_tests/precipitateEvolution_pfunction/equations.cc @@ -14,7 +14,7 @@ // rate calculations. void -variableAttributeLoader::loadVariableAttributes() +customAttributeLoader::loadVariableAttributes() { // Variable 0 set_variable_name(0, "c"); diff --git a/automatic_tests/precipitateEvolution_pfunction/postprocess.cc b/automatic_tests/precipitateEvolution_pfunction/postprocess.cc index 077889a5c..9393940b9 100644 --- a/automatic_tests/precipitateEvolution_pfunction/postprocess.cc +++ b/automatic_tests/precipitateEvolution_pfunction/postprocess.cc @@ -11,7 +11,7 @@ // member of customPDE. void -variableAttributeLoader::loadPostProcessorVariableAttributes() +customAttributeLoader::loadPostProcessorVariableAttributes() { // Variable 0 set_variable_name(0, "f_tot"); diff --git a/automatic_tests/spinodalDecomposition/equations.cc b/automatic_tests/spinodalDecomposition/equations.cc index 467f47544..a50154610 100644 --- a/automatic_tests/spinodalDecomposition/equations.cc +++ b/automatic_tests/spinodalDecomposition/equations.cc @@ -14,7 +14,7 @@ // rate calculations. void -variableAttributeLoader::loadVariableAttributes() +customAttributeLoader::loadVariableAttributes() { // Variable 0 set_variable_name(0, "c"); diff --git a/automatic_tests/spinodalDecomposition/postprocess.cc b/automatic_tests/spinodalDecomposition/postprocess.cc index d4486ebc6..b1e5a4c7f 100644 --- a/automatic_tests/spinodalDecomposition/postprocess.cc +++ b/automatic_tests/spinodalDecomposition/postprocess.cc @@ -11,7 +11,7 @@ // member of customPDE. void -variableAttributeLoader::loadPostProcessorVariableAttributes() +customAttributeLoader::loadPostProcessorVariableAttributes() { // Variable 0 set_variable_name(0, "f_tot"); diff --git a/include/core/variableAttributeLoader.h b/include/core/variableAttributeLoader.h index fe5b8f957..926ca033d 100644 --- a/include/core/variableAttributeLoader.h +++ b/include/core/variableAttributeLoader.h @@ -15,16 +15,36 @@ class variableAttributeLoader { public: /** - * \brief Constructor. Executes the user-facing functions and constructs the variable - * attributes. + * \brief Constructor. */ - variableAttributeLoader(); + variableAttributeLoader() = default; /** * \brief Destructor. */ virtual ~variableAttributeLoader() = default; + /** + * \brief Initialize the variable attributes from the two user-facing methods + * `loadVariableAttributes()` and `loadPostProcessorVariableAttributes()`. This must be + * called after the default constructor for derived classes. + */ + void + init_variable_attributes(); + + /** + * \brief getter function for variable attributes list (copy). + */ + [[nodiscard]] AttributesList + get_var_attributes() const; + + /** + * \brief getter function for postprocessing attributes list (copy). + */ + [[nodiscard]] AttributesList + get_pp_attributes() const; + +protected: /** * \brief User-facing method where the variable attributes are set. */ @@ -197,26 +217,6 @@ class variableAttributeLoader void set_output_integral(const unsigned int &index, const bool &flag) const; - /** - * \brief getter function for variable attributes list (copy). - */ - [[nodiscard]] AttributesList - get_var_attributes() const; - - /** - * \brief getter function for postprocessing attributes list (copy). - */ - [[nodiscard]] AttributesList - get_pp_attributes() const; - -protected: - /** - * \brief Initialize the attributes of the variables. This is done is the constructor of - * this class and must be called in constructors of child classes. - */ - void - init_attributes(); - private: /** * \brief The solutions variable attributes @@ -292,4 +292,19 @@ class variableAttributeLoader // The above function should be moved to a 'utilities' module }; +// Template derived class for variableAttributeLoader for applications. +// `loadVariableAttributes()` and `loadPostProcessorVariableAttributes()` are should be +// filled out in all the applications. +class customAttributeLoader : public variableAttributeLoader +{ +public: + ~customAttributeLoader() override = default; + + void + loadVariableAttributes() override; + + void + loadPostProcessorVariableAttributes() override; +}; + #endif diff --git a/src/core/variableAttributeLoader.cc b/src/core/variableAttributeLoader.cc index c02ff0407..f81658865 100644 --- a/src/core/variableAttributeLoader.cc +++ b/src/core/variableAttributeLoader.cc @@ -3,14 +3,6 @@ #include -// NOLINTBEGIN(cppcoreguidelines-prefer-member-initializer) -variableAttributeLoader::variableAttributeLoader() -{ - this->init_attributes(); -} - -// NOLINTEND(cppcoreguidelines-prefer-member-initializer) - void variableAttributeLoader::loadVariableAttributes() {} @@ -20,7 +12,7 @@ variableAttributeLoader::loadPostProcessorVariableAttributes() {} void -variableAttributeLoader::init_attributes() +variableAttributeLoader::init_variable_attributes() { relevant_attributes = &var_attributes; loadVariableAttributes(); diff --git a/tests/core/nonlinearity.cc b/tests/core/nonlinearity.cc index e33cdf43a..b73624d4a 100644 --- a/tests/core/nonlinearity.cc +++ b/tests/core/nonlinearity.cc @@ -25,11 +25,6 @@ TEST_CASE("Nonlinearity criterion") class testVariableAttributeLoader : public variableAttributeLoader { public: - testVariableAttributeLoader() - { - this->init_attributes(); - } - ~testVariableAttributeLoader() override = default; void @@ -60,7 +55,7 @@ TEST_CASE("Nonlinearity criterion") }; testVariableAttributeLoader attributes; - + attributes.init_variable_attributes(); AttributesList main_variables = attributes.get_var_attributes(); AttributesList pp_variables = attributes.get_pp_attributes(); @@ -94,11 +89,6 @@ TEST_CASE("Nonlinearity criterion") class testVariableAttributeLoader : public variableAttributeLoader { public: - testVariableAttributeLoader() - { - this->init_attributes(); - } - ~testVariableAttributeLoader() override = default; void @@ -148,7 +138,7 @@ TEST_CASE("Nonlinearity criterion") }; testVariableAttributeLoader attributes; - + attributes.init_variable_attributes(); AttributesList main_variables = attributes.get_var_attributes(); AttributesList pp_variables = attributes.get_pp_attributes(); @@ -173,11 +163,6 @@ TEST_CASE("Nonlinearity criterion") class testVariableAttributeLoader : public variableAttributeLoader { public: - testVariableAttributeLoader() - { - this->init_attributes(); - } - ~testVariableAttributeLoader() override = default; void @@ -200,7 +185,7 @@ TEST_CASE("Nonlinearity criterion") }; testVariableAttributeLoader attributes; - + attributes.init_variable_attributes(); AttributesList main_variables = attributes.get_var_attributes(); AttributesList pp_variables = attributes.get_pp_attributes(); @@ -222,11 +207,6 @@ TEST_CASE("Nonlinearity criterion") class testVariableAttributeLoader : public variableAttributeLoader { public: - testVariableAttributeLoader() - { - this->init_attributes(); - } - ~testVariableAttributeLoader() override = default; void @@ -259,7 +239,7 @@ TEST_CASE("Nonlinearity criterion") }; testVariableAttributeLoader attributes; - + attributes.init_variable_attributes(); AttributesList main_variables = attributes.get_var_attributes(); AttributesList pp_variables = attributes.get_pp_attributes(); @@ -283,11 +263,6 @@ TEST_CASE("Nonlinearity criterion") class testVariableAttributeLoader : public variableAttributeLoader { public: - testVariableAttributeLoader() - { - this->init_attributes(); - } - ~testVariableAttributeLoader() override = default; void @@ -329,7 +304,7 @@ TEST_CASE("Nonlinearity criterion") }; testVariableAttributeLoader attributes; - + attributes.init_variable_attributes(); AttributesList main_variables = attributes.get_var_attributes(); AttributesList pp_variables = attributes.get_pp_attributes();