// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: spatial.proto

#include "spatial.pb.h"

#include <algorithm>

#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/extension_set.h>
#include <google/protobuf/wire_format_lite.h>
#include <google/protobuf/descriptor.h>
#include <google/protobuf/generated_message_reflection.h>
#include <google/protobuf/reflection_ops.h>
#include <google/protobuf/wire_format.h>
// @@protoc_insertion_point(includes)
#include <google/protobuf/port_def.inc>

PROTOBUF_PRAGMA_INIT_SEG

namespace _pb = ::PROTOBUF_NAMESPACE_ID;
namespace _pbi = _pb::internal;

namespace Messages {
PROTOBUF_CONSTEXPR Zone::Zone(
    ::_pbi::ConstantInitialized)
  : elements_()
  , _elements_cached_byte_size_(0)
  , terminal_coord_()
  , name_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{})
  , comments_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{})
  , info_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{})
  , resource_name_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{})
  , revision_(nullptr)
  , bounds_(nullptr)
  , id_(0)
  , dimensionality_(0u)
  , element_count_(0u){}
struct ZoneDefaultTypeInternal {
  PROTOBUF_CONSTEXPR ZoneDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~ZoneDefaultTypeInternal() {}
  union {
    Zone _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ZoneDefaultTypeInternal _Zone_default_instance_;
PROTOBUF_CONSTEXPR GridControl::GridControl(
    ::_pbi::ConstantInitialized)
  : size_()
  , _size_cached_byte_size_(0)
  , spacing_()
  , grading_()
  , symmetries_()
  , bounds_(nullptr)
  , basis_(0u)
  , length_units_(0u)
  , target_n_(uint64_t{0u})
  , interior_(false)
  , exterior_(false)
  , shell_(false){}
struct GridControlDefaultTypeInternal {
  PROTOBUF_CONSTEXPR GridControlDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~GridControlDefaultTypeInternal() {}
  union {
    GridControl _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 GridControlDefaultTypeInternal _GridControl_default_instance_;
PROTOBUF_CONSTEXPR MeshControl::MeshControl(
    ::_pbi::ConstantInitialized)
  : symmetries_()
  , bounds_(nullptr)
  , target_n_(uint64_t{0u})
  , size_ratio_(0)
  , size_decay_(0)
  , size_exponent_(0)
  , curv_ratio_(0)
  , max_iterations_(0u)
  , length_units_(0u)
  , curv_decay_(0)
  , curv_exponent_(0)
  , node_radius_(0)
  , interior_(false)
  , exterior_(false)
  , shell_(false)
  , equalize_(false)
  , smooth_(false)
  , include_background_(false)
  , keep_existing_points_(false)
  , auto_fit_domain_(false)
  , boundary_layer_thickness_(0)
  , background_n_(uint64_t{0u}){}
struct MeshControlDefaultTypeInternal {
  PROTOBUF_CONSTEXPR MeshControlDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~MeshControlDefaultTypeInternal() {}
  union {
    MeshControl _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 MeshControlDefaultTypeInternal _MeshControl_default_instance_;
PROTOBUF_CONSTEXPR TreeControl::TreeControl(
    ::_pbi::ConstantInitialized)
  : bounds_(nullptr)
  , min_depth_(0u)
  , max_depth_(0u)
  , max_size_(uint64_t{0u})
  , ref_dimensionality_(0u)
  , length_units_(0u){}
struct TreeControlDefaultTypeInternal {
  PROTOBUF_CONSTEXPR TreeControlDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~TreeControlDefaultTypeInternal() {}
  union {
    TreeControl _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 TreeControlDefaultTypeInternal _TreeControl_default_instance_;
PROTOBUF_CONSTEXPR Topology::Topology(
    ::_pbi::ConstantInitialized)
  : sparse_data_()
  , name_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{})
  , filename_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{})
  , info_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{})
  , revision_(nullptr)
  , nodes_(nullptr)
  , edges_(nullptr)
  , faces_(nullptr)
  , cells_(nullptr)
  , data_(nullptr)
  , grid_control_(nullptr)
  , mesh_control_(nullptr)
  , tree_control_(nullptr)
  , type_(0u)
  , ndim_(0u)
  , basis_(0u){}
struct TopologyDefaultTypeInternal {
  PROTOBUF_CONSTEXPR TopologyDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~TopologyDefaultTypeInternal() {}
  union {
    Topology _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 TopologyDefaultTypeInternal _Topology_default_instance_;
}  // namespace Messages
static ::_pb::Metadata file_level_metadata_spatial_2eproto[5];
static constexpr ::_pb::EnumDescriptor const** file_level_enum_descriptors_spatial_2eproto = nullptr;
static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_spatial_2eproto = nullptr;

const uint32_t TableStruct_spatial_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
  ~0u,  // no _has_bits_
  PROTOBUF_FIELD_OFFSET(::Messages::Zone, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  ~0u,  // no _inlined_string_donated_
  PROTOBUF_FIELD_OFFSET(::Messages::Zone, name_),
  PROTOBUF_FIELD_OFFSET(::Messages::Zone, id_),
  PROTOBUF_FIELD_OFFSET(::Messages::Zone, dimensionality_),
  PROTOBUF_FIELD_OFFSET(::Messages::Zone, revision_),
  PROTOBUF_FIELD_OFFSET(::Messages::Zone, elements_),
  PROTOBUF_FIELD_OFFSET(::Messages::Zone, element_count_),
  PROTOBUF_FIELD_OFFSET(::Messages::Zone, comments_),
  PROTOBUF_FIELD_OFFSET(::Messages::Zone, info_),
  PROTOBUF_FIELD_OFFSET(::Messages::Zone, resource_name_),
  PROTOBUF_FIELD_OFFSET(::Messages::Zone, bounds_),
  PROTOBUF_FIELD_OFFSET(::Messages::Zone, terminal_coord_),
  ~0u,  // no _has_bits_
  PROTOBUF_FIELD_OFFSET(::Messages::GridControl, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  ~0u,  // no _inlined_string_donated_
  PROTOBUF_FIELD_OFFSET(::Messages::GridControl, basis_),
  PROTOBUF_FIELD_OFFSET(::Messages::GridControl, size_),
  PROTOBUF_FIELD_OFFSET(::Messages::GridControl, spacing_),
  PROTOBUF_FIELD_OFFSET(::Messages::GridControl, grading_),
  PROTOBUF_FIELD_OFFSET(::Messages::GridControl, length_units_),
  PROTOBUF_FIELD_OFFSET(::Messages::GridControl, target_n_),
  PROTOBUF_FIELD_OFFSET(::Messages::GridControl, bounds_),
  PROTOBUF_FIELD_OFFSET(::Messages::GridControl, symmetries_),
  PROTOBUF_FIELD_OFFSET(::Messages::GridControl, interior_),
  PROTOBUF_FIELD_OFFSET(::Messages::GridControl, exterior_),
  PROTOBUF_FIELD_OFFSET(::Messages::GridControl, shell_),
  ~0u,  // no _has_bits_
  PROTOBUF_FIELD_OFFSET(::Messages::MeshControl, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  ~0u,  // no _inlined_string_donated_
  PROTOBUF_FIELD_OFFSET(::Messages::MeshControl, target_n_),
  PROTOBUF_FIELD_OFFSET(::Messages::MeshControl, max_iterations_),
  PROTOBUF_FIELD_OFFSET(::Messages::MeshControl, size_ratio_),
  PROTOBUF_FIELD_OFFSET(::Messages::MeshControl, size_decay_),
  PROTOBUF_FIELD_OFFSET(::Messages::MeshControl, size_exponent_),
  PROTOBUF_FIELD_OFFSET(::Messages::MeshControl, curv_ratio_),
  PROTOBUF_FIELD_OFFSET(::Messages::MeshControl, curv_decay_),
  PROTOBUF_FIELD_OFFSET(::Messages::MeshControl, curv_exponent_),
  PROTOBUF_FIELD_OFFSET(::Messages::MeshControl, node_radius_),
  PROTOBUF_FIELD_OFFSET(::Messages::MeshControl, bounds_),
  PROTOBUF_FIELD_OFFSET(::Messages::MeshControl, length_units_),
  PROTOBUF_FIELD_OFFSET(::Messages::MeshControl, interior_),
  PROTOBUF_FIELD_OFFSET(::Messages::MeshControl, exterior_),
  PROTOBUF_FIELD_OFFSET(::Messages::MeshControl, shell_),
  PROTOBUF_FIELD_OFFSET(::Messages::MeshControl, equalize_),
  PROTOBUF_FIELD_OFFSET(::Messages::MeshControl, smooth_),
  PROTOBUF_FIELD_OFFSET(::Messages::MeshControl, include_background_),
  PROTOBUF_FIELD_OFFSET(::Messages::MeshControl, keep_existing_points_),
  PROTOBUF_FIELD_OFFSET(::Messages::MeshControl, auto_fit_domain_),
  PROTOBUF_FIELD_OFFSET(::Messages::MeshControl, boundary_layer_thickness_),
  PROTOBUF_FIELD_OFFSET(::Messages::MeshControl, symmetries_),
  PROTOBUF_FIELD_OFFSET(::Messages::MeshControl, background_n_),
  ~0u,  // no _has_bits_
  PROTOBUF_FIELD_OFFSET(::Messages::TreeControl, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  ~0u,  // no _inlined_string_donated_
  PROTOBUF_FIELD_OFFSET(::Messages::TreeControl, min_depth_),
  PROTOBUF_FIELD_OFFSET(::Messages::TreeControl, max_depth_),
  PROTOBUF_FIELD_OFFSET(::Messages::TreeControl, max_size_),
  PROTOBUF_FIELD_OFFSET(::Messages::TreeControl, ref_dimensionality_),
  PROTOBUF_FIELD_OFFSET(::Messages::TreeControl, length_units_),
  PROTOBUF_FIELD_OFFSET(::Messages::TreeControl, bounds_),
  ~0u,  // no _has_bits_
  PROTOBUF_FIELD_OFFSET(::Messages::Topology, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  ~0u,  // no _inlined_string_donated_
  PROTOBUF_FIELD_OFFSET(::Messages::Topology, name_),
  PROTOBUF_FIELD_OFFSET(::Messages::Topology, type_),
  PROTOBUF_FIELD_OFFSET(::Messages::Topology, ndim_),
  PROTOBUF_FIELD_OFFSET(::Messages::Topology, basis_),
  PROTOBUF_FIELD_OFFSET(::Messages::Topology, filename_),
  PROTOBUF_FIELD_OFFSET(::Messages::Topology, revision_),
  PROTOBUF_FIELD_OFFSET(::Messages::Topology, info_),
  PROTOBUF_FIELD_OFFSET(::Messages::Topology, nodes_),
  PROTOBUF_FIELD_OFFSET(::Messages::Topology, edges_),
  PROTOBUF_FIELD_OFFSET(::Messages::Topology, faces_),
  PROTOBUF_FIELD_OFFSET(::Messages::Topology, cells_),
  PROTOBUF_FIELD_OFFSET(::Messages::Topology, data_),
  PROTOBUF_FIELD_OFFSET(::Messages::Topology, sparse_data_),
  PROTOBUF_FIELD_OFFSET(::Messages::Topology, grid_control_),
  PROTOBUF_FIELD_OFFSET(::Messages::Topology, mesh_control_),
  PROTOBUF_FIELD_OFFSET(::Messages::Topology, tree_control_),
};
static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
  { 0, -1, -1, sizeof(::Messages::Zone)},
  { 17, -1, -1, sizeof(::Messages::GridControl)},
  { 34, -1, -1, sizeof(::Messages::MeshControl)},
  { 62, -1, -1, sizeof(::Messages::TreeControl)},
  { 74, -1, -1, sizeof(::Messages::Topology)},
};

static const ::_pb::Message* const file_default_instances[] = {
  &::Messages::_Zone_default_instance_._instance,
  &::Messages::_GridControl_default_instance_._instance,
  &::Messages::_MeshControl_default_instance_._instance,
  &::Messages::_TreeControl_default_instance_._instance,
  &::Messages::_Topology_default_instance_._instance,
};

const char descriptor_table_protodef_spatial_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
  "\n\rspatial.proto\022\010Messages\032\014vector.proto\""
  "\371\001\n\004Zone\022\014\n\004name\030\001 \001(\t\022\n\n\002id\030\002 \001(\005\022\026\n\016di"
  "mensionality\030\003 \001(\r\022$\n\010revision\030\004 \001(\0132\022.M"
  "essages.Revision\022\020\n\010elements\030\005 \003(\r\022\025\n\rel"
  "ement_count\030\006 \001(\r\022\020\n\010comments\030\007 \001(\t\022\014\n\004i"
  "nfo\030\010 \001(\t\022\025\n\rresource_name\030\t \001(\t\022!\n\006boun"
  "ds\030\n \001(\0132\021.Messages.Extrema\022\026\n\016terminal_"
  "coord\030\013 \003(\002\"\336\001\n\013GridControl\022\r\n\005basis\030\001 \001"
  "(\r\022\014\n\004size\030\002 \003(\r\022\017\n\007spacing\030\003 \003(\001\022\017\n\007gra"
  "ding\030\004 \003(\001\022\024\n\014length_units\030\010 \001(\r\022\020\n\010targ"
  "et_n\030\t \001(\004\022!\n\006bounds\030\n \001(\0132\021.Messages.Ex"
  "trema\022\022\n\nsymmetries\030\013 \003(\010\022\020\n\010interior\030\014 "
  "\001(\010\022\020\n\010exterior\030\r \001(\010\022\r\n\005shell\030\016 \001(\010\"\367\003\n"
  "\013MeshControl\022\020\n\010target_n\030\001 \001(\004\022\026\n\016max_it"
  "erations\030\002 \001(\r\022\022\n\nsize_ratio\030\003 \001(\001\022\022\n\nsi"
  "ze_decay\030\004 \001(\001\022\025\n\rsize_exponent\030\005 \001(\001\022\022\n"
  "\ncurv_ratio\030\006 \001(\001\022\022\n\ncurv_decay\030\007 \001(\001\022\025\n"
  "\rcurv_exponent\030\010 \001(\001\022\023\n\013node_radius\030\t \001("
  "\001\022!\n\006bounds\030\n \001(\0132\021.Messages.Extrema\022\024\n\014"
  "length_units\030\013 \001(\r\022\020\n\010interior\030\014 \001(\010\022\020\n\010"
  "exterior\030\r \001(\010\022\r\n\005shell\030\016 \001(\010\022\020\n\010equaliz"
  "e\030\017 \001(\010\022\016\n\006smooth\030\020 \001(\010\022\032\n\022include_backg"
  "round\030\022 \001(\010\022\034\n\024keep_existing_points\030\023 \001("
  "\010\022\027\n\017auto_fit_domain\030\024 \001(\010\022 \n\030boundary_l"
  "ayer_thickness\030\027 \001(\001\022\022\n\nsymmetries\030\030 \003(\010"
  "\022\024\n\014background_n\030\036 \001(\004\"\232\001\n\013TreeControl\022\021"
  "\n\tmin_depth\030\001 \001(\r\022\021\n\tmax_depth\030\002 \001(\r\022\020\n\010"
  "max_size\030\003 \001(\004\022\032\n\022ref_dimensionality\030\007 \001"
  "(\r\022\024\n\014length_units\030\010 \001(\r\022!\n\006bounds\030\n \001(\013"
  "2\021.Messages.Extrema\"\353\003\n\010Topology\022\014\n\004name"
  "\030\001 \001(\t\022\014\n\004type\030\002 \001(\r\022\014\n\004ndim\030\003 \001(\r\022\r\n\005ba"
  "sis\030\004 \001(\r\022\020\n\010filename\030\005 \001(\t\022$\n\010revision\030"
  "\006 \001(\0132\022.Messages.Revision\022\014\n\004info\030\007 \001(\t\022"
  "!\n\005nodes\030\n \001(\0132\022.Messages.Elements\022!\n\005ed"
  "ges\030\013 \001(\0132\022.Messages.Elements\022!\n\005faces\030\014"
  " \001(\0132\022.Messages.Elements\022!\n\005cells\030\r \001(\0132"
  "\022.Messages.Elements\022 \n\004data\030\017 \001(\0132\022.Mess"
  "ages.Record64\022+\n\013sparse_data\030\020 \003(\0132\026.Mes"
  "sages.SparseMatrix\022+\n\014grid_control\030\024 \001(\013"
  "2\025.Messages.GridControl\022+\n\014mesh_control\030"
  "\025 \001(\0132\025.Messages.MeshControl\022+\n\014tree_con"
  "trol\030\026 \001(\0132\025.Messages.TreeControlb\006proto"
  "3"
  ;
static const ::_pbi::DescriptorTable* const descriptor_table_spatial_2eproto_deps[1] = {
  &::descriptor_table_vector_2eproto,
};
static ::_pbi::once_flag descriptor_table_spatial_2eproto_once;
const ::_pbi::DescriptorTable descriptor_table_spatial_2eproto = {
    false, false, 1681, descriptor_table_protodef_spatial_2eproto,
    "spatial.proto",
    &descriptor_table_spatial_2eproto_once, descriptor_table_spatial_2eproto_deps, 1, 5,
    schemas, file_default_instances, TableStruct_spatial_2eproto::offsets,
    file_level_metadata_spatial_2eproto, file_level_enum_descriptors_spatial_2eproto,
    file_level_service_descriptors_spatial_2eproto,
};
PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_spatial_2eproto_getter() {
  return &descriptor_table_spatial_2eproto;
}

// Force running AddDescriptors() at dynamic initialization time.
PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_spatial_2eproto(&descriptor_table_spatial_2eproto);
namespace Messages {

// ===================================================================

class Zone::_Internal {
 public:
  static const ::Messages::Revision& revision(const Zone* msg);
  static const ::Messages::Extrema& bounds(const Zone* msg);
};

const ::Messages::Revision&
Zone::_Internal::revision(const Zone* msg) {
  return *msg->revision_;
}
const ::Messages::Extrema&
Zone::_Internal::bounds(const Zone* msg) {
  return *msg->bounds_;
}
void Zone::clear_revision() {
  if (GetArenaForAllocation() == nullptr && revision_ != nullptr) {
    delete revision_;
  }
  revision_ = nullptr;
}
void Zone::clear_bounds() {
  if (GetArenaForAllocation() == nullptr && bounds_ != nullptr) {
    delete bounds_;
  }
  bounds_ = nullptr;
}
Zone::Zone(::PROTOBUF_NAMESPACE_ID::Arena* arena,
                         bool is_message_owned)
  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned),
  elements_(arena),
  terminal_coord_(arena) {
  SharedCtor();
  // @@protoc_insertion_point(arena_constructor:Messages.Zone)
}
Zone::Zone(const Zone& from)
  : ::PROTOBUF_NAMESPACE_ID::Message(),
      elements_(from.elements_),
      terminal_coord_(from.terminal_coord_) {
  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  name_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    name_.Set("", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (!from._internal_name().empty()) {
    name_.Set(from._internal_name(), 
      GetArenaForAllocation());
  }
  comments_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    comments_.Set("", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (!from._internal_comments().empty()) {
    comments_.Set(from._internal_comments(), 
      GetArenaForAllocation());
  }
  info_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    info_.Set("", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (!from._internal_info().empty()) {
    info_.Set(from._internal_info(), 
      GetArenaForAllocation());
  }
  resource_name_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    resource_name_.Set("", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (!from._internal_resource_name().empty()) {
    resource_name_.Set(from._internal_resource_name(), 
      GetArenaForAllocation());
  }
  if (from._internal_has_revision()) {
    revision_ = new ::Messages::Revision(*from.revision_);
  } else {
    revision_ = nullptr;
  }
  if (from._internal_has_bounds()) {
    bounds_ = new ::Messages::Extrema(*from.bounds_);
  } else {
    bounds_ = nullptr;
  }
  ::memcpy(&id_, &from.id_,
    static_cast<size_t>(reinterpret_cast<char*>(&element_count_) -
    reinterpret_cast<char*>(&id_)) + sizeof(element_count_));
  // @@protoc_insertion_point(copy_constructor:Messages.Zone)
}

inline void Zone::SharedCtor() {
name_.InitDefault();
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
  name_.Set("", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
comments_.InitDefault();
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
  comments_.Set("", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
info_.InitDefault();
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
  info_.Set("", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
resource_name_.InitDefault();
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
  resource_name_.Set("", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
    reinterpret_cast<char*>(&revision_) - reinterpret_cast<char*>(this)),
    0, static_cast<size_t>(reinterpret_cast<char*>(&element_count_) -
    reinterpret_cast<char*>(&revision_)) + sizeof(element_count_));
}

Zone::~Zone() {
  // @@protoc_insertion_point(destructor:Messages.Zone)
  if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) {
  (void)arena;
    return;
  }
  SharedDtor();
}

inline void Zone::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  name_.Destroy();
  comments_.Destroy();
  info_.Destroy();
  resource_name_.Destroy();
  if (this != internal_default_instance()) delete revision_;
  if (this != internal_default_instance()) delete bounds_;
}

void Zone::SetCachedSize(int size) const {
  _cached_size_.Set(size);
}

void Zone::Clear() {
// @@protoc_insertion_point(message_clear_start:Messages.Zone)
  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  elements_.Clear();
  terminal_coord_.Clear();
  name_.ClearToEmpty();
  comments_.ClearToEmpty();
  info_.ClearToEmpty();
  resource_name_.ClearToEmpty();
  if (GetArenaForAllocation() == nullptr && revision_ != nullptr) {
    delete revision_;
  }
  revision_ = nullptr;
  if (GetArenaForAllocation() == nullptr && bounds_ != nullptr) {
    delete bounds_;
  }
  bounds_ = nullptr;
  ::memset(&id_, 0, static_cast<size_t>(
      reinterpret_cast<char*>(&element_count_) -
      reinterpret_cast<char*>(&id_)) + sizeof(element_count_));
  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

const char* Zone::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  while (!ctx->Done(&ptr)) {
    uint32_t tag;
    ptr = ::_pbi::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // string name = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
          auto str = _internal_mutable_name();
          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
          CHK_(::_pbi::VerifyUTF8(str, "Messages.Zone.name"));
        } else
          goto handle_unusual;
        continue;
      // int32 id = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
          id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // uint32 dimensionality = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
          dimensionality_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // .Messages.Revision revision = 4;
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 34)) {
          ptr = ctx->ParseMessage(_internal_mutable_revision(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // repeated uint32 elements = 5;
      case 5:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 42)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedUInt32Parser(_internal_mutable_elements(), ptr, ctx);
          CHK_(ptr);
        } else if (static_cast<uint8_t>(tag) == 40) {
          _internal_add_elements(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr));
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // uint32 element_count = 6;
      case 6:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 48)) {
          element_count_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // string comments = 7;
      case 7:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 58)) {
          auto str = _internal_mutable_comments();
          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
          CHK_(::_pbi::VerifyUTF8(str, "Messages.Zone.comments"));
        } else
          goto handle_unusual;
        continue;
      // string info = 8;
      case 8:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 66)) {
          auto str = _internal_mutable_info();
          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
          CHK_(::_pbi::VerifyUTF8(str, "Messages.Zone.info"));
        } else
          goto handle_unusual;
        continue;
      // string resource_name = 9;
      case 9:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 74)) {
          auto str = _internal_mutable_resource_name();
          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
          CHK_(::_pbi::VerifyUTF8(str, "Messages.Zone.resource_name"));
        } else
          goto handle_unusual;
        continue;
      // .Messages.Extrema bounds = 10;
      case 10:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 82)) {
          ptr = ctx->ParseMessage(_internal_mutable_bounds(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // repeated float terminal_coord = 11;
      case 11:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 90)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedFloatParser(_internal_mutable_terminal_coord(), ptr, ctx);
          CHK_(ptr);
        } else if (static_cast<uint8_t>(tag) == 93) {
          _internal_add_terminal_coord(::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr));
          ptr += sizeof(float);
        } else
          goto handle_unusual;
        continue;
      default:
        goto handle_unusual;
    }  // switch
  handle_unusual:
    if ((tag == 0) || ((tag & 7) == 4)) {
      CHK_(ptr);
      ctx->SetLastTag(tag);
      goto message_done;
    }
    ptr = UnknownFieldParse(
        tag,
        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

uint8_t* Zone::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:Messages.Zone)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  // string name = 1;
  if (!this->_internal_name().empty()) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
      this->_internal_name().data(), static_cast<int>(this->_internal_name().length()),
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
      "Messages.Zone.name");
    target = stream->WriteStringMaybeAliased(
        1, this->_internal_name(), target);
  }

