<commit_before>/* -*-  mode: c++; c-default-style: "google"; indent-tabs-mode: nil -*- */
/* -------------------------------------------------------------------------
   ATS

   License: see $ATS_DIR/COPYRIGHT
   Author: <NAME>

   Implementation for the NullEnergy PK.  This PK simply provides a constant
   temperature, and is provided for testing with other PKs that depend upon an
   energy equation.  This could easily be provided by the state as an independent
   variable, but this is nice for testing the full hierarchy with a simple PK.

   Example usage:

   <ParameterList name="energy">
   <Parameter name="PK model" type="string" value="Constant Temperature"/>
   <Parameter name="Constant Temperature" type="double" value="290.0"/>
   </ParameterList>

   ------------------------------------------------------------------------- */

#include "CompositeVector.hh"
#include "CompositeVectorSpace.hh"
#include "test_snow_dist.hh"

namespace Amanzi {

void TestSnowDist::setup(const Teuchos::Ptr<State>& S) {
  PKPhysicalBase::setup(S);

  S->RequireField(key_, name_)->SetMesh(S->GetMesh("surface"))
          ->SetComponent("cell", AmanziMesh::CELL, 1);

  S->RequireField("precipitation_snow")->SetMesh(S->GetMesh("surface"))
      ->AddComponent("cell", AmanziMesh::CELL,1);
  S->RequireFieldEvaluator("precipitation_snow");
};

// -- call your favorite
bool TestSnowDist::advance(double dt) {
  S_next_->GetFieldEvaluator("precipitation_snow")->HasFieldChanged(S_next_.ptr(), name_);
  S_next_->GetFieldData("snow_depth", name_)
      ->Update(dt, *S_next_->GetFieldData("precipitation_snow"), 1.);
  solution_evaluator_->SetFieldAsChanged(S_next_.ptr());
};



} // namespace<commit_msg>fixes bug in snow accumulation test pk to accumulate snow, not swe<commit_after>/* -*-  mode: c++; c-default-style: "google"; indent-tabs-mode: nil -*- */
/* -------------------------------------------------------------------------
   ATS

   License: see $ATS_DIR/COPYRIGHT
   Author: <NAME>

   Implementation for the NullEnergy PK.  This PK simply provides a constant
   temperature, and is provided for testing with other PKs that depend upon an
   energy equation.  This could easily be provided by the state as an independent
   variable, but this is nice for testing the full hierarchy with a simple PK.

   Example usage:

   <ParameterList name="energy">
   <Parameter name="PK model" type="string" value="Constant Temperature"/>
   <Parameter name="Constant Temperature" type="double" value="290.0"/>
   </ParameterList>

   ------------------------------------------------------------------------- */

#include "CompositeVector.hh"
#include "CompositeVectorSpace.hh"
#include "test_snow_dist.hh"

namespace Amanzi {

void TestSnowDist::setup(const Teuchos::Ptr<State>& S) {
  PKPhysicalBase::setup(S);

  S->RequireField(key_, name_)->SetMesh(S->GetMesh("surface"))
          ->SetComponent("cell", AmanziMesh::CELL, 1);

  S->RequireField("precipitation_snow")->SetMesh(S->GetMesh("surface"))
      ->AddComponent("cell", AmanziMesh::CELL,1);
  S->RequireFieldEvaluator("precipitation_snow");
};

// -- call your favorite
bool TestSnowDist::advance(double dt) {
  S_next_->GetFieldEvaluator("precipitation_snow")->HasFieldChanged(S_next_.ptr(), name_);
  S_next_->GetFieldData("snow_depth", name_)
    ->Update(10.*dt, *S_next_->GetFieldData("precipitation_snow"), 1.); // factor of 10 for SWE-to-snow ht conversion
  solution_evaluator_->SetFieldAsChanged(S_next_.ptr());
};



} // namespace
{'fraction_non_alphanumeric': 0.21288116272442292, 'fraction_numerical': 0.005129666571672842, 'mean_word_length': 3.0956826137689615, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 45, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4733625', 'n_tokens_mistral': 1051, 'n_tokens_neox': 997, 'n_words': 251}