  // int32 id = 2;
  if (this->_internal_id() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteInt32ToArray(2, this->_internal_id(), target);
  }

  // uint32 dimensionality = 3;
  if (this->_internal_dimensionality() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteUInt32ToArray(3, this->_internal_dimensionality(), target);
  }

  // .Messages.Revision revision = 4;
  if (this->_internal_has_revision()) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(4, _Internal::revision(this),
        _Internal::revision(this).GetCachedSize(), target, stream);
  }

  // repeated uint32 elements = 5;
  {
    int byte_size = _elements_cached_byte_size_.load(std::memory_order_relaxed);
    if (byte_size > 0) {
      target = stream->WriteUInt32Packed(
          5, _internal_elements(), byte_size, target);
    }
  }

  // uint32 element_count = 6;
  if (this->_internal_element_count() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteUInt32ToArray(6, this->_internal_element_count(), target);
  }

  // string comments = 7;
  if (!this->_internal_comments().empty()) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
      this->_internal_comments().data(), static_cast<int>(this->_internal_comments().length()),
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
      "Messages.Zone.comments");
    target = stream->WriteStringMaybeAliased(
        7, this->_internal_comments(), target);
  }

  // string info = 8;
  if (!this->_internal_info().empty()) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
      this->_internal_info().data(), static_cast<int>(this->_internal_info().length()),
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
      "Messages.Zone.info");
    target = stream->WriteStringMaybeAliased(
        8, this->_internal_info(), target);
  }

  // string resource_name = 9;
  if (!this->_internal_resource_name().empty()) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
      this->_internal_resource_name().data(), static_cast<int>(this->_internal_resource_name().length()),
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
      "Messages.Zone.resource_name");
    target = stream->WriteStringMaybeAliased(
        9, this->_internal_resource_name(), target);
  }

  // .Messages.Extrema bounds = 10;
  if (this->_internal_has_bounds()) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(10, _Internal::bounds(this),
        _Internal::bounds(this).GetCachedSize(), target, stream);
  }

  // repeated float terminal_coord = 11;
  if (this->_internal_terminal_coord_size() > 0) {
    target = stream->WriteFixedPacked(11, _internal_terminal_coord(), target);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray(
        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
  }
  // @@protoc_insertion_point(serialize_to_array_end:Messages.Zone)
  return target;
}

size_t Zone::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:Messages.Zone)
  size_t total_size = 0;

  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  // repeated uint32 elements = 5;
  {
    size_t data_size = ::_pbi::WireFormatLite::
      UInt32Size(this->elements_);
    if (data_size > 0) {
      total_size += 1 +
        ::_pbi::WireFormatLite::Int32Size(static_cast<int32_t>(data_size));
    }
    int cached_size = ::_pbi::ToCachedSize(data_size);
    _elements_cached_byte_size_.store(cached_size,
                                    std::memory_order_relaxed);
    total_size += data_size;
  }

  // repeated float terminal_coord = 11;
  {
    unsigned int count = static_cast<unsigned int>(this->_internal_terminal_coord_size());
    size_t data_size = 4UL * count;
    if (data_size > 0) {
      total_size += 1 +
        ::_pbi::WireFormatLite::Int32Size(static_cast<int32_t>(data_size));
    }
    total_size += data_size;
  }

  // string name = 1;
  if (!this->_internal_name().empty()) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
        this->_internal_name());
  }

  // string comments = 7;
  if (!this->_internal_comments().empty()) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
        this->_internal_comments());
  }

  // string info = 8;
  if (!this->_internal_info().empty()) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
        this->_internal_info());
  }

  // string resource_name = 9;
  if (!this->_internal_resource_name().empty()) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
        this->_internal_resource_name());
  }

  // .Messages.Revision revision = 4;
  if (this->_internal_has_revision()) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
        *revision_);
  }

  // .Messages.Extrema bounds = 10;
  if (this->_internal_has_bounds()) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
        *bounds_);
  }

  // int32 id = 2;
  if (this->_internal_id() != 0) {
    total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_id());
  }

  // uint32 dimensionality = 3;
  if (this->_internal_dimensionality() != 0) {
    total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_dimensionality());
  }

  // uint32 element_count = 6;
  if (this->_internal_element_count() != 0) {
    total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_element_count());
  }

  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
}

const ::PROTOBUF_NAMESPACE_ID::Message::ClassData Zone::_class_data_ = {
    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
    Zone::MergeImpl
};
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*Zone::GetClassData() const { return &_class_data_; }

void Zone::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
  static_cast<Zone *>(to)->MergeFrom(
      static_cast<const Zone &>(from));
}


void Zone::MergeFrom(const Zone& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:Messages.Zone)
  GOOGLE_DCHECK_NE(&from, this);
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  elements_.MergeFrom(from.elements_);
  terminal_coord_.MergeFrom(from.terminal_coord_);
  if (!from._internal_name().empty()) {
    _internal_set_name(from._internal_name());
  }
  if (!from._internal_comments().empty()) {
    _internal_set_comments(from._internal_comments());
  }
  if (!from._internal_info().empty()) {
    _internal_set_info(from._internal_info());
  }
  if (!from._internal_resource_name().empty()) {
    _internal_set_resource_name(from._internal_resource_name());
  }
  if (from._internal_has_revision()) {
    _internal_mutable_revision()->::Messages::Revision::MergeFrom(from._internal_revision());
  }
  if (from._internal_has_bounds()) {
    _internal_mutable_bounds()->::Messages::Extrema::MergeFrom(from._internal_bounds());
  }
  if (from._internal_id() != 0) {
    _internal_set_id(from._internal_id());
  }
  if (from._internal_dimensionality() != 0) {
    _internal_set_dimensionality(from._internal_dimensionality());
  }
  if (from._internal_element_count() != 0) {
    _internal_set_element_count(from._internal_element_count());
  }
  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

void Zone::CopyFrom(const Zone& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:Messages.Zone)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool Zone::IsInitialized() const {
  return true;
}

void Zone::InternalSwap(Zone* other) {
  using std::swap;
  auto* lhs_arena = GetArenaForAllocation();
  auto* rhs_arena = other->GetArenaForAllocation();
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  elements_.InternalSwap(&other->elements_);
  terminal_coord_.InternalSwap(&other->terminal_coord_);
  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
      &name_, lhs_arena,
      &other->name_, rhs_arena
  );
  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
      &comments_, lhs_arena,
      &other->comments_, rhs_arena
  );
  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
      &info_, lhs_arena,
      &other->info_, rhs_arena
  );
  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
      &resource_name_, lhs_arena,
      &other->resource_name_, rhs_arena
  );
  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
      PROTOBUF_FIELD_OFFSET(Zone, element_count_)
      + sizeof(Zone::element_count_)
      - PROTOBUF_FIELD_OFFSET(Zone, revision_)>(
          reinterpret_cast<char*>(&revision_),
          reinterpret_cast<char*>(&other->revision_));
}

::PROTOBUF_NAMESPACE_ID::Metadata Zone::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_spatial_2eproto_getter, &descriptor_table_spatial_2eproto_once,
      file_level_metadata_spatial_2eproto[0]);
}

// ===================================================================

class GridControl::_Internal {
 public:
  static const ::Messages::Extrema& bounds(const GridControl* msg);
};

const ::Messages::Extrema&
GridControl::_Internal::bounds(const GridControl* msg) {
  return *msg->bounds_;
}
void GridControl::clear_bounds() {
  if (GetArenaForAllocation() == nullptr && bounds_ != nullptr) {
    delete bounds_;
  }
  bounds_ = nullptr;
}
GridControl::GridControl(::PROTOBUF_NAMESPACE_ID::Arena* arena,
                         bool is_message_owned)
  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned),
  size_(arena),
  spacing_(arena),
  grading_(arena),
  symmetries_(arena) {
  SharedCtor();
  // @@protoc_insertion_point(arena_constructor:Messages.GridControl)
}
GridControl::GridControl(const GridControl& from)
  : ::PROTOBUF_NAMESPACE_ID::Message(),
      size_(from.size_),
      spacing_(from.spacing_),
      grading_(from.grading_),
      symmetries_(from.symmetries_) {
  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  if (from._internal_has_bounds()) {
    bounds_ = new ::Messages::Extrema(*from.bounds_);
  } else {
    bounds_ = nullptr;
  }
  ::memcpy(&basis_, &from.basis_,
    static_cast<size_t>(reinterpret_cast<char*>(&shell_) -
    reinterpret_cast<char*>(&basis_)) + sizeof(shell_));
  // @@protoc_insertion_point(copy_constructor:Messages.GridControl)
}

inline void GridControl::SharedCtor() {
::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
    reinterpret_cast<char*>(&bounds_) - reinterpret_cast<char*>(this)),
    0, static_cast<size_t>(reinterpret_cast<char*>(&shell_) -
    reinterpret_cast<char*>(&bounds_)) + sizeof(shell_));
}

GridControl::~GridControl() {
  // @@protoc_insertion_point(destructor:Messages.GridControl)
  if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) {
  (void)arena;
    return;
  }
  SharedDtor();
}

inline void GridControl::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  if (this != internal_default_instance()) delete bounds_;
}

void GridControl::SetCachedSize(int size) const {
  _cached_size_.Set(size);
}

void GridControl::Clear() {
// @@protoc_insertion_point(message_clear_start:Messages.GridControl)
  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  size_.Clear();
  spacing_.Clear();
  grading_.Clear();
  symmetries_.Clear();
  if (GetArenaForAllocation() == nullptr && bounds_ != nullptr) {
    delete bounds_;
  }
  bounds_ = nullptr;
  ::memset(&basis_, 0, static_cast<size_t>(
      reinterpret_cast<char*>(&shell_) -
      reinterpret_cast<char*>(&basis_)) + sizeof(shell_));
  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

const char* GridControl::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  while (!ctx->Done(&ptr)) {
    uint32_t tag;
    ptr = ::_pbi::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // uint32 basis = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
          basis_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // repeated uint32 size = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedUInt32Parser(_internal_mutable_size(), ptr, ctx);
          CHK_(ptr);
        } else if (static_cast<uint8_t>(tag) == 16) {
          _internal_add_size(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr));
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // repeated double spacing = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 26)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedDoubleParser(_internal_mutable_spacing(), ptr, ctx);
          CHK_(ptr);
        } else if (static_cast<uint8_t>(tag) == 25) {
          _internal_add_spacing(::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<double>(ptr));
          ptr += sizeof(double);
        } else
          goto handle_unusual;
        continue;
      // repeated double grading = 4;
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 34)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedDoubleParser(_internal_mutable_grading(), ptr, ctx);
          CHK_(ptr);
        } else if (static_cast<uint8_t>(tag) == 33) {
          _internal_add_grading(::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<double>(ptr));
          ptr += sizeof(double);
        } else
          goto handle_unusual;
        continue;
      // uint32 length_units = 8;
      case 8:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 64)) {
          length_units_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // uint64 target_n = 9;
      case 9:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 72)) {
          target_n_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // .Messages.Extrema bounds = 10;
      case 10:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 82)) {
          ptr = ctx->ParseMessage(_internal_mutable_bounds(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // repeated bool symmetries = 11;
      case 11:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 90)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedBoolParser(_internal_mutable_symmetries(), ptr, ctx);
          CHK_(ptr);
        } else if (static_cast<uint8_t>(tag) == 88) {
          _internal_add_symmetries(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr));
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // bool interior = 12;
      case 12:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 96)) {
          interior_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // bool exterior = 13;
      case 13:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 104)) {
          exterior_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // bool shell = 14;
      case 14:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 112)) {
          shell_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      default:
        goto handle_unusual;
    }  // switch
  handle_unusual:
    if ((tag == 0) || ((tag & 7) == 4)) {
      CHK_(ptr);
      ctx->SetLastTag(tag);
      goto message_done;
    }
    ptr = UnknownFieldParse(
        tag,
        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

uint8_t* GridControl::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:Messages.GridControl)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  // uint32 basis = 1;
  if (this->_internal_basis() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteUInt32ToArray(1, this->_internal_basis(), target);
  }

  // repeated uint32 size = 2;
  {
    int byte_size = _size_cached_byte_size_.load(std::memory_order_relaxed);
    if (byte_size > 0) {
      target = stream->WriteUInt32Packed(
          2, _internal_size(), byte_size, target);
    }
  }

  // repeated double spacing = 3;
  if (this->_internal_spacing_size() > 0) {
    target = stream->WriteFixedPacked(3, _internal_spacing(), target);
  }

  // repeated double grading = 4;
  if (this->_internal_grading_size() > 0) {
    target = stream->WriteFixedPacked(4, _internal_grading(), target);
  }

  // uint32 length_units = 8;
  if (this->_internal_length_units() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteUInt32ToArray(8, this->_internal_length_units(), target);
  }

  // uint64 target_n = 9;
  if (this->_internal_target_n() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteUInt64ToArray(9, this->_internal_target_n(), target);
  }

  // .Messages.Extrema bounds = 10;
  if (this->_internal_has_bounds()) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(10, _Internal::bounds(this),
        _Internal::bounds(this).GetCachedSize(), target, stream);
  }

  // repeated bool symmetries = 11;
  if (this->_internal_symmetries_size() > 0) {
    target = stream->WriteFixedPacked(11, _internal_symmetries(), target);
  }

  // bool interior = 12;
  if (this->_internal_interior() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteBoolToArray(12, this->_internal_interior(), target);
  }

  // bool exterior = 13;
  if (this->_internal_exterior() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteBoolToArray(13, this->_internal_exterior(), target);
  }

  // bool shell = 14;
  if (this->_internal_shell() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteBoolToArray(14, this->_internal_shell(), target);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray(
        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
  }
  // @@protoc_insertion_point(serialize_to_array_end:Messages.GridControl)
  return target;
}

size_t GridControl::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:Messages.GridControl)
  size_t total_size = 0;

  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  // repeated uint32 size = 2;
  {
    size_t data_size = ::_pbi::WireFormatLite::
      UInt32Size(this->size_);
    if (data_size > 0) {
      total_size += 1 +
        ::_pbi::WireFormatLite::Int32Size(static_cast<int32_t>(data_size));
    }
    int cached_size = ::_pbi::ToCachedSize(data_size);
    _size_cached_byte_size_.store(cached_size,
                                    std::memory_order_relaxed);
    total_size += data_size;
  }

  // repeated double spacing = 3;
  {
    unsigned int count = static_cast<unsigned int>(this->_internal_spacing_size());
    size_t data_size = 8UL * count;
    if (data_size > 0) {
      total_size += 1 +
        ::_pbi::WireFormatLite::Int32Size(static_cast<int32_t>(data_size));
    }
    total_size += data_size;
  }

  // repeated double grading = 4;
  {
    unsigned int count = static_cast<unsigned int>(this->_internal_grading_size());
    size_t data_size = 8UL * count;
    if (data_size > 0) {
      total_size += 1 +
        ::_pbi::WireFormatLite::Int32Size(static_cast<int32_t>(data_size));
    }
    total_size += data_size;
  }

  // repeated bool symmetries = 11;
  {
    unsigned int count = static_cast<unsigned int>(this->_internal_symmetries_size());
    size_t data_size = 1UL * count;
    if (data_size > 0) {
      total_size += 1 +
        ::_pbi::WireFormatLite::Int32Size(static_cast<int32_t>(data_size));
    }
    total_size += data_size;
  }

  // .Messages.Extrema bounds = 10;
  if (this->_internal_has_bounds()) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
        *bounds_);
  }

  // uint32 basis = 1;
  if (this->_internal_basis() != 0) {
    total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_basis());
  }

  // uint32 length_units = 8;
  if (this->_internal_length_units() != 0) {
    total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_length_units());
  }

  // uint64 target_n = 9;
  if (this->_internal_target_n() != 0) {
    total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_target_n());
  }

  // bool interior = 12;
  if (this->_internal_interior() != 0) {
    total_size += 1 + 1;
  }

  // bool exterior = 13;
  if (this->_internal_exterior() != 0) {
    total_size += 1 + 1;
  }

  // bool shell = 14;
  if (this->_internal_shell() != 0) {
    total_size += 1 + 1;
  }

  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
}

const ::PROTOBUF_NAMESPACE_ID::Message::ClassData GridControl::_class_data_ = {
    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
    GridControl::MergeImpl
};
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GridControl::GetClassData() const { return &_class_data_; }

void GridControl::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
  static_cast<GridControl *>(to)->MergeFrom(
      static_cast<const GridControl &>(from));
}


void GridControl::MergeFrom(const GridControl& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:Messages.GridControl)
  GOOGLE_DCHECK_NE(&from, this);
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  size_.MergeFrom(from.size_);
  spacing_.MergeFrom(from.spacing_);
  grading_.MergeFrom(from.grading_);
  symmetries_.MergeFrom(from.symmetries_);
  if (from._internal_has_bounds()) {
    _internal_mutable_bounds()->::Messages::Extrema::MergeFrom(from._internal_bounds());
  }
  if (from._internal_basis() != 0) {
    _internal_set_basis(from._internal_basis());
  }
  if (from._internal_length_units() != 0) {
    _internal_set_length_units(from._internal_length_units());
  }
  if (from._internal_target_n() != 0) {
    _internal_set_target_n(from._internal_target_n());
  }
  if (from._internal_interior() != 0) {
    _internal_set_interior(from._internal_interior());
  }
  if (from._internal_exterior() != 0) {
    _internal_set_exterior(from._internal_exterior());
  }
  if (from._internal_shell() != 0) {
    _internal_set_shell(from._internal_shell());
  }
  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

void GridControl::CopyFrom(const GridControl& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:Messages.GridControl)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool GridControl::IsInitialized() const {
  return true;
}

void GridControl::InternalSwap(GridControl* other) {
  using std::swap;
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  size_.InternalSwap(&other->size_);
  spacing_.InternalSwap(&other->spacing_);
  grading_.InternalSwap(&other->grading_);
  symmetries_.InternalSwap(&other->symmetries_);
  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
      PROTOBUF_FIELD_OFFSET(GridControl, shell_)
      + sizeof(GridControl::shell_)
      - PROTOBUF_FIELD_OFFSET(GridControl, bounds_)>(
          reinterpret_cast<char*>(&bounds_),
          reinterpret_cast<char*>(&other->bounds_));
}

::PROTOBUF_NAMESPACE_ID::Metadata GridControl::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_spatial_2eproto_getter, &descriptor_table_spatial_2eproto_once,
      file_level_metadata_spatial_2eproto[1]);
}

// ===================================================================

class MeshControl::_Internal {
 public:
  static const ::Messages::Extrema& bounds(const MeshControl* msg);
};

const ::Messages::Extrema&
MeshControl::_Internal::bounds(const MeshControl* msg) {
  return *msg->bounds_;
}
void MeshControl::clear_bounds() {
  if (GetArenaForAllocation() == nullptr && bounds_ != nullptr) {
    delete bounds_;
  }
  bounds_ = nullptr;
}
MeshControl::MeshControl(::PROTOBUF_NAMESPACE_ID::Arena* arena,
                         bool is_message_owned)
  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned),
  symmetries_(arena) {
  SharedCtor();
  // @@protoc_insertion_point(arena_constructor:Messages.MeshControl)
}
MeshControl::MeshControl(const MeshControl& from)
  : ::PROTOBUF_NAMESPACE_ID::Message(),
      symmetries_(from.symmetries_) {
  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  if (from._internal_has_bounds()) {
    bounds_ = new ::Messages::Extrema(*from.bounds_);
  } else {
    bounds_ = nullptr;
  }
  ::memcpy(&target_n_, &from.target_n_,
    static_cast<size_t>(reinterpret_cast<char*>(&background_n_) -
    reinterpret_cast<char*>(&target_n_)) + sizeof(background_n_));
  // @@protoc_insertion_point(copy_constructor:Messages.MeshControl)
}

inline void MeshControl::SharedCtor() {
::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
    reinterpret_cast<char*>(&bounds_) - reinterpret_cast<char*>(this)),
    0, static_cast<size_t>(reinterpret_cast<char*>(&background_n_) -
    reinterpret_cast<char*>(&bounds_)) + sizeof(background_n_));
}

MeshControl::~MeshControl() {
  // @@protoc_insertion_point(destructor:Messages.MeshControl)
  if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) {
  (void)arena;
    return;
  }
  SharedDtor();
}

inline void MeshControl::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  if (this != internal_default_instance()) delete bounds_;
}

void MeshControl::SetCachedSize(int size) const {
  _cached_size_.Set(size);
}

void MeshControl::Clear() {
// @@protoc_insertion_point(message_clear_start:Messages.MeshControl)
  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  symmetries_.Clear();
  if (GetArenaForAllocation() == nullptr && bounds_ != nullptr) {
    delete bounds_;
  }
  bounds_ = nullptr;
  ::memset(&target_n_, 0, static_cast<size_t>(
      reinterpret_cast<char*>(&background_n_) -
      reinterpret_cast<char*>(&target_n_)) + sizeof(background_n_));
  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

const char* MeshControl::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  while (!ctx->Done(&ptr)) {
    uint32_t tag;
    ptr = ::_pbi::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // uint64 target_n = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
          target_n_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // uint32 max_iterations = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
          max_iterations_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // double size_ratio = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 25)) {
          size_ratio_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<double>(ptr);
          ptr += sizeof(double);
        } else
          goto handle_unusual;
        continue;
      // double size_decay = 4;
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 33)) {
          size_decay_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<double>(ptr);
          ptr += sizeof(double);
        } else
          goto handle_unusual;
        continue;
      // double size_exponent = 5;
      case 5:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 41)) {
          size_exponent_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<double>(ptr);
          ptr += sizeof(double);
        } else
          goto handle_unusual;
        continue;
      // double curv_ratio = 6;
      case 6:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 49)) {
          curv_ratio_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<double>(ptr);
          ptr += sizeof(double);
        } else
          goto handle_unusual;
        continue;
      // double curv_decay = 7;
      case 7:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 57)) {
          curv_decay_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<double>(ptr);
          ptr += sizeof(double);
        } else
          goto handle_unusual;
        continue;
      // double curv_exponent = 8;
      case 8:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 65)) {
          curv_exponent_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<double>(ptr);
          ptr += sizeof(double);
        } else
          goto handle_unusual;
        continue;
      // double node_radius = 9;
      case 9:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 73)) {
          node_radius_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<double>(ptr);
          ptr += sizeof(double);
        } else
          goto handle_unusual;
        continue;
      // .Messages.Extrema bounds = 10;
      case 10:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 82)) {
          ptr = ctx->ParseMessage(_internal_mutable_bounds(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // uint32 length_units = 11;
      case 11:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 88)) {
          length_units_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // bool interior = 12;
      case 12:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 96)) {
          interior_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // bool exterior = 13;
      case 13:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 104)) {
          exterior_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // bool shell = 14;
      case 14:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 112)) {
          shell_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // bool equalize = 15;
      case 15:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 120)) {
          equalize_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // bool smooth = 16;
      case 16:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 128)) {
          smooth_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // bool include_background = 18;
      case 18:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 144)) {
          include_background_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // bool keep_existing_points = 19;
      case 19:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 152)) {
          keep_existing_points_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // bool auto_fit_domain = 20;
      case 20:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 160)) {
          auto_fit_domain_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // double boundary_layer_thickness = 23;
      case 23:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 185)) {
          boundary_layer_thickness_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<double>(ptr);
          ptr += sizeof(double);
        } else
          goto handle_unusual;
        continue;
      // repeated bool symmetries = 24;
      case 24:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 194)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedBoolParser(_internal_mutable_symmetries(), ptr, ctx);
          CHK_(ptr);
        } else if (static_cast<uint8_t>(tag) == 192) {
          _internal_add_symmetries(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr));
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // uint64 background_n = 30;
      case 30:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 240)) {
          background_n_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      default:
        goto handle_unusual;
    }  // switch
  handle_unusual:
    if ((tag == 0) || ((tag & 7) == 4)) {
      CHK_(ptr);
      ctx->SetLastTag(tag);
      goto message_done;
    }
    ptr = UnknownFieldParse(
        tag,
        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

uint8_t* MeshControl::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:Messages.MeshControl)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  // uint64 target_n = 1;
  if (this->_internal_target_n() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteUInt64ToArray(1, this->_internal_target_n(), target);
  }

  // uint32 max_iterations = 2;
  if (this->_internal_max_iterations() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteUInt32ToArray(2, this->_internal_max_iterations(), target);
  }

  // double size_ratio = 3;
  static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size.");
  double tmp_size_ratio = this->_internal_size_ratio();
  uint64_t raw_size_ratio;
  memcpy(&raw_size_ratio, &tmp_size_ratio, sizeof(tmp_size_ratio));
  if (raw_size_ratio != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteDoubleToArray(3, this->_internal_size_ratio(), target);
  }

  // double size_decay = 4;
  static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size.");
  double tmp_size_decay = this->_internal_size_decay();
  uint64_t raw_size_decay;
  memcpy(&raw_size_decay, &tmp_size_decay, sizeof(tmp_size_decay));
  if (raw_size_decay != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteDoubleToArray(4, this->_internal_size_decay(), target);
  }

  // double size_exponent = 5;
  static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size.");
  double tmp_size_exponent = this->_internal_size_exponent();
  uint64_t raw_size_exponent;
  memcpy(&raw_size_exponent, &tmp_size_exponent, sizeof(tmp_size_exponent));
  if (raw_size_exponent != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteDoubleToArray(5, this->_internal_size_exponent(), target);
  }

  // double curv_ratio = 6;
  static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size.");
  double tmp_curv_ratio = this->_internal_curv_ratio();
  uint64_t raw_curv_ratio;
  memcpy(&raw_curv_ratio, &tmp_curv_ratio, sizeof(tmp_curv_ratio));
  if (raw_curv_ratio != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteDoubleToArray(6, this->_internal_curv_ratio(), target);
  }

  // double curv_decay = 7;
  static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size.");
  double tmp_curv_decay = this->_internal_curv_decay();
  uint64_t raw_curv_decay;
  memcpy(&raw_curv_decay, &tmp_curv_decay, sizeof(tmp_curv_decay));
  if (raw_curv_decay != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteDoubleToArray(7, this->_internal_curv_decay(), target);
  }

  // double curv_exponent = 8;
  static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size.");
  double tmp_curv_exponent = this->_internal_curv_exponent();
  uint64_t raw_curv_exponent;
  memcpy(&raw_curv_exponent, &tmp_curv_exponent, sizeof(tmp_curv_exponent));
  if (raw_curv_exponent != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteDoubleToArray(8, this->_internal_curv_exponent(), target);
  }

  // double node_radius = 9;
  static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size.");
  double tmp_node_radius = this->_internal_node_radius();
  uint64_t raw_node_radius;
  memcpy(&raw_node_radius, &tmp_node_radius, sizeof(tmp_node_radius));
  if (raw_node_radius != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteDoubleToArray(9, this->_internal_node_radius(), target);
  }

  // .Messages.Extrema bounds = 10;
  if (this->_internal_has_bounds()) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(10, _Internal::bounds(this),
        _Internal::bounds(this).GetCachedSize(), target, stream);
  }

  // uint32 length_units = 11;
  if (this->_internal_length_units() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteUInt32ToArray(11, this->_internal_length_units(), target);
  }

  // bool interior = 12;
  if (this->_internal_interior() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteBoolToArray(12, this->_internal_interior(), target);
  }

  // bool exterior = 13;
  if (this->_internal_exterior() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteBoolToArray(13, this->_internal_exterior(), target);
  }

  // bool shell = 14;
  if (this->_internal_shell() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteBoolToArray(14, this->_internal_shell(), target);
  }

  // bool equalize = 15;
  if (this->_internal_equalize() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteBoolToArray(15, this->_internal_equalize(), target);
  }

  // bool smooth = 16;
  if (this->_internal_smooth() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteBoolToArray(16, this->_internal_smooth(), target);
  }

  // bool include_background = 18;
  if (this->_internal_include_background() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteBoolToArray(18, this->_internal_include_background(), target);
  }

  // bool keep_existing_points = 19;
  if (this->_internal_keep_existing_points() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteBoolToArray(19, this->_internal_keep_existing_points(), target);
  }

  // bool auto_fit_domain = 20;
  if (this->_internal_auto_fit_domain() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteBoolToArray(20, this->_internal_auto_fit_domain(), target);
  }

  // double boundary_layer_thickness = 23;
  static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size.");
  double tmp_boundary_layer_thickness = this->_internal_boundary_layer_thickness();
  uint64_t raw_boundary_layer_thickness;
  memcpy(&raw_boundary_layer_thickness, &tmp_boundary_layer_thickness, sizeof(tmp_boundary_layer_thickness));
  if (raw_boundary_layer_thickness != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteDoubleToArray(23, this->_internal_boundary_layer_thickness(), target);
  }

  // repeated bool symmetries = 24;
  if (this->_internal_symmetries_size() > 0) {
    target = stream->WriteFixedPacked(24, _internal_symmetries(), target);
  }

  // uint64 background_n = 30;
  if (this->_internal_background_n() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteUInt64ToArray(30, this->_internal_background_n(), target);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray(
        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
  }
  // @@protoc_insertion_point(serialize_to_array_end:Messages.MeshControl)
  return target;
}

size_t MeshControl::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:Messages.MeshControl)
  size_t total_size = 0;

  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  // repeated bool symmetries = 24;
  {
    unsigned int count = static_cast<unsigned int>(this->_internal_symmetries_size());
    size_t data_size = 1UL * count;
    if (data_size > 0) {
      total_size += 2 +
        ::_pbi::WireFormatLite::Int32Size(static_cast<int32_t>(data_size));
    }
    total_size += data_size;
  }

  // .Messages.Extrema bounds = 10;
  if (this->_internal_has_bounds()) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
        *bounds_);
  }

  // uint64 target_n = 1;
  if (this->_internal_target_n() != 0) {
    total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_target_n());
  }

  // double size_ratio = 3;
  static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size.");
  double tmp_size_ratio = this->_internal_size_ratio();
  uint64_t raw_size_ratio;
  memcpy(&raw_size_ratio, &tmp_size_ratio, sizeof(tmp_size_ratio));
  if (raw_size_ratio != 0) {
    total_size += 1 + 8;
  }

  // double size_decay = 4;
  static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size.");
  double tmp_size_decay = this->_internal_size_decay();
  uint64_t raw_size_decay;
  memcpy(&raw_size_decay, &tmp_size_decay, sizeof(tmp_size_decay));
  if (raw_size_decay != 0) {
    total_size += 1 + 8;
  }

  // double size_exponent = 5;
  static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size.");
  double tmp_size_exponent = this->_internal_size_exponent();
  uint64_t raw_size_exponent;
  memcpy(&raw_size_exponent, &tmp_size_exponent, sizeof(tmp_size_exponent));
  if (raw_size_exponent != 0) {
    total_size += 1 + 8;
  }

  // double curv_ratio = 6;
  static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size.");
  double tmp_curv_ratio = this->_internal_curv_ratio();
  uint64_t raw_curv_ratio;
  memcpy(&raw_curv_ratio, &tmp_curv_ratio, sizeof(tmp_curv_ratio));
  if (raw_curv_ratio != 0) {
    total_size += 1 + 8;
  }

  // uint32 max_iterations = 2;
  if (this->_internal_max_iterations() != 0) {
    total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_max_iterations());
  }

  // uint32 length_units = 11;
  if (this->_internal_length_units() != 0) {
    total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_length_units());
  }

  // double curv_decay = 7;
  static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size.");
  double tmp_curv_decay = this->_internal_curv_decay();
  uint64_t raw_curv_decay;
  memcpy(&raw_curv_decay, &tmp_curv_decay, sizeof(tmp_curv_decay));
  if (raw_curv_decay != 0) {
    total_size += 1 + 8;
  }

  // double curv_exponent = 8;
  static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size.");
  double tmp_curv_exponent = this->_internal_curv_exponent();
  uint64_t raw_curv_exponent;
  memcpy(&raw_curv_exponent, &tmp_curv_exponent, sizeof(tmp_curv_exponent));
  if (raw_curv_exponent != 0) {
    total_size += 1 + 8;
  }

  // double node_radius = 9;
  static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size.");
  double tmp_node_radius = this->_internal_node_radius();
  uint64_t raw_node_radius;
  memcpy(&raw_node_radius, &tmp_node_radius, sizeof(tmp_node_radius));
  if (raw_node_radius != 0) {
    total_size += 1 + 8;
  }

  // bool interior = 12;
  if (this->_internal_interior() != 0) {
    total_size += 1 + 1;
  }

  // bool exterior = 13;
  if (this->_internal_exterior() != 0) {
    total_size += 1 + 1;
  }

  // bool shell = 14;
  if (this->_internal_shell() != 0) {
    total_size += 1 + 1;
  }

  // bool equalize = 15;
  if (this->_internal_equalize() != 0) {
    total_size += 1 + 1;
  }

  // bool smooth = 16;
  if (this->_internal_smooth() != 0) {
    total_size += 2 + 1;
  }

  // bool include_background = 18;
  if (this->_internal_include_background() != 0) {
    total_size += 2 + 1;
  }

  // bool keep_existing_points = 19;
  if (this->_internal_keep_existing_points() != 0) {
    total_size += 2 + 1;
  }

  // bool auto_fit_domain = 20;
  if (this->_internal_auto_fit_domain() != 0) {
    total_size += 2 + 1;
  }

  // double boundary_layer_thickness = 23;
  static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size.");
  double tmp_boundary_layer_thickness = this->_internal_boundary_layer_thickness();
  uint64_t raw_boundary_layer_thickness;
  memcpy(&raw_boundary_layer_thickness, &tmp_boundary_layer_thickness, sizeof(tmp_boundary_layer_thickness));
  if (raw_boundary_layer_thickness != 0) {
    total_size += 2 + 8;
  }

  // uint64 background_n = 30;
  if (this->_internal_background_n() != 0) {
    total_size += 2 +
      ::_pbi::WireFormatLite::UInt64Size(
        this->_internal_background_n());
  }

  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
}

const ::PROTOBUF_NAMESPACE_ID::Message::ClassData MeshControl::_class_data_ = {
    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
    MeshControl::MergeImpl
};
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*MeshControl::GetClassData() const { return &_class_data_; }

void MeshControl::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
  static_cast<MeshControl *>(to)->MergeFrom(
      static_cast<const MeshControl &>(from));
}


void MeshControl::MergeFrom(const MeshControl& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:Messages.MeshControl)
  GOOGLE_DCHECK_NE(&from, this);
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  symmetries_.MergeFrom(from.symmetries_);
  if (from._internal_has_bounds()) {
    _internal_mutable_bounds()->::Messages::Extrema::MergeFrom(from._internal_bounds());
  }
  if (from._internal_target_n() != 0) {
    _internal_set_target_n(from._internal_target_n());
  }
  static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size.");
  double tmp_size_ratio = from._internal_size_ratio();
  uint64_t raw_size_ratio;
  memcpy(&raw_size_ratio, &tmp_size_ratio, sizeof(tmp_size_ratio));
  if (raw_size_ratio != 0) {
    _internal_set_size_ratio(from._internal_size_ratio());
  }
  static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size.");
  double tmp_size_decay = from._internal_size_decay();
  uint64_t raw_size_decay;
  memcpy(&raw_size_decay, &tmp_size_decay, sizeof(tmp_size_decay));
  if (raw_size_decay != 0) {
    _internal_set_size_decay(from._internal_size_decay());
  }
  static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size.");
  double tmp_size_exponent = from._internal_size_exponent();
  uint64_t raw_size_exponent;
  memcpy(&raw_size_exponent, &tmp_size_exponent, sizeof(tmp_size_exponent));
  if (raw_size_exponent != 0) {
    _internal_set_size_exponent(from._internal_size_exponent());
  }
  static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size.");
  double tmp_curv_ratio = from._internal_curv_ratio();
  uint64_t raw_curv_ratio;
  memcpy(&raw_curv_ratio, &tmp_curv_ratio, sizeof(tmp_curv_ratio));
  if (raw_curv_ratio != 0) {
    _internal_set_curv_ratio(from._internal_curv_ratio());
  }
  if (from._internal_max_iterations() != 0) {
    _internal_set_max_iterations(from._internal_max_iterations());
  }
  if (from._internal_length_units() != 0) {
    _internal_set_length_units(from._internal_length_units());
  }
  static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size.");
  double tmp_curv_decay = from._internal_curv_decay();
  uint64_t raw_curv_decay;
  memcpy(&raw_curv_decay, &tmp_curv_decay, sizeof(tmp_curv_decay));
  if (raw_curv_decay != 0) {
    _internal_set_curv_decay(from._internal_curv_decay());
  }
  static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size.");
  double tmp_curv_exponent = from._internal_curv_exponent();
  uint64_t raw_curv_exponent;
  memcpy(&raw_curv_exponent, &tmp_curv_exponent, sizeof(tmp_curv_exponent));
  if (raw_curv_exponent != 0) {
    _internal_set_curv_exponent(from._internal_curv_exponent());
  }
  static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size.");
  double tmp_node_radius = from._internal_node_radius();
  uint64_t raw_node_radius;
  memcpy(&raw_node_radius, &tmp_node_radius, sizeof(tmp_node_radius));
  if (raw_node_radius != 0) {
    _internal_set_node_radius(from._internal_node_radius());
  }
  if (from._internal_interior() != 0) {
    _internal_set_interior(from._internal_interior());
  }
  if (from._internal_exterior() != 0) {
    _internal_set_exterior(from._internal_exterior());
  }
  if (from._internal_shell() != 0) {
    _internal_set_shell(from._internal_shell());
  }
  if (from._internal_equalize() != 0) {
    _internal_set_equalize(from._internal_equalize());
  }
  if (from._internal_smooth() != 0) {
    _internal_set_smooth(from._internal_smooth());
  }
  if (from._internal_include_background() != 0) {
    _internal_set_include_background(from._internal_include_background());
  }
  if (from._internal_keep_existing_points() != 0) {
    _internal_set_keep_existing_points(from._internal_keep_existing_points());
  }
  if (from._internal_auto_fit_domain() != 0) {
    _internal_set_auto_fit_domain(from._internal_auto_fit_domain());
  }
  static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size.");
  double tmp_boundary_layer_thickness = from._internal_boundary_layer_thickness();
  uint64_t raw_boundary_layer_thickness;
  memcpy(&raw_boundary_layer_thickness, &tmp_boundary_layer_thickness, sizeof(tmp_boundary_layer_thickness));
  if (raw_boundary_layer_thickness != 0) {
    _internal_set_boundary_layer_thickness(from._internal_boundary_layer_thickness());
  }
  if (from._internal_background_n() != 0) {
    _internal_set_background_n(from._internal_background_n());
  }
  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

void MeshControl::CopyFrom(const MeshControl& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:Messages.MeshControl)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool MeshControl::IsInitialized() const {
  return true;
}

void MeshControl::InternalSwap(MeshControl* other) {
  using std::swap;
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  symmetries_.InternalSwap(&other->symmetries_);
  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
      PROTOBUF_FIELD_OFFSET(MeshControl, background_n_)
      + sizeof(MeshControl::background_n_)
      - PROTOBUF_FIELD_OFFSET(MeshControl, bounds_)>(
          reinterpret_cast<char*>(&bounds_),
          reinterpret_cast<char*>(&other->bounds_));
}

::PROTOBUF_NAMESPACE_ID::Metadata MeshControl::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_spatial_2eproto_getter, &descriptor_table_spatial_2eproto_once,
      file_level_metadata_spatial_2eproto[2]);
}

// ===================================================================

class TreeControl::_Internal {
 public:
  static const ::Messages::Extrema& bounds(const TreeControl* msg);
};

const ::Messages::Extrema&
TreeControl::_Internal::bounds(const TreeControl* msg) {
  return *msg->bounds_;
}
void TreeControl::clear_bounds() {
  if (GetArenaForAllocation() == nullptr && bounds_ != nullptr) {
    delete bounds_;
  }
  bounds_ = nullptr;
}
TreeControl::TreeControl(::PROTOBUF_NAMESPACE_ID::Arena* arena,
                         bool is_message_owned)
  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
  SharedCtor();
  // @@protoc_insertion_point(arena_constructor:Messages.TreeControl)
}
TreeControl::TreeControl(const TreeControl& from)
  : ::PROTOBUF_NAMESPACE_ID::Message() {
  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  if (from._internal_has_bounds()) {
    bounds_ = new ::Messages::Extrema(*from.bounds_);
  } else {
    bounds_ = nullptr;
  }
  ::memcpy(&min_depth_, &from.min_depth_,
    static_cast<size_t>(reinterpret_cast<char*>(&length_units_) -
    reinterpret_cast<char*>(&min_depth_)) + sizeof(length_units_));
  // @@protoc_insertion_point(copy_constructor:Messages.TreeControl)
}

inline void TreeControl::SharedCtor() {
::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
    reinterpret_cast<char*>(&bounds_) - reinterpret_cast<char*>(this)),
    0, static_cast<size_t>(reinterpret_cast<char*>(&length_units_) -
    reinterpret_cast<char*>(&bounds_)) + sizeof(length_units_));
}

TreeControl::~TreeControl() {
  // @@protoc_insertion_point(destructor:Messages.TreeControl)
  if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) {
  (void)arena;
    return;
  }
  SharedDtor();
}

inline void TreeControl::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  if (this != internal_default_instance()) delete bounds_;
}

void TreeControl::SetCachedSize(int size) const {
  _cached_size_.Set(size);
}

void TreeControl::Clear() {
// @@protoc_insertion_point(message_clear_start:Messages.TreeControl)
  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  if (GetArenaForAllocation() == nullptr && bounds_ != nullptr) {
    delete bounds_;
  }
  bounds_ = nullptr;
  ::memset(&min_depth_, 0, static_cast<size_t>(
      reinterpret_cast<char*>(&length_units_) -
      reinterpret_cast<char*>(&min_depth_)) + sizeof(length_units_));
  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

const char* TreeControl::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  while (!ctx->Done(&ptr)) {
    uint32_t tag;
    ptr = ::_pbi::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // uint32 min_depth = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
          min_depth_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // uint32 max_depth = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
          max_depth_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // uint64 max_size = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
          max_size_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // uint32 ref_dimensionality = 7;
      case 7:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 56)) {
          ref_dimensionality_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // uint32 length_units = 8;
      case 8:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 64)) {
          length_units_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // .Messages.Extrema bounds = 10;
      case 10:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 82)) {
          ptr = ctx->ParseMessage(_internal_mutable_bounds(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      default:
        goto handle_unusual;
    }  // switch
  handle_unusual:
    if ((tag == 0) || ((tag & 7) == 4)) {
      CHK_(ptr);
      ctx->SetLastTag(tag);
      goto message_done;
    }
    ptr = UnknownFieldParse(
        tag,
        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

uint8_t* TreeControl::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:Messages.TreeControl)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  // uint32 min_depth = 1;
  if (this->_internal_min_depth() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteUInt32ToArray(1, this->_internal_min_depth(), target);
  }

  // uint32 max_depth = 2;
  if (this->_internal_max_depth() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteUInt32ToArray(2, this->_internal_max_depth(), target);
  }

  // uint64 max_size = 3;
  if (this->_internal_max_size() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteUInt64ToArray(3, this->_internal_max_size(), target);
  }

  // uint32 ref_dimensionality = 7;
  if (this->_internal_ref_dimensionality() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteUInt32ToArray(7, this->_internal_ref_dimensionality(), target);
  }

  // uint32 length_units = 8;
  if (this->_internal_length_units() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteUInt32ToArray(8, this->_internal_length_units(), target);
  }

  // .Messages.Extrema bounds = 10;
  if (this->_internal_has_bounds()) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(10, _Internal::bounds(this),
        _Internal::bounds(this).GetCachedSize(), target, stream);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray(
        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
  }
  // @@protoc_insertion_point(serialize_to_array_end:Messages.TreeControl)
  return target;
}

size_t TreeControl::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:Messages.TreeControl)
  size_t total_size = 0;

  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  // .Messages.Extrema bounds = 10;
  if (this->_internal_has_bounds()) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
        *bounds_);
  }

  // uint32 min_depth = 1;
  if (this->_internal_min_depth() != 0) {
    total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_min_depth());
  }

  // uint32 max_depth = 2;
  if (this->_internal_max_depth() != 0) {
    total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_max_depth());
  }

  // uint64 max_size = 3;
  if (this->_internal_max_size() != 0) {
    total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_max_size());
  }

  // uint32 ref_dimensionality = 7;
  if (this->_internal_ref_dimensionality() != 0) {
    total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_ref_dimensionality());
  }

  // uint32 length_units = 8;
  if (this->_internal_length_units() != 0) {
    total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_length_units());
  }

  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
}

const ::PROTOBUF_NAMESPACE_ID::Message::ClassData TreeControl::_class_data_ = {
    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
    TreeControl::MergeImpl
};
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*TreeControl::GetClassData() const { return &_class_data_; }

void TreeControl::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
  static_cast<TreeControl *>(to)->MergeFrom(
      static_cast<const TreeControl &>(from));
}


void TreeControl::MergeFrom(const TreeControl& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:Messages.TreeControl)
  GOOGLE_DCHECK_NE(&from, this);
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  if (from._internal_has_bounds()) {
    _internal_mutable_bounds()->::Messages::Extrema::MergeFrom(from._internal_bounds());
  }
  if (from._internal_min_depth() != 0) {
    _internal_set_min_depth(from._internal_min_depth());
  }
  if (from._internal_max_depth() != 0) {
    _internal_set_max_depth(from._internal_max_depth());
  }
  if (from._internal_max_size() != 0) {
    _internal_set_max_size(from._internal_max_size());
  }
  if (from._internal_ref_dimensionality() != 0) {
    _internal_set_ref_dimensionality(from._internal_ref_dimensionality());
  }
  if (from._internal_length_units() != 0) {
    _internal_set_length_units(from._internal_length_units());
  }
  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

void TreeControl::CopyFrom(const TreeControl& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:Messages.TreeControl)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool TreeControl::IsInitialized() const {
  return true;
}

void TreeControl::InternalSwap(TreeControl* other) {
  using std::swap;
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
      PROTOBUF_FIELD_OFFSET(TreeControl, length_units_)
      + sizeof(TreeControl::length_units_)
      - PROTOBUF_FIELD_OFFSET(TreeControl, bounds_)>(
          reinterpret_cast<char*>(&bounds_),
          reinterpret_cast<char*>(&other->bounds_));
}

::PROTOBUF_NAMESPACE_ID::Metadata TreeControl::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_spatial_2eproto_getter, &descriptor_table_spatial_2eproto_once,
      file_level_metadata_spatial_2eproto[3]);
}

// ===================================================================

class Topology::_Internal {
 public:
  static const ::Messages::Revision& revision(const Topology* msg);
  static const ::Messages::Elements& nodes(const Topology* msg);
  static const ::Messages::Elements& edges(const Topology* msg);
  static const ::Messages::Elements& faces(const Topology* msg);
  static const ::Messages::Elements& cells(const Topology* msg);
  static const ::Messages::Record64& data(const Topology* msg);
  static const ::Messages::GridControl& grid_control(const Topology* msg);
  static const ::Messages::MeshControl& mesh_control(const Topology* msg);
  static const ::Messages::TreeControl& tree_control(const Topology* msg);
};

const ::Messages::Revision&
Topology::_Internal::revision(const Topology* msg) {
  return *msg->revision_;
}
const ::Messages::Elements&
Topology::_Internal::nodes(const Topology* msg) {
  return *msg->nodes_;
}
const ::Messages::Elements&
Topology::_Internal::edges(const Topology* msg) {
  return *msg->edges_;
}
const ::Messages::Elements&
Topology::_Internal::faces(const Topology* msg) {
  return *msg->faces_;
}
const ::Messages::Elements&
Topology::_Internal::cells(const Topology* msg) {
  return *msg->cells_;
}
const ::Messages::Record64&
Topology::_Internal::data(const Topology* msg) {
  return *msg->data_;
}
const ::Messages::GridControl&
Topology::_Internal::grid_control(const Topology* msg) {
  return *msg->grid_control_;
}
const ::Messages::MeshControl&
Topology::_Internal::mesh_control(const Topology* msg) {
  return *msg->mesh_control_;
}
const ::Messages::TreeControl&
Topology::_Internal::tree_control(const Topology* msg) {
  return *msg->tree_control_;
}
void Topology::clear_revision() {
  if (GetArenaForAllocation() == nullptr && revision_ != nullptr) {
    delete revision_;
  }
  revision_ = nullptr;
}
void Topology::clear_nodes() {
  if (GetArenaForAllocation() == nullptr && nodes_ != nullptr) {
    delete nodes_;
  }
  nodes_ = nullptr;
}
void Topology::clear_edges() {
  if (GetArenaForAllocation() == nullptr && edges_ != nullptr) {
    delete edges_;
  }
  edges_ = nullptr;
}
void Topology::clear_faces() {
  if (GetArenaForAllocation() == nullptr && faces_ != nullptr) {
    delete faces_;
  }
  faces_ = nullptr;
}
void Topology::clear_cells() {
  if (GetArenaForAllocation() == nullptr && cells_ != nullptr) {
    delete cells_;
  }
  cells_ = nullptr;
}
void Topology::clear_data() {
  if (GetArenaForAllocation() == nullptr && data_ != nullptr) {
    delete data_;
  }
  data_ = nullptr;
}
void Topology::clear_sparse_data() {
  sparse_data_.Clear();
}
Topology::Topology(::PROTOBUF_NAMESPACE_ID::Arena* arena,
                         bool is_message_owned)
  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned),
  sparse_data_(arena) {
  SharedCtor();
  // @@protoc_insertion_point(arena_constructor:Messages.Topology)
}
Topology::Topology(const Topology& from)
  : ::PROTOBUF_NAMESPACE_ID::Message(),
      sparse_data_(from.sparse_data_) {
  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  name_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    name_.Set("", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (!from._internal_name().empty()) {
    name_.Set(from._internal_name(), 
      GetArenaForAllocation());
  }
  filename_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    filename_.Set("", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (!from._internal_filename().empty()) {
    filename_.Set(from._internal_filename(), 
      GetArenaForAllocation());
  }
  info_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    info_.Set("", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (!from._internal_info().empty()) {
    info_.Set(from._internal_info(), 
      GetArenaForAllocation());
  }
  if (from._internal_has_revision()) {
    revision_ = new ::Messages::Revision(*from.revision_);
  } else {
    revision_ = nullptr;
  }
  if (from._internal_has_nodes()) {
    nodes_ = new ::Messages::Elements(*from.nodes_);
  } else {
    nodes_ = nullptr;
  }
  if (from._internal_has_edges()) {
    edges_ = new ::Messages::Elements(*from.edges_);
  } else {
    edges_ = nullptr;
  }
  if (from._internal_has_faces()) {
    faces_ = new ::Messages::Elements(*from.faces_);
  } else {
    faces_ = nullptr;
  }
  if (from._internal_has_cells()) {
    cells_ = new ::Messages::Elements(*from.cells_);
  } else {
    cells_ = nullptr;
  }
  if (from._internal_has_data()) {
    data_ = new ::Messages::Record64(*from.data_);
  } else {
    data_ = nullptr;
  }
  if (from._internal_has_grid_control()) {
    grid_control_ = new ::Messages::GridControl(*from.grid_control_);
  } else {
    grid_control_ = nullptr;
  }
  if (from._internal_has_mesh_control()) {
    mesh_control_ = new ::Messages::MeshControl(*from.mesh_control_);
  } else {
    mesh_control_ = nullptr;
  }
  if (from._internal_has_tree_control()) {
    tree_control_ = new ::Messages::TreeControl(*from.tree_control_);
  } else {
    tree_control_ = nullptr;
  }
  ::memcpy(&type_, &from.type_,
    static_cast<size_t>(reinterpret_cast<char*>(&basis_) -
    reinterpret_cast<char*>(&type_)) + sizeof(basis_));
  // @@protoc_insertion_point(copy_constructor:Messages.Topology)
}

inline void Topology::SharedCtor() {
name_.InitDefault();
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
  name_.Set("", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
filename_.InitDefault();
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
  filename_.Set("", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
info_.InitDefault();
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
  info_.Set("", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
    reinterpret_cast<char*>(&revision_) - reinterpret_cast<char*>(this)),
    0, static_cast<size_t>(reinterpret_cast<char*>(&basis_) -
    reinterpret_cast<char*>(&revision_)) + sizeof(basis_));
}

Topology::~Topology() {
  // @@protoc_insertion_point(destructor:Messages.Topology)
  if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) {
  (void)arena;
    return;
  }
  SharedDtor();
}

inline void Topology::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  name_.Destroy();
  filename_.Destroy();
  info_.Destroy();
  if (this != internal_default_instance()) delete revision_;
  if (this != internal_default_instance()) delete nodes_;
  if (this != internal_default_instance()) delete edges_;
  if (this != internal_default_instance()) delete faces_;
  if (this != internal_default_instance()) delete cells_;
  if (this != internal_default_instance()) delete data_;
  if (this != internal_default_instance()) delete grid_control_;
  if (this != internal_default_instance()) delete mesh_control_;
  if (this != internal_default_instance()) delete tree_control_;
}

void Topology::SetCachedSize(int size) const {
  _cached_size_.Set(size);
}

void Topology::Clear() {
// @@protoc_insertion_point(message_clear_start:Messages.Topology)
  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  sparse_data_.Clear();
  name_.ClearToEmpty();
  filename_.ClearToEmpty();
  info_.ClearToEmpty();
  if (GetArenaForAllocation() == nullptr && revision_ != nullptr) {
    delete revision_;
  }
  revision_ = nullptr;
  if (GetArenaForAllocation() == nullptr && nodes_ != nullptr) {
    delete nodes_;
  }
  nodes_ = nullptr;
  if (GetArenaForAllocation() == nullptr && edges_ != nullptr) {
    delete edges_;
  }
  edges_ = nullptr;
  if (GetArenaForAllocation() == nullptr && faces_ != nullptr) {
    delete faces_;
  }
  faces_ = nullptr;
  if (GetArenaForAllocation() == nullptr && cells_ != nullptr) {
    delete cells_;
  }
  cells_ = nullptr;
  if (GetArenaForAllocation() == nullptr && data_ != nullptr) {
    delete data_;
  }
  data_ = nullptr;
  if (GetArenaForAllocation() == nullptr && grid_control_ != nullptr) {
    delete grid_control_;
  }
  grid_control_ = nullptr;
  if (GetArenaForAllocation() == nullptr && mesh_control_ != nullptr) {
    delete mesh_control_;
  }
  mesh_control_ = nullptr;
  if (GetArenaForAllocation() == nullptr && tree_control_ != nullptr) {
    delete tree_control_;
  }
  tree_control_ = nullptr;
  ::memset(&type_, 0, static_cast<size_t>(
      reinterpret_cast<char*>(&basis_) -
      reinterpret_cast<char*>(&type_)) + sizeof(basis_));
  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

const char* Topology::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  while (!ctx->Done(&ptr)) {
    uint32_t tag;
    ptr = ::_pbi::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // string name = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
          auto str = _internal_mutable_name();
          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
          CHK_(::_pbi::VerifyUTF8(str, "Messages.Topology.name"));
        } else
          goto handle_unusual;
        continue;
      // uint32 type = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
          type_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // uint32 ndim = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
          ndim_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // uint32 basis = 4;
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 32)) {
          basis_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // string filename = 5;
      case 5:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 42)) {
          auto str = _internal_mutable_filename();
          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
          CHK_(::_pbi::VerifyUTF8(str, "Messages.Topology.filename"));
        } else
          goto handle_unusual;
        continue;
      // .Messages.Revision revision = 6;
      case 6:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 50)) {
          ptr = ctx->ParseMessage(_internal_mutable_revision(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // string info = 7;
      case 7:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 58)) {
          auto str = _internal_mutable_info();
          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
          CHK_(::_pbi::VerifyUTF8(str, "Messages.Topology.info"));
        } else
          goto handle_unusual;
        continue;
      // .Messages.Elements nodes = 10;
      case 10:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 82)) {
          ptr = ctx->ParseMessage(_internal_mutable_nodes(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // .Messages.Elements edges = 11;
      case 11:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 90)) {
          ptr = ctx->ParseMessage(_internal_mutable_edges(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // .Messages.Elements faces = 12;
      case 12:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 98)) {
          ptr = ctx->ParseMessage(_internal_mutable_faces(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // .Messages.Elements cells = 13;
      case 13:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 106)) {
          ptr = ctx->ParseMessage(_internal_mutable_cells(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // .Messages.Record64 data = 15;
      case 15:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 122)) {
          ptr = ctx->ParseMessage(_internal_mutable_data(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // repeated .Messages.SparseMatrix sparse_data = 16;
      case 16:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 130)) {
          ptr -= 2;
          do {
            ptr += 2;
            ptr = ctx->ParseMessage(_internal_add_sparse_data(), ptr);
            CHK_(ptr);
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<130>(ptr));
        } else
          goto handle_unusual;
        continue;
      // .Messages.GridControl grid_control = 20;
      case 20:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 162)) {
          ptr = ctx->ParseMessage(_internal_mutable_grid_control(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // .Messages.MeshControl mesh_control = 21;
      case 21:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 170)) {
          ptr = ctx->ParseMessage(_internal_mutable_mesh_control(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // .Messages.TreeControl tree_control = 22;
      case 22:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 178)) {
          ptr = ctx->ParseMessage(_internal_mutable_tree_control(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      default:
        goto handle_unusual;
    }  // switch
  handle_unusual:
    if ((tag == 0) || ((tag & 7) == 4)) {
      CHK_(ptr);
      ctx->SetLastTag(tag);
      goto message_done;
    }
    ptr = UnknownFieldParse(
        tag,
        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

uint8_t* Topology::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:Messages.Topology)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  // string name = 1;
  if (!this->_internal_name().empty()) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
      this->_internal_name().data(), static_cast<int>(this->_internal_name().length()),
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
      "Messages.Topology.name");
    target = stream->WriteStringMaybeAliased(
        1, this->_internal_name(), target);
  }

  // uint32 type = 2;
  if (this->_internal_type() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteUInt32ToArray(2, this->_internal_type(), target);
  }

  // uint32 ndim = 3;
  if (this->_internal_ndim() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteUInt32ToArray(3, this->_internal_ndim(), target);
  }

  // uint32 basis = 4;
  if (this->_internal_basis() != 0) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteUInt32ToArray(4, this->_internal_basis(), target);
  }

  // string filename = 5;
  if (!this->_internal_filename().empty()) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
      this->_internal_filename().data(), static_cast<int>(this->_internal_filename().length()),
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
      "Messages.Topology.filename");
    target = stream->WriteStringMaybeAliased(
        5, this->_internal_filename(), target);
  }

  // .Messages.Revision revision = 6;
  if (this->_internal_has_revision()) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(6, _Internal::revision(this),
        _Internal::revision(this).GetCachedSize(), target, stream);
  }

  // string info = 7;
  if (!this->_internal_info().empty()) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
      this->_internal_info().data(), static_cast<int>(this->_internal_info().length()),
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
      "Messages.Topology.info");
    target = stream->WriteStringMaybeAliased(
        7, this->_internal_info(), target);
  }

  // .Messages.Elements nodes = 10;
  if (this->_internal_has_nodes()) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(10, _Internal::nodes(this),
        _Internal::nodes(this).GetCachedSize(), target, stream);
  }

  // .Messages.Elements edges = 11;
  if (this->_internal_has_edges()) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(11, _Internal::edges(this),
        _Internal::edges(this).GetCachedSize(), target, stream);
  }

  // .Messages.Elements faces = 12;
  if (this->_internal_has_faces()) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(12, _Internal::faces(this),
        _Internal::faces(this).GetCachedSize(), target, stream);
  }

  // .Messages.Elements cells = 13;
  if (this->_internal_has_cells()) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(13, _Internal::cells(this),
        _Internal::cells(this).GetCachedSize(), target, stream);
  }

  // .Messages.Record64 data = 15;
  if (this->_internal_has_data()) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(15, _Internal::data(this),
        _Internal::data(this).GetCachedSize(), target, stream);
  }

  // repeated .Messages.SparseMatrix sparse_data = 16;
  for (unsigned i = 0,
      n = static_cast<unsigned>(this->_internal_sparse_data_size()); i < n; i++) {
    const auto& repfield = this->_internal_sparse_data(i);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
        InternalWriteMessage(16, repfield, repfield.GetCachedSize(), target, stream);
  }

  // .Messages.GridControl grid_control = 20;
  if (this->_internal_has_grid_control()) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(20, _Internal::grid_control(this),
        _Internal::grid_control(this).GetCachedSize(), target, stream);
  }

  // .Messages.MeshControl mesh_control = 21;
  if (this->_internal_has_mesh_control()) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(21, _Internal::mesh_control(this),
        _Internal::mesh_control(this).GetCachedSize(), target, stream);
  }

  // .Messages.TreeControl tree_control = 22;
  if (this->_internal_has_tree_control()) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(22, _Internal::tree_control(this),
        _Internal::tree_control(this).GetCachedSize(), target, stream);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray(
        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
  }
  // @@protoc_insertion_point(serialize_to_array_end:Messages.Topology)
  return target;
}

size_t Topology::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:Messages.Topology)
  size_t total_size = 0;

  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  // repeated .Messages.SparseMatrix sparse_data = 16;
  total_size += 2UL * this->_internal_sparse_data_size();
  for (const auto& msg : this->sparse_data_) {
    total_size +=
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
  }

  // string name = 1;
  if (!this->_internal_name().empty()) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
        this->_internal_name());
  }

  // string filename = 5;
  if (!this->_internal_filename().empty()) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
        this->_internal_filename());
  }

  // string info = 7;
  if (!this->_internal_info().empty()) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
        this->_internal_info());
  }

  // .Messages.Revision revision = 6;
  if (this->_internal_has_revision()) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
        *revision_);
  }

  // .Messages.Elements nodes = 10;
  if (this->_internal_has_nodes()) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
        *nodes_);
  }

  // .Messages.Elements edges = 11;
  if (this->_internal_has_edges()) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
        *edges_);
  }

  // .Messages.Elements faces = 12;
  if (this->_internal_has_faces()) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
        *faces_);
  }

  // .Messages.Elements cells = 13;
  if (this->_internal_has_cells()) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
        *cells_);
  }

  // .Messages.Record64 data = 15;
  if (this->_internal_has_data()) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
        *data_);
  }

  // .Messages.GridControl grid_control = 20;
  if (this->_internal_has_grid_control()) {
    total_size += 2 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
        *grid_control_);
  }

  // .Messages.MeshControl mesh_control = 21;
  if (this->_internal_has_mesh_control()) {
    total_size += 2 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
        *mesh_control_);
  }

  // .Messages.TreeControl tree_control = 22;
  if (this->_internal_has_tree_control()) {
    total_size += 2 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
        *tree_control_);
  }

  // uint32 type = 2;
  if (this->_internal_type() != 0) {
    total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_type());
  }

  // uint32 ndim = 3;
  if (this->_internal_ndim() != 0) {
    total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_ndim());
  }

  // uint32 basis = 4;
  if (this->_internal_basis() != 0) {
    total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_basis());
  }

  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
}

const ::PROTOBUF_NAMESPACE_ID::Message::ClassData Topology::_class_data_ = {
    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
    Topology::MergeImpl
};
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*Topology::GetClassData() const { return &_class_data_; }

void Topology::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
  static_cast<Topology *>(to)->MergeFrom(
      static_cast<const Topology &>(from));
}


void Topology::MergeFrom(const Topology& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:Messages.Topology)
  GOOGLE_DCHECK_NE(&from, this);
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  sparse_data_.MergeFrom(from.sparse_data_);
  if (!from._internal_name().empty()) {
    _internal_set_name(from._internal_name());
  }
  if (!from._internal_filename().empty()) {
    _internal_set_filename(from._internal_filename());
  }
  if (!from._internal_info().empty()) {
    _internal_set_info(from._internal_info());
  }
  if (from._internal_has_revision()) {
    _internal_mutable_revision()->::Messages::Revision::MergeFrom(from._internal_revision());
  }
  if (from._internal_has_nodes()) {
    _internal_mutable_nodes()->::Messages::Elements::MergeFrom(from._internal_nodes());
  }
  if (from._internal_has_edges()) {
    _internal_mutable_edges()->::Messages::Elements::MergeFrom(from._internal_edges());
  }
  if (from._internal_has_faces()) {
    _internal_mutable_faces()->::Messages::Elements::MergeFrom(from._internal_faces());
  }
  if (from._internal_has_cells()) {
    _internal_mutable_cells()->::Messages::Elements::MergeFrom(from._internal_cells());
  }
  if (from._internal_has_data()) {
    _internal_mutable_data()->::Messages::Record64::MergeFrom(from._internal_data());
  }
  if (from._internal_has_grid_control()) {
    _internal_mutable_grid_control()->::Messages::GridControl::MergeFrom(from._internal_grid_control());
  }
  if (from._internal_has_mesh_control()) {
    _internal_mutable_mesh_control()->::Messages::MeshControl::MergeFrom(from._internal_mesh_control());
  }
  if (from._internal_has_tree_control()) {
    _internal_mutable_tree_control()->::Messages::TreeControl::MergeFrom(from._internal_tree_control());
  }
  if (from._internal_type() != 0) {
    _internal_set_type(from._internal_type());
  }
  if (from._internal_ndim() != 0) {
    _internal_set_ndim(from._internal_ndim());
  }
  if (from._internal_basis() != 0) {
    _internal_set_basis(from._internal_basis());
  }
  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

void Topology::CopyFrom(const Topology& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:Messages.Topology)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool Topology::IsInitialized() const {
  return true;
}

void Topology::InternalSwap(Topology* other) {
  using std::swap;
  auto* lhs_arena = GetArenaForAllocation();
  auto* rhs_arena = other->GetArenaForAllocation();
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  sparse_data_.InternalSwap(&other->sparse_data_);
  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
      &name_, lhs_arena,
      &other->name_, rhs_arena
  );
  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
      &filename_, lhs_arena,
      &other->filename_, rhs_arena
  );
  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
      &info_, lhs_arena,
      &other->info_, rhs_arena
  );
  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
      PROTOBUF_FIELD_OFFSET(Topology, basis_)
      + sizeof(Topology::basis_)
      - PROTOBUF_FIELD_OFFSET(Topology, revision_)>(
          reinterpret_cast<char*>(&revision_),
          reinterpret_cast<char*>(&other->revision_));
}

::PROTOBUF_NAMESPACE_ID::Metadata Topology::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_spatial_2eproto_getter, &descriptor_table_spatial_2eproto_once,
      file_level_metadata_spatial_2eproto[4]);
}

// @@protoc_insertion_point(namespace_scope)
}  // namespace Messages
PROTOBUF_NAMESPACE_OPEN
template<> PROTOBUF_NOINLINE ::Messages::Zone*
Arena::CreateMaybeMessage< ::Messages::Zone >(Arena* arena) {
  return Arena::CreateMessageInternal< ::Messages::Zone >(arena);
}
template<> PROTOBUF_NOINLINE ::Messages::GridControl*
Arena::CreateMaybeMessage< ::Messages::GridControl >(Arena* arena) {
  return Arena::CreateMessageInternal< ::Messages::GridControl >(arena);
}
template<> PROTOBUF_NOINLINE ::Messages::MeshControl*
Arena::CreateMaybeMessage< ::Messages::MeshControl >(Arena* arena) {
  return Arena::CreateMessageInternal< ::Messages::MeshControl >(arena);
}
template<> PROTOBUF_NOINLINE ::Messages::TreeControl*
Arena::CreateMaybeMessage< ::Messages::TreeControl >(Arena* arena) {
  return Arena::CreateMessageInternal< ::Messages::TreeControl >(arena);
}
template<> PROTOBUF_NOINLINE ::Messages::Topology*
Arena::CreateMaybeMessage< ::Messages::Topology >(Arena* arena) {
  return Arena::CreateMessageInternal< ::Messages::Topology >(arena);
}
PROTOBUF_NAMESPACE_CLOSE

// @@protoc_insertion_point(global_scope)
#include <google/protobuf/port_undef.inc>
